text
stringlengths
3
1.05M
'use strict'; module.exports = /(\w{3})[()\s\d]*$/;
/** * Copyright 2017 IBM Corp. All Rights Reserved. * * 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 React from 'react'; import PropTypes from 'prop-types'; import Matches from '../Matches'; import { TagCloud } from 'react-tagcloud'; import { Grid, Dimmer, Loader, Header, Divider, List } from 'semantic-ui-react'; const utils = require('../../../lib/utils'); /** * This object serves as the panel containing all common query results. * * It provides a tag cloud of top keywords, a top 5 list of entities, * and a list or relevant reviews. */ export default class QueryResultsPanel extends React.Component { constructor(...props) { super(...props); this.state = { queryData: this.props.queryData, queryType: this.props.queryType }; } /** * getEntities - return top 5 entities for placement in list. */ getEntities() { const { queryData, queryType } = this.state; var entities = []; if (queryData[queryType] && queryData[queryType].data.matching_results) { const data = queryData[queryType].data.aggregations[utils.ENTITY_DATA_INDEX]; // get top 5 entities var count = 0; data.results.forEach(function(item) { if (count < 5) { var entry = { id: count, text: item.key }; entities.push(entry); count = count + 1; } }); } return entities; } /** * getKeywords - return top 10 keywords to display in the tag cloud. */ getKeywords() { const { queryData, queryType } = this.state; var keywords = []; if (queryData[queryType] && queryData[queryType].data.matching_results) { const data = queryData[queryType].data.aggregations[utils.KEYWORD_DATA_INDEX]; // get top 10 keywords var count = 0; data.results.forEach(function(item) { if (count < 10) { var entry = { count: count, value: item.key }; keywords.push(entry); count = count + 1; } }); } return keywords; } /** * getReviews - return panel displaying review data. */ getReviews() { const { queryData, queryType } = this.state; // get top reviews var reviews = utils.formatData(queryData[queryType].data); return ( <Matches matches={ reviews.results } /> ); } /** * render - return the panel object to render. */ render() { const { queryData, queryType } = this.state; const tagCloudOptions = { luminosity: 'light', hue: 'blue' }; return ( <div className="query-results-panel"> { queryData[queryType].loading ? ( <div> <div className="loader--container" style={{height: 572}}> <Dimmer active inverted> <Loader>Loading</Loader> </Dimmer> </div> </div> ) : queryData[queryType].data ? ( <div> <Grid className='query-data-results'> <Grid.Row> <Grid.Column width={12}> <Header as='h3' textAlign='center'> Keyword Cloud </Header> <TagCloud tags={ this.getKeywords() } minSize={16} maxSize={64} colorOptions={tagCloudOptions} /> </Grid.Column> <Grid.Column width={4} textAlign='left'> <Header as='h3'> Top Entities </Header> <List ordered> { this.getEntities().map(item => <List.Item key={item.id}> { item.text } </List.Item> ) } </List> </Grid.Column> </Grid.Row> <Divider clearing/> <Grid.Row> <Grid.Column width={16} textAlign='center'> <Header as='h3' textAlign='center'> Relevant Customer Reviews </Header> <div> {this.getReviews()} </div> </Grid.Column> </Grid.Row> </Grid> </div> ) : queryData[queryType].error ? ( <div className="results"> <div className="_container _container_large"> <div className="row"> {JSON.stringify(queryData[queryType].error)} </div> </div> </div> ) : ( <Grid className='query-data-no-results'> <Grid.Row> <Grid.Column width={16}> <Header as='h3' textAlign='center'> Select Category and Query </Header> </Grid.Column> </Grid.Row> </Grid> )} </div> ); } } // type check to ensure we are called correctly QueryResultsPanel.propTypes = { queryType: PropTypes.number, queryData: PropTypes.array };
/** * @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 */ export class ElementSchemaRegistry { } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxlbWVudF9zY2hlbWFfcmVnaXN0cnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvc2NoZW1hL2VsZW1lbnRfc2NoZW1hX3JlZ2lzdHJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUlILE1BQU07Q0FjTCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgSW5jLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuaW1wb3J0IHtTY2hlbWFNZXRhZGF0YSwgU2VjdXJpdHlDb250ZXh0fSBmcm9tICcuLi9jb3JlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIEVsZW1lbnRTY2hlbWFSZWdpc3RyeSB7XG4gIGFic3RyYWN0IGhhc1Byb3BlcnR5KHRhZ05hbWU6IHN0cmluZywgcHJvcE5hbWU6IHN0cmluZywgc2NoZW1hTWV0YXM6IFNjaGVtYU1ldGFkYXRhW10pOiBib29sZWFuO1xuICBhYnN0cmFjdCBoYXNFbGVtZW50KHRhZ05hbWU6IHN0cmluZywgc2NoZW1hTWV0YXM6IFNjaGVtYU1ldGFkYXRhW10pOiBib29sZWFuO1xuICBhYnN0cmFjdCBzZWN1cml0eUNvbnRleHQoZWxlbWVudE5hbWU6IHN0cmluZywgcHJvcE5hbWU6IHN0cmluZywgaXNBdHRyaWJ1dGU6IGJvb2xlYW4pOlxuICAgICAgU2VjdXJpdHlDb250ZXh0O1xuICBhYnN0cmFjdCBhbGxLbm93bkVsZW1lbnROYW1lcygpOiBzdHJpbmdbXTtcbiAgYWJzdHJhY3QgZ2V0TWFwcGVkUHJvcE5hbWUocHJvcE5hbWU6IHN0cmluZyk6IHN0cmluZztcbiAgYWJzdHJhY3QgZ2V0RGVmYXVsdENvbXBvbmVudEVsZW1lbnROYW1lKCk6IHN0cmluZztcbiAgYWJzdHJhY3QgdmFsaWRhdGVQcm9wZXJ0eShuYW1lOiBzdHJpbmcpOiB7ZXJyb3I6IGJvb2xlYW4sIG1zZz86IHN0cmluZ307XG4gIGFic3RyYWN0IHZhbGlkYXRlQXR0cmlidXRlKG5hbWU6IHN0cmluZyk6IHtlcnJvcjogYm9vbGVhbiwgbXNnPzogc3RyaW5nfTtcbiAgYWJzdHJhY3Qgbm9ybWFsaXplQW5pbWF0aW9uU3R5bGVQcm9wZXJ0eShwcm9wTmFtZTogc3RyaW5nKTogc3RyaW5nO1xuICBhYnN0cmFjdCBub3JtYWxpemVBbmltYXRpb25TdHlsZVZhbHVlKFxuICAgICAgY2FtZWxDYXNlUHJvcDogc3RyaW5nLCB1c2VyUHJvdmlkZWRQcm9wOiBzdHJpbmcsXG4gICAgICB2YWw6IHN0cmluZ3xudW1iZXIpOiB7ZXJyb3I6IHN0cmluZywgdmFsdWU6IHN0cmluZ307XG59XG4iXX0=
var searchData= [ ['lax_5ffriedrichs_5f1st_5forder_104',['LAX_FRIEDRICHS_1ST_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa6e8c70e1bb7ba1a32b675aa9affdb3e',1,'LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa6e8c70e1bb7ba1a32b675aa9affdb3e',1,'LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa6e8c70e1bb7ba1a32b675aa9affdb3e',1,'LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa6e8c70e1bb7ba1a32b675aa9affdb3e',1,'LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp']]], ['lax_5ffriedrichs_5f2nd_5forder_105',['LAX_FRIEDRICHS_2ND_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9274ae9f4d9eeff513420c676c30e202',1,'LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9274ae9f4d9eeff513420c676c30e202',1,'LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9274ae9f4d9eeff513420c676c30e202',1,'LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9274ae9f4d9eeff513420c676c30e202',1,'LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp']]], ['lines_106',['lines',['../classlsMesh.html#a9c6811eb25723030619f8a155c159a8c',1,'lsMesh']]], ['local_5flax_5ffriedrichs_5f1st_5forder_107',['LOCAL_LAX_FRIEDRICHS_1ST_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9d9467fd3cd87ad296f1e808bde320e7',1,'LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9d9467fd3cd87ad296f1e808bde320e7',1,'LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9d9467fd3cd87ad296f1e808bde320e7',1,'LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba9d9467fd3cd87ad296f1e808bde320e7',1,'LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp']]], ['local_5flax_5ffriedrichs_5f2nd_5forder_108',['LOCAL_LAX_FRIEDRICHS_2ND_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa8159c2466e3dc270b8273486c9c5288',1,'LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa8159c2466e3dc270b8273486c9c5288',1,'LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa8159c2466e3dc270b8273486c9c5288',1,'LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9baa8159c2466e3dc270b8273486c9c5288',1,'LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp']]], ['local_5flax_5ffriedrichs_5fanalytical_5f1st_5forder_109',['LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9bad9e41f7feca099c1c35585950539f32e',1,'LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9bad9e41f7feca099c1c35585950539f32e',1,'LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9bad9e41f7feca099c1c35585950539f32e',1,'LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9bad9e41f7feca099c1c35585950539f32e',1,'LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER():&#160;lsAdvect.hpp']]], ['local_5flocal_5flax_5ffriedrichs_5f1st_5forder_110',['LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba6bc0794b66bd6c7f3c3d5da37a724500',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba6bc0794b66bd6c7f3c3d5da37a724500',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba6bc0794b66bd6c7f3c3d5da37a724500',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba6bc0794b66bd6c7f3c3d5da37a724500',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER():&#160;lsAdvect.hpp']]], ['local_5flocal_5flax_5ffriedrichs_5f2nd_5forder_111',['LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba04bc01449f4f7cc5d5f1a8c14fdd7594',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba04bc01449f4f7cc5d5f1a8c14fdd7594',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba04bc01449f4f7cc5d5f1a8c14fdd7594',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9ba04bc01449f4f7cc5d5f1a8c14fdd7594',1,'LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER():&#160;lsAdvect.hpp']]], ['ls_5fdomain_5fserialization_5fversion_112',['LS_DOMAIN_SERIALIZATION_VERSION',['../include_2lsDomain_8hpp.html#af575d8dc440f4bc1845b492194cd5dd2',1,'LS_DOMAIN_SERIALIZATION_VERSION():&#160;lsDomain.hpp'],['../install_2ViennaLS_2include_2lsDomain_8hpp.html#af575d8dc440f4bc1845b492194cd5dd2',1,'LS_DOMAIN_SERIALIZATION_VERSION():&#160;lsDomain.hpp']]], ['lsadvect_113',['lsAdvect',['../classlsAdvect.html',1,'lsAdvect&lt; T, D &gt;'],['../classlsAdvect.html#a04133cfc8f477fa8357e8ebda371dc1d',1,'lsAdvect::lsAdvect()'],['../classlsAdvect.html#a4a900d55114e22c8a51f485dd77e45ad',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsAdvect.html#a0b6d7e69b4f851a265a97b301b1c1349',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; VelocityField &gt; passedVelocities)'],['../classlsAdvect.html#a2368631b9ced18dd258ad92611058d6c',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; VelocityField &gt; passedVelocities)'],['../classlsAdvect.html#a8891159704eeb94426ed1f6cfc60fec8',1,'lsAdvect::lsAdvect(std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedlsDomains, lsSmartPointer&lt; VelocityField &gt; passedVelocities)'],['../classlsAdvect.html#a04133cfc8f477fa8357e8ebda371dc1d',1,'lsAdvect::lsAdvect()'],['../classlsAdvect.html#a4a900d55114e22c8a51f485dd77e45ad',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsAdvect.html#a0b6d7e69b4f851a265a97b301b1c1349',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; VelocityField &gt; passedVelocities)'],['../classlsAdvect.html#a2368631b9ced18dd258ad92611058d6c',1,'lsAdvect::lsAdvect(lsSmartPointer&lt; VelocityField &gt; passedVelocities)'],['../classlsAdvect.html#a8891159704eeb94426ed1f6cfc60fec8',1,'lsAdvect::lsAdvect(std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedlsDomains, lsSmartPointer&lt; VelocityField &gt; passedVelocities)']]], ['lsadvect_2ehpp_114',['lsAdvect.hpp',['../include_2lsAdvect_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html',1,'(Global Namespace)']]], ['lsbooleanoperation_115',['lsBooleanOperation',['../classlsBooleanOperation.html',1,'lsBooleanOperation&lt; T, D &gt;'],['../classlsBooleanOperation.html#a97ba78a60c2bb752108bafe824a8ba64',1,'lsBooleanOperation::lsBooleanOperation()'],['../classlsBooleanOperation.html#ae117d4d7fe80757b2064eecad1c435a0',1,'lsBooleanOperation::lsBooleanOperation(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsBooleanOperationEnum passedOperation=lsBooleanOperationEnum::INVERT)'],['../classlsBooleanOperation.html#a12930c99e5adc053f922fea5b574cfbf',1,'lsBooleanOperation::lsBooleanOperation(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomainA, lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomainB, lsBooleanOperationEnum passedOperation=lsBooleanOperationEnum::INTERSECT)'],['../classlsBooleanOperation.html#a97ba78a60c2bb752108bafe824a8ba64',1,'lsBooleanOperation::lsBooleanOperation()'],['../classlsBooleanOperation.html#ae117d4d7fe80757b2064eecad1c435a0',1,'lsBooleanOperation::lsBooleanOperation(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsBooleanOperationEnum passedOperation=lsBooleanOperationEnum::INVERT)'],['../classlsBooleanOperation.html#a12930c99e5adc053f922fea5b574cfbf',1,'lsBooleanOperation::lsBooleanOperation(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomainA, lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomainB, lsBooleanOperationEnum passedOperation=lsBooleanOperationEnum::INTERSECT)']]], ['lsbooleanoperation_2ehpp_116',['lsBooleanOperation.hpp',['../include_2lsBooleanOperation_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsBooleanOperation_8hpp.html',1,'(Global Namespace)']]], ['lsbooleanoperationenum_117',['lsBooleanOperationEnum',['../include_2lsBooleanOperation_8hpp.html#a8b5747a2da7e017486ffceefca67d6d8',1,'lsBooleanOperationEnum():&#160;lsBooleanOperation.hpp'],['../install_2ViennaLS_2include_2lsBooleanOperation_8hpp.html#a8b5747a2da7e017486ffceefca67d6d8',1,'lsBooleanOperationEnum():&#160;lsBooleanOperation.hpp']]], ['lsboundaryconditionenum_118',['lsBoundaryConditionEnum',['../include_2lsDomain_8hpp.html#a5f744444bbee7265e693abfcce25bf9f',1,'lsBoundaryConditionEnum():&#160;lsDomain.hpp'],['../install_2ViennaLS_2include_2lsDomain_8hpp.html#a5f744444bbee7265e693abfcce25bf9f',1,'lsBoundaryConditionEnum():&#160;lsDomain.hpp']]], ['lsbox_119',['lsBox',['../classlsBox.html',1,'lsBox&lt; T, D &gt;'],['../classlsBox.html#ae9c2f72de7a9b9368faa23bedd338fd9',1,'lsBox::lsBox()'],['../classlsBox.html#a9e48a66eb1360c3d9f3861d44c79c02d',1,'lsBox::lsBox(hrleVectorType&lt; T, D &gt; passedMinCorner, hrleVectorType&lt; T, D &gt; passedMaxCorner)'],['../classlsBox.html#a917a45d47f87ce7a01f085daa46640b4',1,'lsBox::lsBox(const T *passedMinCorner, const T *passedMaxCorner)'],['../classlsBox.html#ae99ac1d4398fe4cfdf1e801d6aec0842',1,'lsBox::lsBox(const std::vector&lt; T &gt; &amp;passedMinCorner, const std::vector&lt; T &gt; &amp;passedMaxCorner)'],['../classlsBox.html#ae9c2f72de7a9b9368faa23bedd338fd9',1,'lsBox::lsBox()'],['../classlsBox.html#a9e48a66eb1360c3d9f3861d44c79c02d',1,'lsBox::lsBox(hrleVectorType&lt; T, D &gt; passedMinCorner, hrleVectorType&lt; T, D &gt; passedMaxCorner)'],['../classlsBox.html#ae8b0e73567b9132a81b14bb2a091d647',1,'lsBox::lsBox(T *passedMinCorner, T *passedMaxCorner)'],['../classlsBox.html#ae99ac1d4398fe4cfdf1e801d6aec0842',1,'lsBox::lsBox(const std::vector&lt; T &gt; &amp;passedMinCorner, const std::vector&lt; T &gt; &amp;passedMaxCorner)']]], ['lsboxdistribution_120',['lsBoxDistribution',['../classlsBoxDistribution.html',1,'lsBoxDistribution&lt; T, D &gt;'],['../classlsBoxDistribution.html#a137264971002f2feb6bfc044e3b8e4ab',1,'lsBoxDistribution::lsBoxDistribution(const std::array&lt; T, 3 &gt; &amp;halfAxes, const T delta)'],['../classlsBoxDistribution.html#a137264971002f2feb6bfc044e3b8e4ab',1,'lsBoxDistribution::lsBoxDistribution(const std::array&lt; T, 3 &gt; &amp;halfAxes, const T delta)']]], ['lscalculatenormalvectors_121',['lsCalculateNormalVectors',['../classlsCalculateNormalVectors.html',1,'lsCalculateNormalVectors&lt; T, D &gt;'],['../classlsCalculateNormalVectors.html#a83f4d828940212da64e23c9e13849839',1,'lsCalculateNormalVectors::lsCalculateNormalVectors()'],['../classlsCalculateNormalVectors.html#a197c2d1fb2874b787299e42139cfb4e5',1,'lsCalculateNormalVectors::lsCalculateNormalVectors(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, T passedMaxValue=0.5)'],['../classlsCalculateNormalVectors.html#a83f4d828940212da64e23c9e13849839',1,'lsCalculateNormalVectors::lsCalculateNormalVectors()'],['../classlsCalculateNormalVectors.html#a197c2d1fb2874b787299e42139cfb4e5',1,'lsCalculateNormalVectors::lsCalculateNormalVectors(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, T passedMaxValue=0.5)']]], ['lscalculatenormalvectors_2ehpp_122',['lsCalculateNormalVectors.hpp',['../include_2lsCalculateNormalVectors_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsCalculateNormalVectors_8hpp.html',1,'(Global Namespace)']]], ['lscheck_123',['lsCheck',['../classlsCheck.html',1,'lsCheck&lt; T, D &gt;'],['../classlsCheck.html#ab57ee7a75936ca725172236c80a0e8ae',1,'lsCheck::lsCheck()'],['../classlsCheck.html#a98746cfa1675e213142f4b8800370cf9',1,'lsCheck::lsCheck(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, bool print=false)'],['../classlsCheck.html#ab57ee7a75936ca725172236c80a0e8ae',1,'lsCheck::lsCheck()'],['../classlsCheck.html#a98746cfa1675e213142f4b8800370cf9',1,'lsCheck::lsCheck(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, bool print=false)']]], ['lscheck_2ehpp_124',['lsCheck.hpp',['../include_2lsCheck_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsCheck_8hpp.html',1,'(Global Namespace)']]], ['lscheckstatusenum_125',['lsCheckStatusEnum',['../include_2lsCheck_8hpp.html#a567a35958ba7a1bfc2d0d84a097d8307',1,'lsCheckStatusEnum():&#160;lsCheck.hpp'],['../install_2ViennaLS_2include_2lsCheck_8hpp.html#a567a35958ba7a1bfc2d0d84a097d8307',1,'lsCheckStatusEnum():&#160;lsCheck.hpp']]], ['lsconcepts_126',['lsConcepts',['../namespacelsConcepts.html',1,'']]], ['lsconcepts_2ehpp_127',['lsConcepts.hpp',['../include_2lsConcepts_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsConcepts_8hpp.html',1,'(Global Namespace)']]], ['lsconvexhull_128',['lsConvexHull',['../classlsConvexHull.html',1,'lsConvexHull&lt; T, D &gt;'],['../classlsConvexHull.html#a08cf7b9bf7a6ecceb0f61ccdd4c632f7',1,'lsConvexHull::lsConvexHull()'],['../classlsConvexHull.html#ae0c897b77d02b2d2ffe6d579604654aa',1,'lsConvexHull::lsConvexHull(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsSmartPointer&lt; lsPointCloud&lt; T, D &gt;&gt; passedPointCloud)'],['../classlsConvexHull.html#a08cf7b9bf7a6ecceb0f61ccdd4c632f7',1,'lsConvexHull::lsConvexHull()'],['../classlsConvexHull.html#ae0c897b77d02b2d2ffe6d579604654aa',1,'lsConvexHull::lsConvexHull(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsSmartPointer&lt; lsPointCloud&lt; T, D &gt;&gt; passedPointCloud)']]], ['lsconvexhull_2ehpp_129',['lsConvexHull.hpp',['../include_2lsConvexHull_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsConvexHull_8hpp.html',1,'(Global Namespace)']]], ['lscylinder_130',['lsCylinder',['../classlsCylinder.html',1,'lsCylinder&lt; T, D &gt;'],['../classlsCylinder.html#af643ce05e56fefac5b6da22f937f3a56',1,'lsCylinder::lsCylinder()'],['../classlsCylinder.html#af9588284f25743ccba22a33df82d2baa',1,'lsCylinder::lsCylinder(hrleVectorType&lt; T, D &gt; passedOrigin, hrleVectorType&lt; T, D &gt; passedAxisDirection, T passedHeight, T passedRadius)'],['../classlsCylinder.html#a0347bd3d992cf8065424d7676a915190',1,'lsCylinder::lsCylinder(const T *passedOrigin, const T *passedAxisDirection, const T passedHeight, const T passedRadius)'],['../classlsCylinder.html#ab416149af6baadf7b60f00897869b325',1,'lsCylinder::lsCylinder(std::vector&lt; T &gt; passedOrigin, std::vector&lt; T &gt; passedAxisDirection, T passedHeight, T passedRadius)'],['../classlsCylinder.html#af643ce05e56fefac5b6da22f937f3a56',1,'lsCylinder::lsCylinder()'],['../classlsCylinder.html#af9588284f25743ccba22a33df82d2baa',1,'lsCylinder::lsCylinder(hrleVectorType&lt; T, D &gt; passedOrigin, hrleVectorType&lt; T, D &gt; passedAxisDirection, T passedHeight, T passedRadius)'],['../classlsCylinder.html#a903443b3d3bc6d3174ae1545b0f5f220',1,'lsCylinder::lsCylinder(T *passedOrigin, T *passedAxisDirection, T passedHeight, T passedRadius)'],['../classlsCylinder.html#ab416149af6baadf7b60f00897869b325',1,'lsCylinder::lsCylinder(std::vector&lt; T &gt; passedOrigin, std::vector&lt; T &gt; passedAxisDirection, T passedHeight, T passedRadius)']]], ['lsdomain_131',['lsDomain',['../classlsDomain.html',1,'lsDomain&lt; T, D &gt;'],['../classlsDomain.html#ae4d8f81852411480790eca52f704c101',1,'lsDomain::lsDomain(hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a1b93737819bb59987f11239a38d26d1c',1,'lsDomain::lsDomain(hrleCoordType *bounds, BoundaryType *boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a154f6f7b177bd272d5f7769cb94ac7e5',1,'lsDomain::lsDomain(std::vector&lt; hrleCoordType &gt; bounds, std::vector&lt; unsigned &gt; boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#aa1b62b9875d64df99915f943a802fdec',1,'lsDomain::lsDomain(PointValueVectorType pointData, hrleCoordType *bounds, BoundaryType *boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a58c7ef76498ba1a3d0979f64b32f4af6',1,'lsDomain::lsDomain(GridType passedGrid)'],['../classlsDomain.html#a4fde36ee0f4be9bf270f5ea1f6334bf0',1,'lsDomain::lsDomain(lsSmartPointer&lt; lsDomain &gt; passedDomain)'],['../classlsDomain.html#ae4d8f81852411480790eca52f704c101',1,'lsDomain::lsDomain(hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a1b93737819bb59987f11239a38d26d1c',1,'lsDomain::lsDomain(hrleCoordType *bounds, BoundaryType *boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a154f6f7b177bd272d5f7769cb94ac7e5',1,'lsDomain::lsDomain(std::vector&lt; hrleCoordType &gt; bounds, std::vector&lt; unsigned &gt; boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#aa1b62b9875d64df99915f943a802fdec',1,'lsDomain::lsDomain(PointValueVectorType pointData, hrleCoordType *bounds, BoundaryType *boundaryConditions, hrleCoordType gridDelta=1.0)'],['../classlsDomain.html#a58c7ef76498ba1a3d0979f64b32f4af6',1,'lsDomain::lsDomain(GridType passedGrid)'],['../classlsDomain.html#a4fde36ee0f4be9bf270f5ea1f6334bf0',1,'lsDomain::lsDomain(lsSmartPointer&lt; lsDomain &gt; passedDomain)']]], ['lsdomain_2ehpp_132',['lsDomain.hpp',['../include_2lsDomain_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsDomain_8hpp.html',1,'(Global Namespace)']]], ['lsenquistosher_133',['lsEnquistOsher',['../classlsInternal_1_1lsEnquistOsher.html',1,'lsInternal::lsEnquistOsher&lt; T, D, order &gt;'],['../classlsInternal_1_1lsEnquistOsher.html#af6e5a8b41885cdd3537eaf6d643cfa41',1,'lsInternal::lsEnquistOsher::lsEnquistOsher(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, bool calcNormal=true)'],['../classlsInternal_1_1lsEnquistOsher.html#af6e5a8b41885cdd3537eaf6d643cfa41',1,'lsInternal::lsEnquistOsher::lsEnquistOsher(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, bool calcNormal=true)']]], ['lsenquistosher_2ehpp_134',['lsEnquistOsher.hpp',['../include_2lsEnquistOsher_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsEnquistOsher_8hpp.html',1,'(Global Namespace)']]], ['lsexpand_135',['lsExpand',['../classlsExpand.html',1,'lsExpand&lt; T, D &gt;'],['../classlsExpand.html#aee5561b9b273fd27770803e23be36f9c',1,'lsExpand::lsExpand()'],['../classlsExpand.html#ab59166b5fc19a99b6d2dc4f21cbf83a3',1,'lsExpand::lsExpand(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsExpand.html#a72b130ab8f8ce1f3182c6f527fe9c6b8',1,'lsExpand::lsExpand(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, int passedWidth)'],['../classlsExpand.html#aee5561b9b273fd27770803e23be36f9c',1,'lsExpand::lsExpand()'],['../classlsExpand.html#ab59166b5fc19a99b6d2dc4f21cbf83a3',1,'lsExpand::lsExpand(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsExpand.html#a72b130ab8f8ce1f3182c6f527fe9c6b8',1,'lsExpand::lsExpand(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, int passedWidth)']]], ['lsexpand_2ehpp_136',['lsExpand.hpp',['../include_2lsExpand_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsExpand_8hpp.html',1,'(Global Namespace)']]], ['lsfileformatenum_137',['lsFileFormatEnum',['../include_2lsFileFormats_8hpp.html#ab14b0589117b7e039d94cc26402fa964',1,'lsFileFormatEnum():&#160;lsFileFormats.hpp'],['../install_2ViennaLS_2include_2lsFileFormats_8hpp.html#ab14b0589117b7e039d94cc26402fa964',1,'lsFileFormatEnum():&#160;lsFileFormats.hpp']]], ['lsfileformats_2ehpp_138',['lsFileFormats.hpp',['../include_2lsFileFormats_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsFileFormats_8hpp.html',1,'(Global Namespace)']]], ['lsfinitedifferences_139',['lsFiniteDifferences',['../classlsInternal_1_1lsFiniteDifferences.html',1,'lsInternal::lsFiniteDifferences&lt; T, scheme &gt;'],['../classlsInternal_1_1lsFiniteDifferences.html#a6fabd9feca85eed3d96379388139b6c9',1,'lsInternal::lsFiniteDifferences::lsFiniteDifferences()'],['../classlsInternal_1_1lsFiniteDifferences.html#a6fabd9feca85eed3d96379388139b6c9',1,'lsInternal::lsFiniteDifferences::lsFiniteDifferences()']]], ['lsfinitedifferences_2ehpp_140',['lsFiniteDifferences.hpp',['../include_2lsFiniteDifferences_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsFiniteDifferences_8hpp.html',1,'(Global Namespace)']]], ['lsfrommesh_141',['lsFromMesh',['../classlsFromMesh.html',1,'lsFromMesh&lt; T, D &gt;'],['../classlsFromMesh.html#a08ce952f855e641f5d2969db138ff7f6',1,'lsFromMesh::lsFromMesh()'],['../classlsFromMesh.html#a07cbfab501ca4f7d3258ea338e1b523c',1,'lsFromMesh::lsFromMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, const lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsFromMesh.html#a08ce952f855e641f5d2969db138ff7f6',1,'lsFromMesh::lsFromMesh()'],['../classlsFromMesh.html#a07cbfab501ca4f7d3258ea338e1b523c',1,'lsFromMesh::lsFromMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, const lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)']]], ['lsfrommesh_2ehpp_142',['lsFromMesh.hpp',['../include_2lsFromMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsFromMesh_8hpp.html',1,'(Global Namespace)']]], ['lsfromsurfacemesh_143',['lsFromSurfaceMesh',['../classlsFromSurfaceMesh.html',1,'lsFromSurfaceMesh&lt; T, D &gt;'],['../classlsFromSurfaceMesh.html#a63380e5acb9d12c82ae9df19ab83d989',1,'lsFromSurfaceMesh::lsFromSurfaceMesh()'],['../classlsFromSurfaceMesh.html#a93299fc320340fec8902012fdcd92c1d',1,'lsFromSurfaceMesh::lsFromSurfaceMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedRemoveBoundaryTriangles=true)'],['../classlsFromSurfaceMesh.html#a63380e5acb9d12c82ae9df19ab83d989',1,'lsFromSurfaceMesh::lsFromSurfaceMesh()'],['../classlsFromSurfaceMesh.html#a93299fc320340fec8902012fdcd92c1d',1,'lsFromSurfaceMesh::lsFromSurfaceMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedRemoveBoundaryTriangles=true)']]], ['lsfromsurfacemesh_2ehpp_144',['lsFromSurfaceMesh.hpp',['../include_2lsFromSurfaceMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsFromSurfaceMesh_8hpp.html',1,'(Global Namespace)']]], ['lsfromvolumemesh_145',['lsFromVolumeMesh',['../classlsFromVolumeMesh.html',1,'lsFromVolumeMesh&lt; T, D &gt;'],['../classlsFromVolumeMesh.html#a20b46d7c3a16302892bbda1403045d23',1,'lsFromVolumeMesh::lsFromVolumeMesh()'],['../classlsFromVolumeMesh.html#a9b6ddec4b769909f983b6a0fe07f66f3',1,'lsFromVolumeMesh::lsFromVolumeMesh(std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedLevelSets, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedRemoveBoundaryTriangles=true)'],['../classlsFromVolumeMesh.html#a20b46d7c3a16302892bbda1403045d23',1,'lsFromVolumeMesh::lsFromVolumeMesh()'],['../classlsFromVolumeMesh.html#a9b6ddec4b769909f983b6a0fe07f66f3',1,'lsFromVolumeMesh::lsFromVolumeMesh(std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedLevelSets, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedRemoveBoundaryTriangles=true)']]], ['lsfromvolumemesh_2ehpp_146',['lsFromVolumeMesh.hpp',['../include_2lsFromVolumeMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsFromVolumeMesh_8hpp.html',1,'(Global Namespace)']]], ['lsgeometricadvect_147',['lsGeometricAdvect',['../classlsGeometricAdvect.html',1,'lsGeometricAdvect&lt; T, D &gt;'],['../classlsGeometricAdvect.html#afa114754eb0c48733246affa17c3d5ef',1,'lsGeometricAdvect::lsGeometricAdvect()'],['../classlsGeometricAdvect.html#adaf3544a1cf577038076ac7e8cbb8cfb',1,'lsGeometricAdvect::lsGeometricAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; DistType &gt; passedDist, lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedMaskLevelSet=nullptr)'],['../classlsGeometricAdvect.html#afa114754eb0c48733246affa17c3d5ef',1,'lsGeometricAdvect::lsGeometricAdvect()'],['../classlsGeometricAdvect.html#adaf3544a1cf577038076ac7e8cbb8cfb',1,'lsGeometricAdvect::lsGeometricAdvect(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; DistType &gt; passedDist, lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedMaskLevelSet=nullptr)']]], ['lsgeometricadvect_2ehpp_148',['lsGeometricAdvect.hpp',['../include_2lsGeometricAdvect_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsGeometricAdvect_8hpp.html',1,'(Global Namespace)']]], ['lsgeometricadvectdistribution_149',['lsGeometricAdvectDistribution',['../classlsGeometricAdvectDistribution.html',1,'lsGeometricAdvectDistribution&lt; T, D &gt;'],['../classlsGeometricAdvectDistribution.html#acba0b149a25e30d4e8d8c8dd02fa063c',1,'lsGeometricAdvectDistribution::lsGeometricAdvectDistribution()'],['../classlsGeometricAdvectDistribution.html#acba0b149a25e30d4e8d8c8dd02fa063c',1,'lsGeometricAdvectDistribution::lsGeometricAdvectDistribution()']]], ['lsgeometricadvectdistributions_2ehpp_150',['lsGeometricAdvectDistributions.hpp',['../include_2lsGeometricAdvectDistributions_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsGeometricAdvectDistributions_8hpp.html',1,'(Global Namespace)']]], ['lsgeometries_2ehpp_151',['lsGeometries.hpp',['../include_2lsGeometries_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsGeometries_8hpp.html',1,'(Global Namespace)']]], ['lsgraph_152',['lsGraph',['../classlsInternal_1_1lsGraph.html',1,'lsInternal']]], ['lsgraph_2ehpp_153',['lsGraph.hpp',['../include_2lsGraph_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsGraph_8hpp.html',1,'(Global Namespace)']]], ['lsintegrationschemeenum_154',['lsIntegrationSchemeEnum',['../include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9b',1,'lsIntegrationSchemeEnum():&#160;lsAdvect.hpp'],['../install_2ViennaLS_2include_2lsAdvect_8hpp.html#afe9778bbf7b5f9aeb52d14c4f133cc9b',1,'lsIntegrationSchemeEnum():&#160;lsAdvect.hpp']]], ['lsinternal_155',['lsInternal',['../namespacelsInternal.html',1,'']]], ['lslaxfriedrichs_156',['lsLaxFriedrichs',['../classlsInternal_1_1lsLaxFriedrichs.html',1,'lsInternal::lsLaxFriedrichs&lt; T, D, order &gt;'],['../classlsInternal_1_1lsLaxFriedrichs.html#adba207405a3994cd2e6b3756d8ad1b51',1,'lsInternal::lsLaxFriedrichs::lsLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, bool calcNormal=true, double a=1.0)'],['../classlsInternal_1_1lsLaxFriedrichs.html#adba207405a3994cd2e6b3756d8ad1b51',1,'lsInternal::lsLaxFriedrichs::lsLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, bool calcNormal=true, double a=1.0)']]], ['lslaxfriedrichs_2ehpp_157',['lsLaxFriedrichs.hpp',['../include_2lsLaxFriedrichs_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsLaxFriedrichs_8hpp.html',1,'(Global Namespace)']]], ['lslocallaxfriedrichs_158',['lsLocalLaxFriedrichs',['../classlsInternal_1_1lsLocalLaxFriedrichs.html',1,'lsInternal::lsLocalLaxFriedrichs&lt; T, D, order &gt;'],['../classlsInternal_1_1lsLocalLaxFriedrichs.html#a826781c4b196c14f6e0ceec40e5ed57b',1,'lsInternal::lsLocalLaxFriedrichs::lsLocalLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0)'],['../classlsInternal_1_1lsLocalLaxFriedrichs.html#a826781c4b196c14f6e0ceec40e5ed57b',1,'lsInternal::lsLocalLaxFriedrichs::lsLocalLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0)']]], ['lslocallaxfriedrichs_2ehpp_159',['lsLocalLaxFriedrichs.hpp',['../include_2lsLocalLaxFriedrichs_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsLocalLaxFriedrichs_8hpp.html',1,'(Global Namespace)']]], ['lslocallaxfriedrichsanalytical_160',['lsLocalLaxFriedrichsAnalytical',['../classlsInternal_1_1lsLocalLaxFriedrichsAnalytical.html',1,'lsInternal::lsLocalLaxFriedrichsAnalytical&lt; T, D, order &gt;'],['../classlsInternal_1_1lsLocalLaxFriedrichsAnalytical.html#a41ff5b6c3eddeb12aaceecf4ad06a0c9',1,'lsInternal::lsLocalLaxFriedrichsAnalytical::lsLocalLaxFriedrichsAnalytical(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel)'],['../classlsInternal_1_1lsLocalLaxFriedrichsAnalytical.html#a41ff5b6c3eddeb12aaceecf4ad06a0c9',1,'lsInternal::lsLocalLaxFriedrichsAnalytical::lsLocalLaxFriedrichsAnalytical(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel)']]], ['lslocallaxfriedrichsanalytical_2ehpp_161',['lsLocalLaxFriedrichsAnalytical.hpp',['../include_2lsLocalLaxFriedrichsAnalytical_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsLocalLaxFriedrichsAnalytical_8hpp.html',1,'(Global Namespace)']]], ['lslocallocallaxfriedrichs_162',['lsLocalLocalLaxFriedrichs',['../classlsInternal_1_1lsLocalLocalLaxFriedrichs.html',1,'lsInternal::lsLocalLocalLaxFriedrichs&lt; T, D, order &gt;'],['../classlsInternal_1_1lsLocalLocalLaxFriedrichs.html#a55e1866c1ad6351596206aa1bb92b7db',1,'lsInternal::lsLocalLocalLaxFriedrichs::lsLocalLocalLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0)'],['../classlsInternal_1_1lsLocalLocalLaxFriedrichs.html#a55e1866c1ad6351596206aa1bb92b7db',1,'lsInternal::lsLocalLocalLaxFriedrichs::lsLocalLocalLaxFriedrichs(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0)']]], ['lslocallocallaxfriedrichs_2ehpp_163',['lsLocalLocalLaxFriedrichs.hpp',['../include_2lsLocalLocalLaxFriedrichs_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsLocalLocalLaxFriedrichs_8hpp.html',1,'(Global Namespace)']]], ['lsmakegeometry_164',['lsMakeGeometry',['../classlsMakeGeometry.html',1,'lsMakeGeometry&lt; T, D &gt;'],['../classlsMakeGeometry.html#ada31a7c9a98ed26b204749f86b2df79a',1,'lsMakeGeometry::lsMakeGeometry()'],['../classlsMakeGeometry.html#a0343d02df2aa8d45996e7f5d40d59b31',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsMakeGeometry.html#ac8a7057789a92cc496a8d6d8c1f4928f',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsSphere&lt; T, D &gt;&gt; passedSphere)'],['../classlsMakeGeometry.html#aa0622f986484b9be7bffb8b472a48a1d',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsPlane&lt; T, D &gt;&gt; passedPlane)'],['../classlsMakeGeometry.html#ad2b2c2016a25e7262a97e6976666e830',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsBox&lt; T, D &gt;&gt; passedBox)'],['../classlsMakeGeometry.html#a741e449740d30bf4813553f55413f989',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsCylinder&lt; T, D &gt;&gt; passedCylinder)'],['../classlsMakeGeometry.html#aa1c8c04abc0b70e706b3aec32147f929',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsPointCloud&lt; T, D &gt;&gt; passedPointCloud)'],['../classlsMakeGeometry.html#ada31a7c9a98ed26b204749f86b2df79a',1,'lsMakeGeometry::lsMakeGeometry()'],['../classlsMakeGeometry.html#a0343d02df2aa8d45996e7f5d40d59b31',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsMakeGeometry.html#ac8a7057789a92cc496a8d6d8c1f4928f',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsSphere&lt; T, D &gt;&gt; passedSphere)'],['../classlsMakeGeometry.html#aa0622f986484b9be7bffb8b472a48a1d',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsPlane&lt; T, D &gt;&gt; passedPlane)'],['../classlsMakeGeometry.html#ad2b2c2016a25e7262a97e6976666e830',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsBox&lt; T, D &gt;&gt; passedBox)'],['../classlsMakeGeometry.html#a741e449740d30bf4813553f55413f989',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsCylinder&lt; T, D &gt;&gt; passedCylinder)'],['../classlsMakeGeometry.html#aa1c8c04abc0b70e706b3aec32147f929',1,'lsMakeGeometry::lsMakeGeometry(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsPointCloud&lt; T, D &gt;&gt; passedPointCloud)']]], ['lsmakegeometry_2ehpp_165',['lsMakeGeometry.hpp',['../include_2lsMakeGeometry_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsMakeGeometry_8hpp.html',1,'(Global Namespace)']]], ['lsmarchingcubes_166',['lsMarchingCubes',['../classlsInternal_1_1lsMarchingCubes.html',1,'lsInternal']]], ['lsmarchingcubes_2ehpp_167',['lsMarchingCubes.hpp',['../include_2lsMarchingCubes_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsMarchingCubes_8hpp.html',1,'(Global Namespace)']]], ['lsmarkvoidpoints_168',['lsMarkVoidPoints',['../classlsMarkVoidPoints.html',1,'lsMarkVoidPoints&lt; T, D &gt;'],['../classlsMarkVoidPoints.html#a112ce489073235e836dcfe0ee732b4e5',1,'lsMarkVoidPoints::lsMarkVoidPoints(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, bool passedReverseVoidDetection=false)'],['../classlsMarkVoidPoints.html#a112ce489073235e836dcfe0ee732b4e5',1,'lsMarkVoidPoints::lsMarkVoidPoints(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, bool passedReverseVoidDetection=false)']]], ['lsmarkvoidpoints_2ehpp_169',['lsMarkVoidPoints.hpp',['../include_2lsMarkVoidPoints_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsMarkVoidPoints_8hpp.html',1,'(Global Namespace)']]], ['lsmesh_170',['lsMesh',['../classlsMesh.html',1,'']]], ['lsmesh_2ehpp_171',['lsMesh.hpp',['../include_2lsMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsMesh_8hpp.html',1,'(Global Namespace)']]], ['lsmessage_172',['lsMessage',['../classlsMessage.html',1,'lsMessage'],['../classlsMessage.html#a2603de3902261fab485de97fc69be1ea',1,'lsMessage::lsMessage(const lsMessage &amp;)=delete'],['../classlsMessage.html#a2603de3902261fab485de97fc69be1ea',1,'lsMessage::lsMessage(const lsMessage &amp;)=delete']]], ['lsmessage_2ehpp_173',['lsMessage.hpp',['../include_2lsMessage_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsMessage_8hpp.html',1,'(Global Namespace)']]], ['lsplane_174',['lsPlane',['../classlsPlane.html',1,'lsPlane&lt; T, D &gt;'],['../classlsPlane.html#aa59fb2b3c42723ddf881e118d9bf3f84',1,'lsPlane::lsPlane()'],['../classlsPlane.html#a40463fe01a70ee60c501968240803157',1,'lsPlane::lsPlane(hrleVectorType&lt; T, D &gt; passedOrigin, hrleVectorType&lt; T, D &gt; passedNormal)'],['../classlsPlane.html#a49bd6ff0e9f90f508f11ac9f852ca705',1,'lsPlane::lsPlane(const T *passedOrigin, const T *passedNormal)'],['../classlsPlane.html#a21a4a8b21410f6d916c082e552ceb971',1,'lsPlane::lsPlane(const std::vector&lt; T &gt; &amp;passedOrigin, const std::vector&lt; T &gt; &amp;passedNormal)'],['../classlsPlane.html#aa59fb2b3c42723ddf881e118d9bf3f84',1,'lsPlane::lsPlane()'],['../classlsPlane.html#a40463fe01a70ee60c501968240803157',1,'lsPlane::lsPlane(hrleVectorType&lt; T, D &gt; passedOrigin, hrleVectorType&lt; T, D &gt; passedNormal)'],['../classlsPlane.html#a44df1db53386c94f82cc9ff588c5661f',1,'lsPlane::lsPlane(T *passedOrigin, T *passedNormal)'],['../classlsPlane.html#a21a4a8b21410f6d916c082e552ceb971',1,'lsPlane::lsPlane(const std::vector&lt; T &gt; &amp;passedOrigin, const std::vector&lt; T &gt; &amp;passedNormal)']]], ['lspointcloud_175',['lsPointCloud',['../classlsPointCloud.html',1,'lsPointCloud&lt; T, D &gt;'],['../classlsPointCloud.html#a76f5f725653b5fe6f21a671c61ecda09',1,'lsPointCloud::lsPointCloud()'],['../classlsPointCloud.html#a3220c7e4e58c4990b7d8512b36ae8e4e',1,'lsPointCloud::lsPointCloud(std::vector&lt; hrleVectorType&lt; T, D &gt;&gt; passedPoints)'],['../classlsPointCloud.html#a28cf2f47ab13b6786f42e0b538b64d14',1,'lsPointCloud::lsPointCloud(const std::vector&lt; std::vector&lt; T &gt;&gt; &amp;passedPoints)'],['../classlsPointCloud.html#a76f5f725653b5fe6f21a671c61ecda09',1,'lsPointCloud::lsPointCloud()'],['../classlsPointCloud.html#a3220c7e4e58c4990b7d8512b36ae8e4e',1,'lsPointCloud::lsPointCloud(std::vector&lt; hrleVectorType&lt; T, D &gt;&gt; passedPoints)'],['../classlsPointCloud.html#a28cf2f47ab13b6786f42e0b538b64d14',1,'lsPointCloud::lsPointCloud(const std::vector&lt; std::vector&lt; T &gt;&gt; &amp;passedPoints)']]], ['lspointdata_176',['lsPointData',['../classlsPointData.html',1,'']]], ['lspointdata_2ehpp_177',['lsPointData.hpp',['../include_2lsPointData_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsPointData_8hpp.html',1,'(Global Namespace)']]], ['lspointdata_3c_20double_20_3e_178',['lsPointData&lt; double &gt;',['../classlsPointData.html',1,'']]], ['lspointdata_3c_20t_20_3e_179',['lsPointData&lt; T &gt;',['../classlsPointData.html',1,'']]], ['lsprecompilemacros_2ehpp_180',['lsPreCompileMacros.hpp',['../include_2lsPreCompileMacros_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsPreCompileMacros_8hpp.html',1,'(Global Namespace)']]], ['lsprune_181',['lsPrune',['../classlsPrune.html',1,'lsPrune&lt; T, D &gt;'],['../classlsPrune.html#a31cc4e017b099f2af82922469fcf9bed',1,'lsPrune::lsPrune()'],['../classlsPrune.html#a0fbca4fedce86a2f1891833784e6fd76',1,'lsPrune::lsPrune(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsPrune.html#a31cc4e017b099f2af82922469fcf9bed',1,'lsPrune::lsPrune()'],['../classlsPrune.html#a0fbca4fedce86a2f1891833784e6fd76',1,'lsPrune::lsPrune(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)']]], ['lsprune_2ehpp_182',['lsPrune.hpp',['../include_2lsPrune_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsPrune_8hpp.html',1,'(Global Namespace)']]], ['lsreader_183',['lsReader',['../classlsReader.html',1,'lsReader&lt; T, D &gt;'],['../classlsReader.html#ac0928e71e719a3b7fa1677142ebead93',1,'lsReader::lsReader()'],['../classlsReader.html#aba10f20cc61dc875c95286df1a579289',1,'lsReader::lsReader(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsReader.html#ae771ca328d307224283d76ad9cc25ce2',1,'lsReader::lsReader(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, std::string passedFileName)'],['../classlsReader.html#ac0928e71e719a3b7fa1677142ebead93',1,'lsReader::lsReader()'],['../classlsReader.html#aba10f20cc61dc875c95286df1a579289',1,'lsReader::lsReader(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsReader.html#ae771ca328d307224283d76ad9cc25ce2',1,'lsReader::lsReader(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, std::string passedFileName)']]], ['lsreader_2ehpp_184',['lsReader.hpp',['../include_2lsReader_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsReader_8hpp.html',1,'(Global Namespace)']]], ['lsreduce_185',['lsReduce',['../classlsReduce.html',1,'lsReduce&lt; T, D &gt;'],['../classlsReduce.html#a0f69e06b5514aca84eaed1c8453d6fce',1,'lsReduce::lsReduce()'],['../classlsReduce.html#a1bec242770bfac78b9366663f2bb9b73',1,'lsReduce::lsReduce(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsReduce.html#a77f29a6f406a1b7f685d803718defece',1,'lsReduce::lsReduce(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, int passedWidth, bool passedNoNewSegment=false)'],['../classlsReduce.html#a0f69e06b5514aca84eaed1c8453d6fce',1,'lsReduce::lsReduce()'],['../classlsReduce.html#a1bec242770bfac78b9366663f2bb9b73',1,'lsReduce::lsReduce(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain)'],['../classlsReduce.html#a77f29a6f406a1b7f685d803718defece',1,'lsReduce::lsReduce(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, int passedWidth, bool passedNoNewSegment=false)']]], ['lsreduce_2ehpp_186',['lsReduce.hpp',['../include_2lsReduce_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsReduce_8hpp.html',1,'(Global Namespace)']]], ['lssmartpointer_187',['lsSmartPointer',['../classlsSmartPointer.html',1,'lsSmartPointer&lt; T &gt;'],['../classlsSmartPointer.html#af10e097abae27769f7dcd5cadfe7eaaa',1,'lsSmartPointer::lsSmartPointer(Args &amp;&amp;...args)'],['../classlsSmartPointer.html#af10e097abae27769f7dcd5cadfe7eaaa',1,'lsSmartPointer::lsSmartPointer(Args &amp;&amp;...args)']]], ['lssmartpointer_2ehpp_188',['lsSmartPointer.hpp',['../include_2lsSmartPointer_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsSmartPointer_8hpp.html',1,'(Global Namespace)']]], ['lssmartpointer_3c_20const_20lsgeometricadvectdistribution_3c_20hrlecoordtype_2c_20d_20_3e_20_3e_189',['lsSmartPointer&lt; const lsGeometricAdvectDistribution&lt; hrleCoordType, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsbox_3c_20t_2c_20d_20_3e_20_3e_190',['lsSmartPointer&lt; lsBox&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lscylinder_3c_20t_2c_20d_20_3e_20_3e_191',['lsSmartPointer&lt; lsCylinder&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsdomain_3c_20t_2c_20d_20_3e_20_3e_192',['lsSmartPointer&lt; lsDomain&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsmesh_3c_20double_20_3e_20_3e_193',['lsSmartPointer&lt; lsMesh&lt; double &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsmesh_3c_20t_20_3e_20_3e_194',['lsSmartPointer&lt; lsMesh&lt; T &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsplane_3c_20t_2c_20d_20_3e_20_3e_195',['lsSmartPointer&lt; lsPlane&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lspointcloud_3c_20t_2c_20d_20_3e_20_3e_196',['lsSmartPointer&lt; lsPointCloud&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lssphere_3c_20t_2c_20d_20_3e_20_3e_197',['lsSmartPointer&lt; lsSphere&lt; T, D &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20lsvelocityfield_3c_20t_20_3e_20_3e_198',['lsSmartPointer&lt; lsVelocityField&lt; T &gt; &gt;',['../classlsSmartPointer.html',1,'']]], ['lssmartpointer_3c_20translatortype_20_3e_199',['lsSmartPointer&lt; translatorType &gt;',['../classlsSmartPointer.html',1,'']]], ['lssphere_200',['lsSphere',['../classlsSphere.html',1,'lsSphere&lt; T, D &gt;'],['../classlsSphere.html#a45578bd9ec9a252f166139d11cda46fd',1,'lsSphere::lsSphere()'],['../classlsSphere.html#a4ab43c9b4fa568e7b6d631a8a896e79e',1,'lsSphere::lsSphere(hrleVectorType&lt; T, D &gt; passedOrigin, T passedRadius)'],['../classlsSphere.html#afc65b4af1d306091efde3430f7265b6d',1,'lsSphere::lsSphere(T *passedOrigin, T passedRadius)'],['../classlsSphere.html#aa131fdb973f837cf5a37ce6e24c20393',1,'lsSphere::lsSphere(const std::vector&lt; T &gt; &amp;passedOrigin, T passedRadius)'],['../classlsSphere.html#a45578bd9ec9a252f166139d11cda46fd',1,'lsSphere::lsSphere()'],['../classlsSphere.html#a4ab43c9b4fa568e7b6d631a8a896e79e',1,'lsSphere::lsSphere(hrleVectorType&lt; T, D &gt; passedOrigin, T passedRadius)'],['../classlsSphere.html#afc65b4af1d306091efde3430f7265b6d',1,'lsSphere::lsSphere(T *passedOrigin, T passedRadius)'],['../classlsSphere.html#aa131fdb973f837cf5a37ce6e24c20393',1,'lsSphere::lsSphere(const std::vector&lt; T &gt; &amp;passedOrigin, T passedRadius)']]], ['lsspheredistribution_201',['lsSphereDistribution',['../classlsSphereDistribution.html',1,'lsSphereDistribution&lt; T, D &gt;'],['../classlsSphereDistribution.html#a0071db703db6ef1992c7e4493966ed14',1,'lsSphereDistribution::lsSphereDistribution(const T passedRadius, const T delta)'],['../classlsSphereDistribution.html#a0071db703db6ef1992c7e4493966ed14',1,'lsSphereDistribution::lsSphereDistribution(const T passedRadius, const T delta)']]], ['lsstencillocallaxfriedrichsscalar_202',['lsStencilLocalLaxFriedrichsScalar',['../classlsInternal_1_1lsStencilLocalLaxFriedrichsScalar.html',1,'lsInternal::lsStencilLocalLaxFriedrichsScalar&lt; T, D, order &gt;'],['../classlsInternal_1_1lsStencilLocalLaxFriedrichsScalar.html#aa2ee31a39640d12494db52dea0443c51',1,'lsInternal::lsStencilLocalLaxFriedrichsScalar::lsStencilLocalLaxFriedrichsScalar(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0, DifferentiationSchemeEnum scheme=DifferentiationSchemeEnum::FIRST_ORDER)'],['../classlsInternal_1_1lsStencilLocalLaxFriedrichsScalar.html#aa2ee31a39640d12494db52dea0443c51',1,'lsInternal::lsStencilLocalLaxFriedrichsScalar::lsStencilLocalLaxFriedrichsScalar(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedlsDomain, lsSmartPointer&lt; lsVelocityField&lt; T &gt;&gt; vel, double a=1.0, DifferentiationSchemeEnum scheme=DifferentiationSchemeEnum::FIRST_ORDER)']]], ['lsstencillocallaxfriedrichsscalar_2ehpp_203',['lsStencilLocalLaxFriedrichsScalar.hpp',['../include_2lsStencilLocalLaxFriedrichsScalar_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsStencilLocalLaxFriedrichsScalar_8hpp.html',1,'(Global Namespace)']]], ['lstest_5fassert_204',['LSTEST_ASSERT',['../include_2lsTestAsserts_8hpp.html#a622e9d7e09c25ba495e010a18b719625',1,'LSTEST_ASSERT():&#160;lsTestAsserts.hpp'],['../install_2ViennaLS_2include_2lsTestAsserts_8hpp.html#a622e9d7e09c25ba495e010a18b719625',1,'LSTEST_ASSERT():&#160;lsTestAsserts.hpp']]], ['lstest_5fassert_5fvalid_5fls_205',['LSTEST_ASSERT_VALID_LS',['../include_2lsTestAsserts_8hpp.html#a577864eccdd1313491124dfc80dc59ce',1,'LSTEST_ASSERT_VALID_LS():&#160;lsTestAsserts.hpp'],['../install_2ViennaLS_2include_2lsTestAsserts_8hpp.html#a577864eccdd1313491124dfc80dc59ce',1,'LSTEST_ASSERT_VALID_LS():&#160;lsTestAsserts.hpp']]], ['lstestasserts_2ehpp_206',['lsTestAsserts.hpp',['../include_2lsTestAsserts_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsTestAsserts_8hpp.html',1,'(Global Namespace)']]], ['lstodiskmesh_207',['lsToDiskMesh',['../classlsToDiskMesh.html',1,'lsToDiskMesh&lt; T, D, N &gt;'],['../classlsToDiskMesh.html#a2f469036f883f514490cd9547d4e80b9',1,'lsToDiskMesh::lsToDiskMesh()'],['../classlsToDiskMesh.html#ae4fc0768c954e06343b34eef940e9d74',1,'lsToDiskMesh::lsToDiskMesh(lsSmartPointer&lt; lsMesh&lt; N &gt;&gt; passedMesh, T passedMaxValue=0.5)'],['../classlsToDiskMesh.html#a53a2addb91d8b07b4e36f54efca7dcb0',1,'lsToDiskMesh::lsToDiskMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; N &gt;&gt; passedMesh, T passedMaxValue=0.5)'],['../classlsToDiskMesh.html#a59908655200ea9582a1f44e781e31726',1,'lsToDiskMesh::lsToDiskMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; N &gt;&gt; passedMesh, lsSmartPointer&lt; translatorType &gt; passedTranslator, T passedMaxValue=0.5)'],['../classlsToDiskMesh.html#a2f469036f883f514490cd9547d4e80b9',1,'lsToDiskMesh::lsToDiskMesh()'],['../classlsToDiskMesh.html#a53a2addb91d8b07b4e36f54efca7dcb0',1,'lsToDiskMesh::lsToDiskMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; N &gt;&gt; passedMesh, T passedMaxValue=0.5)'],['../classlsToDiskMesh.html#a59908655200ea9582a1f44e781e31726',1,'lsToDiskMesh::lsToDiskMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; N &gt;&gt; passedMesh, lsSmartPointer&lt; translatorType &gt; passedTranslator, T passedMaxValue=0.5)']]], ['lstodiskmesh_2ehpp_208',['lsToDiskMesh.hpp',['../include_2lsToDiskMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsToDiskMesh_8hpp.html',1,'(Global Namespace)']]], ['lstomesh_209',['lsToMesh',['../classlsToMesh.html',1,'lsToMesh&lt; T, D &gt;'],['../classlsToMesh.html#a13ff52503ffe9a602d41c8ce4925653f',1,'lsToMesh::lsToMesh()'],['../classlsToMesh.html#a344e795ea77b9d65e93881c3ec3f747f',1,'lsToMesh::lsToMesh(const lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedOnlyDefined=true, bool passedOnlyActive=false)'],['../classlsToMesh.html#a13ff52503ffe9a602d41c8ce4925653f',1,'lsToMesh::lsToMesh()'],['../classlsToMesh.html#a344e795ea77b9d65e93881c3ec3f747f',1,'lsToMesh::lsToMesh(const lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, bool passedOnlyDefined=true, bool passedOnlyActive=false)']]], ['lstomesh_2ehpp_210',['lsToMesh.hpp',['../include_2lsToMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsToMesh_8hpp.html',1,'(Global Namespace)']]], ['lstosurfacemesh_211',['lsToSurfaceMesh',['../classlsToSurfaceMesh.html',1,'lsToSurfaceMesh&lt; T, D &gt;'],['../classlsToSurfaceMesh.html#aac753633d2f8da94ecabf86ea2e2e346',1,'lsToSurfaceMesh::lsToSurfaceMesh(double eps=1e-12)'],['../classlsToSurfaceMesh.html#a238f9cbd186aff800120a8a93da0a8a9',1,'lsToSurfaceMesh::lsToSurfaceMesh(const lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, double eps=1e-12)'],['../classlsToSurfaceMesh.html#aac753633d2f8da94ecabf86ea2e2e346',1,'lsToSurfaceMesh::lsToSurfaceMesh(double eps=1e-12)'],['../classlsToSurfaceMesh.html#a238f9cbd186aff800120a8a93da0a8a9',1,'lsToSurfaceMesh::lsToSurfaceMesh(const lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, double eps=1e-12)']]], ['lstosurfacemesh_2ehpp_212',['lsToSurfaceMesh.hpp',['../include_2lsToSurfaceMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsToSurfaceMesh_8hpp.html',1,'(Global Namespace)']]], ['lstovoxelmesh_213',['lsToVoxelMesh',['../classlsToVoxelMesh.html',1,'lsToVoxelMesh&lt; T, D &gt;'],['../classlsToVoxelMesh.html#ae0aa7bef004cad8cc6d15a3c5fd2aacb',1,'lsToVoxelMesh::lsToVoxelMesh()'],['../classlsToVoxelMesh.html#aa7d0afbaa8af0e99200cfcc6ac9d57b6',1,'lsToVoxelMesh::lsToVoxelMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsToVoxelMesh.html#a617d9cbc4f75d1559f4e819687816a96',1,'lsToVoxelMesh::lsToVoxelMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsToVoxelMesh.html#ac736e65f1526c8ba4bb0a66b9c759f6d',1,'lsToVoxelMesh::lsToVoxelMesh(const std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedLevelSets, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsToVoxelMesh.html#ae0aa7bef004cad8cc6d15a3c5fd2aacb',1,'lsToVoxelMesh::lsToVoxelMesh()'],['../classlsToVoxelMesh.html#aa7d0afbaa8af0e99200cfcc6ac9d57b6',1,'lsToVoxelMesh::lsToVoxelMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsToVoxelMesh.html#a617d9cbc4f75d1559f4e819687816a96',1,'lsToVoxelMesh::lsToVoxelMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsToVoxelMesh.html#ac736e65f1526c8ba4bb0a66b9c759f6d',1,'lsToVoxelMesh::lsToVoxelMesh(const std::vector&lt; lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt;&gt; passedLevelSets, lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)']]], ['lstovoxelmesh_2ehpp_214',['lsToVoxelMesh.hpp',['../include_2lsToVoxelMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsToVoxelMesh_8hpp.html',1,'(Global Namespace)']]], ['lstransformenum_215',['lsTransformEnum',['../include_2lsTransformMesh_8hpp.html#a0cb195277df055af93385ff610b0ba98',1,'lsTransformEnum():&#160;lsTransformMesh.hpp'],['../install_2ViennaLS_2include_2lsTransformMesh_8hpp.html#a0cb195277df055af93385ff610b0ba98',1,'lsTransformEnum():&#160;lsTransformMesh.hpp']]], ['lstransformmesh_216',['lsTransformMesh',['../classlsTransformMesh.html',1,'lsTransformMesh&lt; T &gt;'],['../classlsTransformMesh.html#ac1cb03cb28e05f67faf874d53606cfab',1,'lsTransformMesh::lsTransformMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsTransformEnum passedTransform=lsTransformEnum::TRANSLATION, std::array&lt; double, 3 &gt; passedTransformVector={}, double passedAngle=0.0)'],['../classlsTransformMesh.html#a06d3b6b7390b9d6fd6ce50fcdb137c9a',1,'lsTransformMesh::lsTransformMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsTransformEnum passedTransform=lsTransformEnum::TRANSLATION, hrleVectorType&lt; double, 3 &gt; passedTransformVector={}, double passedAngle=0.0)'],['../classlsTransformMesh.html#ac1cb03cb28e05f67faf874d53606cfab',1,'lsTransformMesh::lsTransformMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsTransformEnum passedTransform=lsTransformEnum::TRANSLATION, std::array&lt; double, 3 &gt; passedTransformVector={}, double passedAngle=0.0)'],['../classlsTransformMesh.html#a06d3b6b7390b9d6fd6ce50fcdb137c9a',1,'lsTransformMesh::lsTransformMesh(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsTransformEnum passedTransform=lsTransformEnum::TRANSLATION, hrleVectorType&lt; double, 3 &gt; passedTransformVector={}, double passedAngle=0.0)']]], ['lstransformmesh_2ehpp_217',['lsTransformMesh.hpp',['../include_2lsTransformMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsTransformMesh_8hpp.html',1,'(Global Namespace)']]], ['lsvelocityfield_218',['lsVelocityField',['../classlsVelocityField.html',1,'lsVelocityField&lt; T &gt;'],['../classlsVelocityField.html#a0e78edc56bdb3f2ed2d27827a4388ff3',1,'lsVelocityField::lsVelocityField()'],['../classlsVelocityField.html#a0e78edc56bdb3f2ed2d27827a4388ff3',1,'lsVelocityField::lsVelocityField()']]], ['lsvelocityfield_2ehpp_219',['lsVelocityField.hpp',['../include_2lsVelocityField_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsVelocityField_8hpp.html',1,'(Global Namespace)']]], ['lsvelocityfield_3c_20double_20_3e_220',['lsVelocityField&lt; double &gt;',['../classlsVelocityField.html',1,'']]], ['lsvelocityfield_3c_20numerictype_20_3e_221',['lsVelocityField&lt; NumericType &gt;',['../classlsVelocityField.html',1,'']]], ['lsvtkreader_222',['lsVTKReader',['../classlsVTKReader.html',1,'lsVTKReader&lt; T &gt;'],['../classlsVTKReader.html#a6072c9029878869db0a02295566087e8',1,'lsVTKReader::lsVTKReader()'],['../classlsVTKReader.html#a718fdec236821b30c7d56145517a96d6',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsVTKReader.html#a9b8e12e10e939805bae35d423340506f',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, std::string passedFileName)'],['../classlsVTKReader.html#a887843f84cd96ad3032b2b95365ede7d',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt;&gt;&gt; passedMesh, lsFileFormatEnum passedFormat, std::string passedFileName)'],['../classlsVTKReader.html#a6072c9029878869db0a02295566087e8',1,'lsVTKReader::lsVTKReader()'],['../classlsVTKReader.html#a718fdec236821b30c7d56145517a96d6',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsVTKReader.html#a9b8e12e10e939805bae35d423340506f',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, std::string passedFileName)'],['../classlsVTKReader.html#a887843f84cd96ad3032b2b95365ede7d',1,'lsVTKReader::lsVTKReader(lsSmartPointer&lt; lsMesh&lt;&gt;&gt; passedMesh, lsFileFormatEnum passedFormat, std::string passedFileName)']]], ['lsvtkreader_2ehpp_223',['lsVTKReader.hpp',['../include_2lsVTKReader_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsVTKReader_8hpp.html',1,'(Global Namespace)']]], ['lsvtkwriter_224',['lsVTKWriter',['../classlsVTKWriter.html',1,'lsVTKWriter&lt; T &gt;'],['../classlsVTKWriter.html#a1652db574c0c65c401194a2b1f92ff25',1,'lsVTKWriter::lsVTKWriter()'],['../classlsVTKWriter.html#ab215aa6dd07d07cb8492c8e62372a757',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsVTKWriter.html#ac0f5b21fdaaca04b3b06ce782aa221c3',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, std::string passedFileName)'],['../classlsVTKWriter.html#a51c27932cdc8e4cb4ecf85b0e14fdc97',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsFileFormatEnum passedFormat, std::string passedFileName)'],['../classlsVTKWriter.html#a1652db574c0c65c401194a2b1f92ff25',1,'lsVTKWriter::lsVTKWriter()'],['../classlsVTKWriter.html#ab215aa6dd07d07cb8492c8e62372a757',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh)'],['../classlsVTKWriter.html#ac0f5b21fdaaca04b3b06ce782aa221c3',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, std::string passedFileName)'],['../classlsVTKWriter.html#a51c27932cdc8e4cb4ecf85b0e14fdc97',1,'lsVTKWriter::lsVTKWriter(lsSmartPointer&lt; lsMesh&lt; T &gt;&gt; passedMesh, lsFileFormatEnum passedFormat, std::string passedFileName)']]], ['lsvtkwriter_2ehpp_225',['lsVTKWriter.hpp',['../include_2lsVTKWriter_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsVTKWriter_8hpp.html',1,'(Global Namespace)']]], ['lswriter_226',['lsWriter',['../classlsWriter.html',1,'lsWriter&lt; T, D &gt;'],['../classlsWriter.html#a5de4871b57de4fa7b297d6b3fcaa6bc2',1,'lsWriter::lsWriter()'],['../classlsWriter.html#a7d6e4d34fd9b9a0cb482df746d49e1e3',1,'lsWriter::lsWriter(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsWriter.html#a46aaa41e4e38c0316e10d19a99358325',1,'lsWriter::lsWriter(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, std::string passedFileName)'],['../classlsWriter.html#a5de4871b57de4fa7b297d6b3fcaa6bc2',1,'lsWriter::lsWriter()'],['../classlsWriter.html#a7d6e4d34fd9b9a0cb482df746d49e1e3',1,'lsWriter::lsWriter(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet)'],['../classlsWriter.html#a46aaa41e4e38c0316e10d19a99358325',1,'lsWriter::lsWriter(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; passedLevelSet, std::string passedFileName)']]], ['lswriter_2ehpp_227',['lsWriter.hpp',['../include_2lsWriter_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsWriter_8hpp.html',1,'(Global Namespace)']]], ['lswritevisualizationmesh_228',['lsWriteVisualizationMesh',['../classlsWriteVisualizationMesh.html',1,'lsWriteVisualizationMesh&lt; T, D &gt;'],['../classlsWriteVisualizationMesh.html#ae94323fb9a6461cc62d1d6f566eb1a05',1,'lsWriteVisualizationMesh::lsWriteVisualizationMesh()'],['../classlsWriteVisualizationMesh.html#a3d05328ba2720fa4d5c6f067e7dbb395',1,'lsWriteVisualizationMesh::lsWriteVisualizationMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; levelSet)'],['../classlsWriteVisualizationMesh.html#ae94323fb9a6461cc62d1d6f566eb1a05',1,'lsWriteVisualizationMesh::lsWriteVisualizationMesh()'],['../classlsWriteVisualizationMesh.html#a3d05328ba2720fa4d5c6f067e7dbb395',1,'lsWriteVisualizationMesh::lsWriteVisualizationMesh(lsSmartPointer&lt; lsDomain&lt; T, D &gt;&gt; levelSet)']]], ['lswritevisualizationmesh_2ehpp_229',['lsWriteVisualizationMesh.hpp',['../include_2lsWriteVisualizationMesh_8hpp.html',1,'(Global Namespace)'],['../install_2ViennaLS_2include_2lsWriteVisualizationMesh_8hpp.html',1,'(Global Namespace)']]] ];
import React from 'react' import Radium from 'radium' import Stop from '../Stop/Stop' import Mock from '../../stores/mocks/stop' class StopList extends React.Component { render() { return ( <section> <header> <h2>List of Stops</h2> <p>A list of Stop Elements.</p> </header> <Stop stop={Mock[0]}/> </section> ) } } export default StopList
import React from "react" const NotFoundPage = () => ( <> <h1>NOT FOUND</h1> </> ) export default NotFoundPage
/** * Generated by "@vuepress/internal-root-mixins" */ import m0 from "C:\\VUE\\node_modules\\@vuepress\\core\\lib\\client\\root-mixins\\updateMeta.js" import m1 from "C:\\VUE\\node_modules\\@vuepress\\plugin-active-header-links\\clientRootMixin.js" import m2 from "C:\\VUE\\node_modules\\@vuepress\\plugin-nprogress\\clientRootMixin.js" export default [ m0, m1, m2 ]
/** * @license Copyright 2017 Google Inc. All Rights Reserved. * 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'; /** * @fileoverview Ensures <img> elements have alternate text or a role of none or presentation. * See base class in axe-audit.js for audit() implementation. */ const AxeAudit = require('./axe-audit'); class ImageAlt extends AxeAudit { /** * @return {!AuditMeta} */ static get meta() { return { category: 'Accessibility', name: 'image-alt', description: 'Image elements have `[alt]` attributes.', failureDescription: 'Image elements do not have `[alt]` attributes.', helpText: 'Informative elements should aim for short, descriptive alternate text. ' + 'Decorative elements can be ignored with an empty alt attribute.' + '[Learn more](https://dequeuniversity.com/rules/axe/2.2/image-alt?application=lighthouse).', requiredArtifacts: ['Accessibility'] }; } } module.exports = ImageAlt;
def read_matrix(): size = int(input()) return [[int(s) for s in (input().split(' '))] for _ in range(size)] def get_add_command(matrix, row, col, value): if row in range(len(matrix)) and col in range(len(matrix)): for r in range(len(matrix)): for c in range(len(matrix)): if r == row and c == col: matrix[r][c] += value else: print('Invalid coordinates') return matrix def get_subtract_command(matrix, row, col, value): if row in range(len(matrix)) and col in range(len(matrix)): for r in range(len(matrix)): for c in range(len(matrix)): if r == row and c == col: matrix[r][c] -= value else: print('Invalid coordinates') return matrix def get_loop_through_matrix(matrix): data = input() while data != 'END': command, row, col, value = data.split() row = int(row) col = int(col) value = int(value) if command == 'Add': get_add_command(matrix, row, col, value) elif command == 'Subtract': get_subtract_command(matrix, row, col, value) data = input() def print_result(matrix): for r in range(len(matrix)): print(' '.join([str(s) for s in matrix[r]])) matrix = read_matrix() result = get_loop_through_matrix(matrix) print_result(matrix)
/** * Layout: Assamese * Source: Akhilesh (https://github.com/akki2825) */ export default { layout: { default: [ "\u0965 \u09e7 \u09e8 \u09e9 \u09ea \u09eb \u09ec \u09ed \u09ee \u09ef \u09e6 \u002d \u09c3 {bksp}", "{tab} \u09cc \u09c8 \u09be \u09c0 \u09c2 \u09ac \u09b9 \u0997 \u09a6 \u099c \u09a1 \u09bc", "\u09cb \u09c7 \u09cd \u09bf \u09c1 \u09aa \u09f0 \u0995 \u09a4 \u099a \u099f {enter}", "{shift} \u0982 \u09ae \u09a8 \u09f1 \u09b2 \u09b8 \u002c \u002e \u09df {shift}", ".com @ {space}", ], shift: [ "\u0021 \u0040 ( ) \u0983 \u098b {bksp}", "{tab} \u0994 \u0990 \u0986 \u0998 \u098a \u09ad \u0999 \u0998 \u09a7 \u099d \u09a2 \u099e", "\u0993 \u098f \u0985 \u0987 \u0989 \u09ab \u0996 \u09a5 \u099b \u099b \u09a0 {enter}", "{shift} \u0981 \u09a3 \u09b6 \u09b7 \u0964 \u09af {shift}", ".com @ {space}", ], }, };
/*! * FileInput Turkish Translations * * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or * any HTML markup tags in the messages must not be converted or translated. * * @see http://github.com/kartik-v/bootstrap-fileinput * * NOTE: this file must be saved in UTF-8 encoding. */ (function ($) { "use strict"; $.fn.fileinput.locales.tr = { fileSingle: 'dosya', filePlural: 'dosyalar', browseLabel: 'Gözat &hellip;', removeLabel: 'Sil', removeTitle: 'Seçilen dosyaları sil', cancelLabel: 'İptal', cancelTitle: 'Devam eden yüklemeyi iptal et', uploadLabel: 'Yükle', uploadTitle: 'Seçilen dosyaları yükle', msgSizeTooLarge: '"{name}" dosyasının boyutu (<b>{size} KB</b>) izin verilen azami dosya boyutu olan <b>{maxSize} KB</b>\'tan büyük. Lütfen tekrar deneyin!', msgFilesTooLess: 'Yüklemek için en az <b>{n}</b> {files} dosya seçmelisiniz. Lütfen tekrar deneyin!', msgFilesTooMany: 'Yüklemek için seçtiğiniz dosya sayısı <b>({n})</b> azami limitin <b>{m}</b> altında olmalıdır. Lütfen tekrar deneyin!', msgFileNotFound: '"{name}" dosyası bulunamadı!', msgFileSecured: 'Güvenlik kısıtlamaları "{name}" dosyasının okunmasını engelliyor.', msgFileNotReadable: '"{name}" dosyası okunabilir değil.', msgFilePreviewAborted: '"{name}" dosyası için önizleme iptal edildi.', msgFilePreviewError: '"{name}" dosyası okunurken bir hata oluştu.', msgInvalidFileType: '"{name}" dosyasının türü geçerli değil. Yalnızca "{types}" türünde dosyalara izin veriliyor.', msgInvalidFileExtension: '"{name}" dosyasının uzantısı geçersiz. Yalnızca "{extensions}" uzantılı dosyalara izin veriliyor.', msgValidationError: 'Dosya Yükleme Hatası', msgLoading: 'Dosyalar yükleniyor {index} / {files} &hellip;', msgProgress: 'Dosya yükleniyor {index} / {files} - {name} - %{percent} tamamlandı.', msgSelected: '{n} {files} seçildi', msgFoldersNotAllowed: 'Yalnızca dosyaları sürükleyip bırakabilirsiniz! {n} dizin(ler) göz ardı edildi.', dropZoneTitle: 'Dosyaları buraya sürükleyip bırakın &hellip;' }; $.extend($.fn.fileinput.defaults, $.fn.fileinput.locales.tr); })(window.jQuery);
import axios from "axios" const baseUrl = "http://localhost:3001/persons" const getAll = () => { return axios .get(baseUrl) .then(response => response.data) } const create = newObject => { return axios .post(baseUrl, newObject) .then(response => response.data) } const update = (id, newObject) => { return axios .put(`${baseUrl}/${id}`, newObject) .then(response => response.data) } const drop = id => { return axios .delete(`${baseUrl}/${id}`) .then(response => response.data) } export default { getAll, create, drop, update }
// Regular expression that matches all symbols in the Supplementary Private Use Area-A block as per Unicode v10.0.0: /[\uDB80-\uDBBF][\uDC00-\uDFFF]/;
"use strict"; process.stdin.resume(); process.stdin.setEncoding("utf-8"); let inputString = ""; let currentLine = 0; process.stdin.on("data", (inputStdin) => { inputString += inputStdin; }); process.stdin.on("end", (_) => { inputString = inputString .trim() .split("\n") .map((string) => { return string.trim(); }); main(); }); function readLine() { return inputString[currentLine++]; } function getGrade(score) { let grade; // Write your code here if (score > 25 && score <= 30) { grade = "A"; } else if (score > 20 && score <= 25) { grade = "B"; } else if (score > 15 && score <= 20) { grade = "C"; } else if (score > 10 && score <= 15) { grade = "D"; } else if (score > 5 && score <= 10) { grade = "E"; } else { grade = "F"; } return grade; } function main() { const score = +readLine(); console.log(getGrade(score)); }
const CustomError = require("../extensions/custom-error"); module.exports = function dateSample(sampleActivity) { const MODERN_ACTIVITY= 15; const HALF_LIFE_PERIOD= 5730; if( typeof sampleActivity !== 'string') return false;//проверка,чтобы входное значение было строкой const NUMsmplAct=parseFloat(sampleActivity);//принимаем строку,возвращаем число //проверка пришедшего числа на 'адекватность' if (isNaN(NUMsmplAct)) return false; if (NUMsmplAct === 0) return false; if (NUMsmplAct < 0) return false; if (NUMsmplAct > MODERN_ACTIVITY) return false; //дормула для нахождения константы const k=Math.LN2/HALF_LIFE_PERIOD;//LN2=0,693 //формула let form = Math.log(MODERN_ACTIVITY/sampleActivity)/k; //округление до целого числа return Math.ceil(form); };
import React from "react"; import { makeStyles } from "@material-ui/core/styles"; import Accordion from "@material-ui/core/Accordion"; import AccordionSummary from "@material-ui/core/AccordionSummary"; import AccordionDetails from "@material-ui/core/AccordionDetails"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemText from "@material-ui/core/ListItemText"; import Typography from "@material-ui/core/Typography"; import { TextField } from "@material-ui/core"; const useStyles = makeStyles((theme) => ({ heading: { fontSize: theme.typography.pxToRem(15), fontWeight: theme.typography.fontWeightRegular, }, })); const IngredientsAccordion = (props) => { const classes = useStyles(); const { ingredients } = props; const [numPeople, setNumPeople] = React.useState(1); const handleNumPeopleChange = (e) => { setNumPeople(e.target.value > 0 ? e.target.value : 1); }; return ( <Accordion> <AccordionSummary expandIcon={<ExpandMoreIcon />} aria-controls="panel1a-content" id="panel1a-header" > <Typography className={classes.heading}>用料</Typography> </AccordionSummary> <AccordionDetails> <Typography component={"span"} variant={"body2"}> <TextField label="人数" defaultValue="1" variant="outlined" size="small" fullWidth={true} onChange={handleNumPeopleChange} /> <List> {ingredients.map((item, index) => ( <ListItem key={index}> <ListItemText primary={item.title} secondary={ Math.round(item.quantity * numPeople * 100) / 100 + item.unit } /> </ListItem> ))} </List> </Typography> </AccordionDetails> </Accordion> ); }; export default IngredientsAccordion;
# Generated by Django 3.2.7 on 2021-11-02 16:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('file_manager', '0042_auto_20211102_1000'), ] operations = [ migrations.AlterField( model_name='rawfile', name='note_file', field=models.ManyToManyField(blank=True, to='file_manager.NoteFile'), ), ]
const htmlSitemap = require('@parameter1/base-cms-marko-web-html-sitemap/routes'); const identityX = require('./identity-x'); const magazine = require('../components/magazine/routes'); const nativeX = require('./native-x'); const printContent = require('./print-content'); const publicFiles = require('./public-files'); const redirects = require('./redirects'); const renderBlock = require('./render-block'); const search = require('./search'); module.exports = (app, siteConfig) => { // IdentityX (user routing and app context) identityX(app); // Magazine Routes magazine(app); // NativeX (Story rendering) nativeX(app); // Shared Print Content printContent(app); // Shared Public Files (e.g. ads.txt) publicFiles(app); // Redirects redirects(app, siteConfig); // Remote component/block loader renderBlock(app); // Search routes search(app, siteConfig); // HTML Sitemap htmlSitemap(app); };
module.exports = [{"isApi":true,"priority":1000.003,"key":"Window","style":{backgroundColor:"#ccc",navBarHidden:true,}}];
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function (a, b) { "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document)throw new Error("jQuery requires a window with a document"); return b(a) } : b(a) }("undefined" != typeof window ? window : this, function (a, b) { var c = [], d = c.slice, e = c.concat, f = c.push, g = c.indexOf, h = {}, i = h.toString, j = h.hasOwnProperty, k = {}, l = a.document, m = "2.1.4", n = function (a, b) { return new n.fn.init(a, b) }, o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, p = /^-ms-/, q = /-([\da-z])/gi, r = function (a, b) { return b.toUpperCase() }; n.fn = n.prototype = { jquery: m, constructor: n, selector: "", length: 0, toArray: function () { return d.call(this) }, get: function (a) { return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this) }, pushStack: function (a) { var b = n.merge(this.constructor(), a); return b.prevObject = this, b.context = this.context, b }, each: function (a, b) { return n.each(this, a, b) }, map: function (a) { return this.pushStack(n.map(this, function (b, c) { return a.call(b, c, b) })) }, slice: function () { return this.pushStack(d.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (a) { var b = this.length, c = +a + (0 > a ? b : 0); return this.pushStack(c >= 0 && b > c ? [this[c]] : []) }, end: function () { return this.prevObject || this.constructor(null) }, push: f, sort: c.sort, splice: c.splice }, n.extend = n.fn.extend = function () { var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j = !1; for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || n.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)if (null != (a = arguments[h]))for (b in a)c = g[b], d = a[b], g !== d && (j && d && (n.isPlainObject(d) || (e = n.isArray(d))) ? (e ? (e = !1, f = c && n.isArray(c) ? c : []) : f = c && n.isPlainObject(c) ? c : {}, g[b] = n.extend(j, f, d)) : void 0 !== d && (g[b] = d)); return g }, n.extend({ expando: "jQuery" + (m + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (a) { throw new Error(a) }, noop: function () { }, isFunction: function (a) { return "function" === n.type(a) }, isArray: Array.isArray, isWindow: function (a) { return null != a && a === a.window }, isNumeric: function (a) { return !n.isArray(a) && a - parseFloat(a) + 1 >= 0 }, isPlainObject: function (a) { return "object" !== n.type(a) || a.nodeType || n.isWindow(a) ? !1 : a.constructor && !j.call(a.constructor.prototype, "isPrototypeOf") ? !1 : !0 }, isEmptyObject: function (a) { var b; for (b in a)return !1; return !0 }, type: function (a) { return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? h[i.call(a)] || "object" : typeof a }, globalEval: function (a) { var b, c = eval; a = n.trim(a), a && (1 === a.indexOf("use strict") ? (b = l.createElement("script"), b.text = a, l.head.appendChild(b).parentNode.removeChild(b)) : c(a)) }, camelCase: function (a) { return a.replace(p, "ms-").replace(q, r) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, b, c) { var d, e = 0, f = a.length, g = s(a); if (c) { if (g) { for (; f > e; e++)if (d = b.apply(a[e], c), d === !1)break } else for (e in a)if (d = b.apply(a[e], c), d === !1)break } else if (g) { for (; f > e; e++)if (d = b.call(a[e], e, a[e]), d === !1)break } else for (e in a)if (d = b.call(a[e], e, a[e]), d === !1)break; return a }, trim: function (a) { return null == a ? "" : (a + "").replace(o, "") }, makeArray: function (a, b) { var c = b || []; return null != a && (s(Object(a)) ? n.merge(c, "string" == typeof a ? [a] : a) : f.call(c, a)), c }, inArray: function (a, b, c) { return null == b ? -1 : g.call(b, a, c) }, merge: function (a, b) { for (var c = +b.length, d = 0, e = a.length; c > d; d++)a[e++] = b[d]; return a.length = e, a }, grep: function (a, b, c) { for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++)d = !b(a[f], f), d !== h && e.push(a[f]); return e }, map: function (a, b, c) { var d, f = 0, g = a.length, h = s(a), i = []; if (h)for (; g > f; f++)d = b(a[f], f, c), null != d && i.push(d); else for (f in a)d = b(a[f], f, c), null != d && i.push(d); return e.apply([], i) }, guid: 1, proxy: function (a, b) { var c, e, f; return "string" == typeof b && (c = a[b], b = a, a = c), n.isFunction(a) ? (e = d.call(arguments, 2), f = function () { return a.apply(b || this, e.concat(d.call(arguments))) }, f.guid = a.guid = a.guid || n.guid++, f) : void 0 }, now: Date.now, support: k }), n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (a, b) { h["[object " + b + "]"] = b.toLowerCase() }); function s(a) { var b = "length" in a && a.length, c = n.type(a); return "function" === c || n.isWindow(a) ? !1 : 1 === a.nodeType && b ? !0 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a } var t = function (a) { var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date, v = a.document, w = 0, x = 0, y = ha(), z = ha(), A = ha(), B = function (a, b) { return a === b && (l = !0), 0 }, C = 1 << 31, D = {}.hasOwnProperty, E = [], F = E.pop, G = E.push, H = E.push, I = E.slice, J = function (a, b) { for (var c = 0, d = a.length; d > c; c++)if (a[c] === b)return c; return -1 }, K = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", L = "[\\x20\\t\\r\\n\\f]", M = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", N = M.replace("w", "w#"), O = "\\[" + L + "*(" + M + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + N + "))|)" + L + "*\\]", P = ":(" + M + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + O + ")*)|.*)\\)|)", Q = new RegExp(L + "+", "g"), R = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$", "g"), S = new RegExp("^" + L + "*," + L + "*"), T = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"), U = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]", "g"), V = new RegExp(P), W = new RegExp("^" + N + "$"), X = { ID: new RegExp("^#(" + M + ")"), CLASS: new RegExp("^\\.(" + M + ")"), TAG: new RegExp("^(" + M.replace("w", "w*") + ")"), ATTR: new RegExp("^" + O), PSEUDO: new RegExp("^" + P), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)", "i"), bool: new RegExp("^(?:" + K + ")$", "i"), needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)", "i") }, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, $ = /^[^{]+\{\s*\[native \w/, _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, aa = /[+~]/, ba = /'|\\/g, ca = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)", "ig"), da = function (a, b, c) { var d = "0x" + b - 65536; return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320) }, ea = function () { m() }; try { H.apply(E = I.call(v.childNodes), v.childNodes), E[v.childNodes.length].nodeType } catch (fa) { H = { apply: E.length ? function (a, b) { G.apply(a, I.call(b)) } : function (a, b) { var c = a.length, d = 0; while (a[c++] = b[d++]); a.length = c - 1 } } } function ga(a, b, d, e) { var f, h, j, k, l, o, r, s, w, x; if ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, d = d || [], k = b.nodeType, "string" != typeof a || !a || 1 !== k && 9 !== k && 11 !== k)return d; if (!e && p) { if (11 !== k && (f = _.exec(a)))if (j = f[1]) { if (9 === k) { if (h = b.getElementById(j), !h || !h.parentNode)return d; if (h.id === j)return d.push(h), d } else if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j)return d.push(h), d } else { if (f[2])return H.apply(d, b.getElementsByTagName(a)), d; if ((j = f[3]) && c.getElementsByClassName)return H.apply(d, b.getElementsByClassName(j)), d } if (c.qsa && (!q || !q.test(a))) { if (s = r = u, w = b, x = 1 !== k && a, 1 === k && "object" !== b.nodeName.toLowerCase()) { o = g(a), (r = b.getAttribute("id")) ? s = r.replace(ba, "\\$&") : b.setAttribute("id", s), s = "[id='" + s + "'] ", l = o.length; while (l--)o[l] = s + ra(o[l]); w = aa.test(a) && pa(b.parentNode) || b, x = o.join(",") } if (x)try { return H.apply(d, w.querySelectorAll(x)), d } catch (y) { } finally { r || b.removeAttribute("id") } } } return i(a.replace(R, "$1"), b, d, e) } function ha() { var a = []; function b(c, e) { return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e } return b } function ia(a) { return a[u] = !0, a } function ja(a) { var b = n.createElement("div"); try { return !!a(b) } catch (c) { return !1 } finally { b.parentNode && b.parentNode.removeChild(b), b = null } } function ka(a, b) { var c = a.split("|"), e = a.length; while (e--)d.attrHandle[c[e]] = b } function la(a, b) { var c = b && a, d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || C) - (~a.sourceIndex || C); if (d)return d; if (c)while (c = c.nextSibling)if (c === b)return -1; return a ? 1 : -1 } function ma(a) { return function (b) { var c = b.nodeName.toLowerCase(); return "input" === c && b.type === a } } function na(a) { return function (b) { var c = b.nodeName.toLowerCase(); return ("input" === c || "button" === c) && b.type === a } } function oa(a) { return ia(function (b) { return b = +b, ia(function (c, d) { var e, f = a([], c.length, b), g = f.length; while (g--)c[e = f[g]] && (c[e] = !(d[e] = c[e])) }) }) } function pa(a) { return a && "undefined" != typeof a.getElementsByTagName && a } c = ga.support = {}, f = ga.isXML = function (a) { var b = a && (a.ownerDocument || a).documentElement; return b ? "HTML" !== b.nodeName : !1 }, m = ga.setDocument = function (a) { var b, e, g = a ? a.ownerDocument || a : v; return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = g.documentElement, e = g.defaultView, e && e !== e.top && (e.addEventListener ? e.addEventListener("unload", ea, !1) : e.attachEvent && e.attachEvent("onunload", ea)), p = !f(g), c.attributes = ja(function (a) { return a.className = "i", !a.getAttribute("className") }), c.getElementsByTagName = ja(function (a) { return a.appendChild(g.createComment("")), !a.getElementsByTagName("*").length }), c.getElementsByClassName = $.test(g.getElementsByClassName), c.getById = ja(function (a) { return o.appendChild(a).id = u, !g.getElementsByName || !g.getElementsByName(u).length }), c.getById ? (d.find.ID = function (a, b) { if ("undefined" != typeof b.getElementById && p) { var c = b.getElementById(a); return c && c.parentNode ? [c] : [] } }, d.filter.ID = function (a) { var b = a.replace(ca, da); return function (a) { return a.getAttribute("id") === b } }) : (delete d.find.ID, d.filter.ID = function (a) { var b = a.replace(ca, da); return function (a) { var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id"); return c && c.value === b } }), d.find.TAG = c.getElementsByTagName ? function (a, b) { return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0 } : function (a, b) { var c, d = [], e = 0, f = b.getElementsByTagName(a); if ("*" === a) { while (c = f[e++])1 === c.nodeType && d.push(c); return d } return f }, d.find.CLASS = c.getElementsByClassName && function (a, b) { return p ? b.getElementsByClassName(a) : void 0 }, r = [], q = [], (c.qsa = $.test(g.querySelectorAll)) && (ja(function (a) { o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\f]' msallowcapture=''><option selected=''></option></select>", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + L + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + L + "*(?:value|" + K + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]") }), ja(function (a) { var b = g.createElement("input"); b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + L + "*[*^$|!~]?="), a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:") })), (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ja(function (a) { c.disconnectedMatch = s.call(a, "div"), s.call(a, "[s!='']:x"), r.push("!=", P) }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = $.test(o.compareDocumentPosition), t = b || $.test(o.contains) ? function (a, b) { var c = 9 === a.nodeType ? a.documentElement : a, d = b && b.parentNode; return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d))) } : function (a, b) { if (b)while (b = b.parentNode)if (b === a)return !0; return !1 }, B = b ? function (a, b) { if (a === b)return l = !0, 0; var d = !a.compareDocumentPosition - !b.compareDocumentPosition; return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === g || a.ownerDocument === v && t(v, a) ? -1 : b === g || b.ownerDocument === v && t(v, b) ? 1 : k ? J(k, a) - J(k, b) : 0 : 4 & d ? -1 : 1) } : function (a, b) { if (a === b)return l = !0, 0; var c, d = 0, e = a.parentNode, f = b.parentNode, h = [a], i = [b]; if (!e || !f)return a === g ? -1 : b === g ? 1 : e ? -1 : f ? 1 : k ? J(k, a) - J(k, b) : 0; if (e === f)return la(a, b); c = a; while (c = c.parentNode)h.unshift(c); c = b; while (c = c.parentNode)i.unshift(c); while (h[d] === i[d])d++; return d ? la(h[d], i[d]) : h[d] === v ? -1 : i[d] === v ? 1 : 0 }, g) : n }, ga.matches = function (a, b) { return ga(a, null, null, b) }, ga.matchesSelector = function (a, b) { if ((a.ownerDocument || a) !== n && m(a), b = b.replace(U, "='$1']"), !(!c.matchesSelector || !p || r && r.test(b) || q && q.test(b)))try { var d = s.call(a, b); if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType)return d } catch (e) { } return ga(b, n, null, [a]).length > 0 }, ga.contains = function (a, b) { return (a.ownerDocument || a) !== n && m(a), t(a, b) }, ga.attr = function (a, b) { (a.ownerDocument || a) !== n && m(a); var e = d.attrHandle[b.toLowerCase()], f = e && D.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0; return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null }, ga.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }, ga.uniqueSort = function (a) { var b, d = [], e = 0, f = 0; if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) { while (b = a[f++])b === a[f] && (e = d.push(f)); while (e--)a.splice(d[e], 1) } return k = null, a }, e = ga.getText = function (a) { var b, c = "", d = 0, f = a.nodeType; if (f) { if (1 === f || 9 === f || 11 === f) { if ("string" == typeof a.textContent)return a.textContent; for (a = a.firstChild; a; a = a.nextSibling)c += e(a) } else if (3 === f || 4 === f)return a.nodeValue } else while (b = a[d++])c += e(b); return c }, d = ga.selectors = { cacheLength: 50, createPseudo: ia, match: X, attrHandle: {}, find: {}, relative: { ">": {dir: "parentNode", first: !0}, " ": {dir: "parentNode"}, "+": {dir: "previousSibling", first: !0}, "~": {dir: "previousSibling"} }, preFilter: { ATTR: function (a) { return a[1] = a[1].replace(ca, da), a[3] = (a[3] || a[4] || a[5] || "").replace(ca, da), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) }, CHILD: function (a) { return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || ga.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && ga.error(a[0]), a }, PSEUDO: function (a) { var b, c = !a[6] && a[2]; return X.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && V.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3)) } }, filter: { TAG: function (a) { var b = a.replace(ca, da).toLowerCase(); return "*" === a ? function () { return !0 } : function (a) { return a.nodeName && a.nodeName.toLowerCase() === b } }, CLASS: function (a) { var b = y[a + " "]; return b || (b = new RegExp("(^|" + L + ")" + a + "(" + L + "|$)")) && y(a, function (a) { return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "") }) }, ATTR: function (a, b, c) { return function (d) { var e = ga.attr(d, a); return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(Q, " ") + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0 } }, CHILD: function (a, b, c, d, e) { var f = "nth" !== a.slice(0, 3), g = "last" !== a.slice(-4), h = "of-type" === b; return 1 === d && 0 === e ? function (a) { return !!a.parentNode } : function (b, c, i) { var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", q = b.parentNode, r = h && b.nodeName.toLowerCase(), s = !i && !h; if (q) { if (f) { while (p) { l = b; while (l = l[p])if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType)return !1; o = p = "only" === a && !o && "nextSibling" } return !0 } if (o = [g ? q.firstChild : q.lastChild], g && s) { k = q[u] || (q[u] = {}), j = k[a] || [], n = j[0] === w && j[1], m = j[0] === w && j[2], l = n && q.childNodes[n]; while (l = ++n && l && l[p] || (m = n = 0) || o.pop())if (1 === l.nodeType && ++m && l === b) { k[a] = [w, n, m]; break } } else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w) m = j[1]; else while (l = ++n && l && l[p] || (m = n = 0) || o.pop())if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) && ++m && (s && ((l[u] || (l[u] = {}))[a] = [w, m]), l === b))break; return m -= e, m === d || m % d === 0 && m / d >= 0 } } }, PSEUDO: function (a, b) { var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error("unsupported pseudo: " + a); return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ia(function (a, c) { var d, f = e(a, b), g = f.length; while (g--)d = J(a, f[g]), a[d] = !(c[d] = f[g]) }) : function (a) { return e(a, 0, c) }) : e } }, pseudos: { not: ia(function (a) { var b = [], c = [], d = h(a.replace(R, "$1")); return d[u] ? ia(function (a, b, c, e) { var f, g = d(a, null, e, []), h = a.length; while (h--)(f = g[h]) && (a[h] = !(b[h] = f)) }) : function (a, e, f) { return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop() } }), has: ia(function (a) { return function (b) { return ga(a, b).length > 0 } }), contains: ia(function (a) { return a = a.replace(ca, da), function (b) { return (b.textContent || b.innerText || e(b)).indexOf(a) > -1 } }), lang: ia(function (a) { return W.test(a || "") || ga.error("unsupported lang: " + a), a = a.replace(ca, da).toLowerCase(), function (b) { var c; do if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang"))return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) && 1 === b.nodeType); return !1 } }), target: function (b) { var c = a.location && a.location.hash; return c && c.slice(1) === b.id }, root: function (a) { return a === o }, focus: function (a) { return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) }, enabled: function (a) { return a.disabled === !1 }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && !!a.checked || "option" === b && !!a.selected }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, empty: function (a) { for (a = a.firstChild; a; a = a.nextSibling)if (a.nodeType < 6)return !1; return !0 }, parent: function (a) { return !d.pseudos.empty(a) }, header: function (a) { return Z.test(a.nodeName) }, input: function (a) { return Y.test(a.nodeName) }, button: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && "button" === a.type || "button" === b }, text: function (a) { var b; return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase()) }, first: oa(function () { return [0] }), last: oa(function (a, b) { return [b - 1] }), eq: oa(function (a, b, c) { return [0 > c ? c + b : c] }), even: oa(function (a, b) { for (var c = 0; b > c; c += 2)a.push(c); return a }), odd: oa(function (a, b) { for (var c = 1; b > c; c += 2)a.push(c); return a }), lt: oa(function (a, b, c) { for (var d = 0 > c ? c + b : c; --d >= 0;)a.push(d); return a }), gt: oa(function (a, b, c) { for (var d = 0 > c ? c + b : c; ++d < b;)a.push(d); return a }) } }, d.pseudos.nth = d.pseudos.eq; for (b in{radio: !0, checkbox: !0, file: !0, password: !0, image: !0})d.pseudos[b] = ma(b); for (b in{submit: !0, reset: !0})d.pseudos[b] = na(b); function qa() { } qa.prototype = d.filters = d.pseudos, d.setFilters = new qa, g = ga.tokenize = function (a, b) { var c, e, f, g, h, i, j, k = z[a + " "]; if (k)return b ? 0 : k.slice(0); h = a, i = [], j = d.preFilter; while (h) { (!c || (e = S.exec(h))) && (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = T.exec(h)) && (c = e.shift(), f.push({ value: c, type: e[0].replace(R, " ") }), h = h.slice(c.length)); for (g in d.filter)!(e = X[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ value: c, type: g, matches: e }), h = h.slice(c.length)); if (!c)break } return b ? h.length : h ? ga.error(a) : z(a, i).slice(0) }; function ra(a) { for (var b = 0, c = a.length, d = ""; c > b; b++)d += a[b].value; return d } function sa(a, b, c) { var d = b.dir, e = c && "parentNode" === d, f = x++; return b.first ? function (b, c, f) { while (b = b[d])if (1 === b.nodeType || e)return a(b, c, f) } : function (b, c, g) { var h, i, j = [w, f]; if (g) { while (b = b[d])if ((1 === b.nodeType || e) && a(b, c, g))return !0 } else while (b = b[d])if (1 === b.nodeType || e) { if (i = b[u] || (b[u] = {}), (h = i[d]) && h[0] === w && h[1] === f)return j[2] = h[2]; if (i[d] = j, j[2] = a(b, c, g))return !0 } } } function ta(a) { return a.length > 1 ? function (b, c, d) { var e = a.length; while (e--)if (!a[e](b, c, d))return !1; return !0 } : a[0] } function ua(a, b, c) { for (var d = 0, e = b.length; e > d; d++)ga(a, b[d], c); return c } function va(a, b, c, d, e) { for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)(f = a[h]) && (!c || c(f, d, e)) && (g.push(f), j && b.push(h)); return g } function wa(a, b, c, d, e, f) { return d && !d[u] && (d = wa(d)), e && !e[u] && (e = wa(e, f)), ia(function (f, g, h, i) { var j, k, l, m = [], n = [], o = g.length, p = f || ua(b || "*", h.nodeType ? [h] : h, []), q = !a || !f && b ? p : va(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q; if (c && c(q, r, h, i), d) { j = va(r, n), d(j, [], h, i), k = j.length; while (k--)(l = j[k]) && (r[n[k]] = !(q[n[k]] = l)) } if (f) { if (e || a) { if (e) { j = [], k = r.length; while (k--)(l = r[k]) && j.push(q[k] = l); e(null, r = [], j, i) } k = r.length; while (k--)(l = r[k]) && (j = e ? J(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)) } } else r = va(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : H.apply(g, r) }) } function xa(a) { for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = sa(function (a) { return a === b }, h, !0), l = sa(function (a) { return J(b, a) > -1 }, h, !0), m = [function (a, c, d) { var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)); return b = null, e }]; f > i; i++)if (c = d.relative[a[i].type]) m = [sa(ta(m), c)]; else { if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) { for (e = ++i; f > e; e++)if (d.relative[a[e].type])break; return wa(i > 1 && ta(m), i > 1 && ra(a.slice(0, i - 1).concat({value: " " === a[i - 2].type ? "*" : ""})).replace(R, "$1"), c, e > i && xa(a.slice(i, e)), f > e && xa(a = a.slice(e)), f > e && ra(a)) } m.push(c) } return ta(m) } function ya(a, b) { var c = b.length > 0, e = a.length > 0, f = function (f, g, h, i, k) { var l, m, o, p = 0, q = "0", r = f && [], s = [], t = j, u = f || e && d.find.TAG("*", k), v = w += null == t ? 1 : Math.random() || .1, x = u.length; for (k && (j = g !== n && g); q !== x && null != (l = u[q]); q++) { if (e && l) { m = 0; while (o = a[m++])if (o(l, g, h)) { i.push(l); break } k && (w = v) } c && ((l = !o && l) && p--, f && r.push(l)) } if (p += q, c && q !== p) { m = 0; while (o = b[m++])o(r, s, g, h); if (f) { if (p > 0)while (q--)r[q] || s[q] || (s[q] = F.call(i)); s = va(s) } H.apply(i, s), k && !f && s.length > 0 && p + b.length > 1 && ga.uniqueSort(i) } return k && (w = v, j = t), r }; return c ? ia(f) : f } return h = ga.compile = function (a, b) { var c, d = [], e = [], f = A[a + " "]; if (!f) { b || (b = g(a)), c = b.length; while (c--)f = xa(b[c]), f[u] ? d.push(f) : e.push(f); f = A(a, ya(e, d)), f.selector = a } return f }, i = ga.select = function (a, b, e, f) { var i, j, k, l, m, n = "function" == typeof a && a, o = !f && g(a = n.selector || a); if (e = e || [], 1 === o.length) { if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) { if (b = (d.find.ID(k.matches[0].replace(ca, da), b) || [])[0], !b)return e; n && (b = b.parentNode), a = a.slice(j.shift().value.length) } i = X.needsContext.test(a) ? 0 : j.length; while (i--) { if (k = j[i], d.relative[l = k.type])break; if ((m = d.find[l]) && (f = m(k.matches[0].replace(ca, da), aa.test(j[0].type) && pa(b.parentNode) || b))) { if (j.splice(i, 1), a = f.length && ra(j), !a)return H.apply(e, f), e; break } } } return (n || h(a, o))(f, b, !p, e, aa.test(a) && pa(b.parentNode) || b), e }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ja(function (a) { return 1 & a.compareDocumentPosition(n.createElement("div")) }), ja(function (a) { return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href") }) || ka("type|href|height|width", function (a, b, c) { return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2) }), c.attributes && ja(function (a) { return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value") }) || ka("value", function (a, b, c) { return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue }), ja(function (a) { return null == a.getAttribute("disabled") }) || ka(K, function (a, b, c) { var d; return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null }), ga }(a); n.find = t, n.expr = t.selectors, n.expr[":"] = n.expr.pseudos, n.unique = t.uniqueSort, n.text = t.getText, n.isXMLDoc = t.isXML, n.contains = t.contains; var u = n.expr.match.needsContext, v = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, w = /^.[^:#\[\.,]*$/; function x(a, b, c) { if (n.isFunction(b))return n.grep(a, function (a, d) { return !!b.call(a, d, a) !== c }); if (b.nodeType)return n.grep(a, function (a) { return a === b !== c }); if ("string" == typeof b) { if (w.test(b))return n.filter(b, a, c); b = n.filter(b, a) } return n.grep(a, function (a) { return g.call(b, a) >= 0 !== c }) } n.filter = function (a, b, c) { var d = b[0]; return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? n.find.matchesSelector(d, a) ? [d] : [] : n.find.matches(a, n.grep(b, function (a) { return 1 === a.nodeType })) }, n.fn.extend({ find: function (a) { var b, c = this.length, d = [], e = this; if ("string" != typeof a)return this.pushStack(n(a).filter(function () { for (b = 0; c > b; b++)if (n.contains(e[b], this))return !0 })); for (b = 0; c > b; b++)n.find(a, e[b], d); return d = this.pushStack(c > 1 ? n.unique(d) : d), d.selector = this.selector ? this.selector + " " + a : a, d }, filter: function (a) { return this.pushStack(x(this, a || [], !1)) }, not: function (a) { return this.pushStack(x(this, a || [], !0)) }, is: function (a) { return !!x(this, "string" == typeof a && u.test(a) ? n(a) : a || [], !1).length } }); var y, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, A = n.fn.init = function (a, b) { var c, d; if (!a)return this; if ("string" == typeof a) { if (c = "<" === a[0] && ">" === a[a.length - 1] && a.length >= 3 ? [null, a, null] : z.exec(a), !c || !c[1] && b)return !b || b.jquery ? (b || y).find(a) : this.constructor(b).find(a); if (c[1]) { if (b = b instanceof n ? b[0] : b, n.merge(this, n.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : l, !0)), v.test(c[1]) && n.isPlainObject(b))for (c in b)n.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]); return this } return d = l.getElementById(c[2]), d && d.parentNode && (this.length = 1, this[0] = d), this.context = l, this.selector = a, this } return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : n.isFunction(a) ? "undefined" != typeof y.ready ? y.ready(a) : a(n) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), n.makeArray(a, this)) }; A.prototype = n.fn, y = n(l); var B = /^(?:parents|prev(?:Until|All))/, C = {children: !0, contents: !0, next: !0, prev: !0}; n.extend({ dir: function (a, b, c) { var d = [], e = void 0 !== c; while ((a = a[b]) && 9 !== a.nodeType)if (1 === a.nodeType) { if (e && n(a).is(c))break; d.push(a) } return d }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling)1 === a.nodeType && a !== b && c.push(a); return c } }), n.fn.extend({ has: function (a) { var b = n(a, this), c = b.length; return this.filter(function () { for (var a = 0; c > a; a++)if (n.contains(this, b[a]))return !0 }) }, closest: function (a, b) { for (var c, d = 0, e = this.length, f = [], g = u.test(a) || "string" != typeof a ? n(a, b || this.context) : 0; e > d; d++)for (c = this[d]; c && c !== b; c = c.parentNode)if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && n.find.matchesSelector(c, a))) { f.push(c); break } return this.pushStack(f.length > 1 ? n.unique(f) : f) }, index: function (a) { return a ? "string" == typeof a ? g.call(n(a), this[0]) : g.call(this, a.jquery ? a[0] : a) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (a, b) { return this.pushStack(n.unique(n.merge(this.get(), n(a, b)))) }, addBack: function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) } }); function D(a, b) { while ((a = a[b]) && 1 !== a.nodeType); return a } n.each({ parent: function (a) { var b = a.parentNode; return b && 11 !== b.nodeType ? b : null }, parents: function (a) { return n.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return n.dir(a, "parentNode", c) }, next: function (a) { return D(a, "nextSibling") }, prev: function (a) { return D(a, "previousSibling") }, nextAll: function (a) { return n.dir(a, "nextSibling") }, prevAll: function (a) { return n.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return n.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return n.dir(a, "previousSibling", c) }, siblings: function (a) { return n.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return n.sibling(a.firstChild) }, contents: function (a) { return a.contentDocument || n.merge([], a.childNodes) } }, function (a, b) { n.fn[a] = function (c, d) { var e = n.map(this, b, c); return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = n.filter(d, e)), this.length > 1 && (C[a] || n.unique(e), B.test(a) && e.reverse()), this.pushStack(e) } }); var E = /\S+/g, F = {}; function G(a) { var b = F[a] = {}; return n.each(a.match(E) || [], function (a, c) { b[c] = !0 }), b } n.Callbacks = function (a) { a = "string" == typeof a ? F[a] || G(a) : n.extend({}, a); var b, c, d, e, f, g, h = [], i = !a.once && [], j = function (l) { for (b = a.memory && l, c = !0, g = e || 0, e = 0, f = h.length, d = !0; h && f > g; g++)if (h[g].apply(l[0], l[1]) === !1 && a.stopOnFalse) { b = !1; break } d = !1, h && (i ? i.length && j(i.shift()) : b ? h = [] : k.disable()) }, k = { add: function () { if (h) { var c = h.length; !function g(b) { n.each(b, function (b, c) { var d = n.type(c); "function" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && "string" !== d && g(c) }) }(arguments), d ? f = h.length : b && (e = c, j(b)) } return this }, remove: function () { return h && n.each(arguments, function (a, b) { var c; while ((c = n.inArray(b, h, c)) > -1)h.splice(c, 1), d && (f >= c && f--, g >= c && g--) }), this }, has: function (a) { return a ? n.inArray(a, h) > -1 : !(!h || !h.length) }, empty: function () { return h = [], f = 0, this }, disable: function () { return h = i = b = void 0, this }, disabled: function () { return !h }, lock: function () { return i = void 0, b || k.disable(), this }, locked: function () { return !i }, fireWith: function (a, b) { return !h || c && !i || (b = b || [], b = [a, b.slice ? b.slice() : b], d ? i.push(b) : j(b)), this }, fire: function () { return k.fireWith(this, arguments), this }, fired: function () { return !!c } }; return k }, n.extend({ Deferred: function (a) { var b = [["resolve", "done", n.Callbacks("once memory"), "resolved"], ["reject", "fail", n.Callbacks("once memory"), "rejected"], ["notify", "progress", n.Callbacks("memory")]], c = "pending", d = { state: function () { return c }, always: function () { return e.done(arguments).fail(arguments), this }, then: function () { var a = arguments; return n.Deferred(function (c) { n.each(b, function (b, f) { var g = n.isFunction(a[b]) && a[b]; e[f[1]](function () { var a = g && g.apply(this, arguments); a && n.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments) }) }), a = null }).promise() }, promise: function (a) { return null != a ? n.extend(a, d) : d } }, e = {}; return d.pipe = d.then, n.each(b, function (a, f) { var g = f[2], h = f[3]; d[f[1]] = g.add, h && g.add(function () { c = h }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = function () { return e[f[0] + "With"](this === e ? d : this, arguments), this }, e[f[0] + "With"] = g.fireWith }), d.promise(e), a && a.call(e, e), e }, when: function (a) { var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && n.isFunction(a.promise) ? e : 0, g = 1 === f ? a : n.Deferred(), h = function (a, b, c) { return function (e) { b[a] = this, c[a] = arguments.length > 1 ? d.call(arguments) : e, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c) } }, i, j, k; if (e > 1)for (i = new Array(e), j = new Array(e), k = new Array(e); e > b; b++)c[b] && n.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f; return f || g.resolveWith(k, c), g.promise() } }); var H; n.fn.ready = function (a) { return n.ready.promise().done(a), this }, n.extend({ isReady: !1, readyWait: 1, holdReady: function (a) { a ? n.readyWait++ : n.ready(!0) }, ready: function (a) { (a === !0 ? --n.readyWait : n.isReady) || (n.isReady = !0, a !== !0 && --n.readyWait > 0 || (H.resolveWith(l, [n]), n.fn.triggerHandler && (n(l).triggerHandler("ready"), n(l).off("ready")))) } }); function I() { l.removeEventListener("DOMContentLoaded", I, !1), a.removeEventListener("load", I, !1), n.ready() } n.ready.promise = function (b) { return H || (H = n.Deferred(), "complete" === l.readyState ? setTimeout(n.ready) : (l.addEventListener("DOMContentLoaded", I, !1), a.addEventListener("load", I, !1))), H.promise(b) }, n.ready.promise(); var J = n.access = function (a, b, c, d, e, f, g) { var h = 0, i = a.length, j = null == c; if ("object" === n.type(c)) { e = !0; for (h in c)n.access(a, b, h, c[h], !0, f, g) } else if (void 0 !== d && (e = !0, n.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function (a, b, c) { return j.call(n(a), c) })), b))for (; i > h; h++)b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); return e ? a : j ? b.call(a) : i ? b(a[0], c) : f }; n.acceptData = function (a) { return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType }; function K() { Object.defineProperty(this.cache = {}, 0, { get: function () { return {} } }), this.expando = n.expando + K.uid++ } K.uid = 1, K.accepts = n.acceptData, K.prototype = { key: function (a) { if (!K.accepts(a))return 0; var b = {}, c = a[this.expando]; if (!c) { c = K.uid++; try { b[this.expando] = {value: c}, Object.defineProperties(a, b) } catch (d) { b[this.expando] = c, n.extend(a, b) } } return this.cache[c] || (this.cache[c] = {}), c }, set: function (a, b, c) { var d, e = this.key(a), f = this.cache[e]; if ("string" == typeof b) f[b] = c; else if (n.isEmptyObject(f)) n.extend(this.cache[e], b); else for (d in b)f[d] = b[d]; return f }, get: function (a, b) { var c = this.cache[this.key(a)]; return void 0 === b ? c : c[b] }, access: function (a, b, c) { var d; return void 0 === b || b && "string" == typeof b && void 0 === c ? (d = this.get(a, b), void 0 !== d ? d : this.get(a, n.camelCase(b))) : (this.set(a, b, c), void 0 !== c ? c : b) }, remove: function (a, b) { var c, d, e, f = this.key(a), g = this.cache[f]; if (void 0 === b) this.cache[f] = {}; else { n.isArray(b) ? d = b.concat(b.map(n.camelCase)) : (e = n.camelCase(b), b in g ? d = [b, e] : (d = e, d = d in g ? [d] : d.match(E) || [])), c = d.length; while (c--)delete g[d[c]] } }, hasData: function (a) { return !n.isEmptyObject(this.cache[a[this.expando]] || {}) }, discard: function (a) { a[this.expando] && delete this.cache[a[this.expando]] } }; var L = new K, M = new K, N = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, O = /([A-Z])/g; function P(a, b, c) { var d; if (void 0 === c && 1 === a.nodeType)if (d = "data-" + b.replace(O, "-$1").toLowerCase(), c = a.getAttribute(d), "string" == typeof c) { try { c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : N.test(c) ? n.parseJSON(c) : c } catch (e) { } M.set(a, b, c) } else c = void 0; return c } n.extend({ hasData: function (a) { return M.hasData(a) || L.hasData(a) }, data: function (a, b, c) { return M.access(a, b, c) }, removeData: function (a, b) { M.remove(a, b) }, _data: function (a, b, c) { return L.access(a, b, c) }, _removeData: function (a, b) { L.remove(a, b) } }), n.fn.extend({ data: function (a, b) { var c, d, e, f = this[0], g = f && f.attributes; if (void 0 === a) { if (this.length && (e = M.get(f), 1 === f.nodeType && !L.get(f, "hasDataAttrs"))) { c = g.length; while (c--)g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = n.camelCase(d.slice(5)), P(f, d, e[d]))); L.set(f, "hasDataAttrs", !0) } return e } return "object" == typeof a ? this.each(function () { M.set(this, a) }) : J(this, function (b) { var c, d = n.camelCase(a); if (f && void 0 === b) { if (c = M.get(f, a), void 0 !== c)return c; if (c = M.get(f, d), void 0 !== c)return c; if (c = P(f, d, void 0), void 0 !== c)return c } else this.each(function () { var c = M.get(this, d); M.set(this, d, b), -1 !== a.indexOf("-") && void 0 !== c && M.set(this, a, b) }) }, null, b, arguments.length > 1, null, !0) }, removeData: function (a) { return this.each(function () { M.remove(this, a) }) } }), n.extend({ queue: function (a, b, c) { var d; return a ? (b = (b || "fx") + "queue", d = L.get(a, b), c && (!d || n.isArray(c) ? d = L.access(a, b, n.makeArray(c)) : d.push(c)), d || []) : void 0 }, dequeue: function (a, b) { b = b || "fx"; var c = n.queue(a, b), d = c.length, e = c.shift(), f = n._queueHooks(a, b), g = function () { n.dequeue(a, b) }; "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() }, _queueHooks: function (a, b) { var c = b + "queueHooks"; return L.get(a, c) || L.access(a, c, { empty: n.Callbacks("once memory").add(function () { L.remove(a, [b + "queue", c]) }) }) } }), n.fn.extend({ queue: function (a, b) { var c = 2; return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? n.queue(this[0], a) : void 0 === b ? this : this.each(function () { var c = n.queue(this, a, b); n._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && n.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { n.dequeue(this, a) }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, b) { var c, d = 1, e = n.Deferred(), f = this, g = this.length, h = function () { --d || e.resolveWith(f, [f]) }; "string" != typeof a && (b = a, a = void 0), a = a || "fx"; while (g--)c = L.get(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h)); return h(), e.promise(b) } }); var Q = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, R = ["Top", "Right", "Bottom", "Left"], S = function (a, b) { return a = b || a, "none" === n.css(a, "display") || !n.contains(a.ownerDocument, a) }, T = /^(?:checkbox|radio)$/i; !function () { var a = l.createDocumentFragment(), b = a.appendChild(l.createElement("div")), c = l.createElement("input"); c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), k.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "<textarea>x</textarea>", k.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue }(); var U = "undefined"; k.focusinBubbles = "onfocusin" in a; var V = /^key/, W = /^(?:mouse|pointer|contextmenu)|click/, X = /^(?:focusinfocus|focusoutblur)$/, Y = /^([^.]*)(?:\.(.+)|)$/; function Z() { return !0 } function $() { return !1 } function _() { try { return l.activeElement } catch (a) { } } n.event = { global: {}, add: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, o, p, q, r = L.get(a); if (r) { c.handler && (f = c, c = f.handler, e = f.selector), c.guid || (c.guid = n.guid++), (i = r.events) || (i = r.events = {}), (g = r.handle) || (g = r.handle = function (b) { return typeof n !== U && n.event.triggered !== b.type ? n.event.dispatch.apply(a, arguments) : void 0 }), b = (b || "").match(E) || [""], j = b.length; while (j--)h = Y.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o && (l = n.event.special[o] || {}, o = (e ? l.delegateType : l.bindType) || o, l = n.event.special[o] || {}, k = n.extend({ type: o, origType: q, data: d, handler: c, guid: c.guid, selector: e, needsContext: e && n.expr.match.needsContext.test(e), namespace: p.join(".") }, f), (m = i[o]) || (m = i[o] = [], m.delegateCount = 0, l.setup && l.setup.call(a, d, p, g) !== !1 || a.addEventListener && a.addEventListener(o, g, !1)), l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, k) : m.push(k), n.event.global[o] = !0) } }, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, o, p, q, r = L.hasData(a) && L.get(a); if (r && (i = r.events)) { b = (b || "").match(E) || [""], j = b.length; while (j--)if (h = Y.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) { l = n.event.special[o] || {}, o = (d ? l.delegateType : l.bindType) || o, m = i[o] || [], h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), g = f = m.length; while (f--)k = m[f], !e && q !== k.origType || c && c.guid !== k.guid || h && !h.test(k.namespace) || d && d !== k.selector && ("**" !== d || !k.selector) || (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k)); g && !m.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || n.removeEvent(a, o, r.handle), delete i[o]) } else for (o in i)n.event.remove(a, o + b[j], c, d, !0); n.isEmptyObject(i) && (delete r.handle, L.remove(a, "events")) } }, trigger: function (b, c, d, e) { var f, g, h, i, k, m, o, p = [d || l], q = j.call(b, "type") ? b.type : b, r = j.call(b, "namespace") ? b.namespace.split(".") : []; if (g = h = d = d || l, 3 !== d.nodeType && 8 !== d.nodeType && !X.test(q + n.event.triggered) && (q.indexOf(".") >= 0 && (r = q.split("."), q = r.shift(), r.sort()), k = q.indexOf(":") < 0 && "on" + q, b = b[n.expando] ? b : new n.Event(q, "object" == typeof b && b), b.isTrigger = e ? 2 : 3, b.namespace = r.join("."), b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = d), c = null == c ? [b] : n.makeArray(c, [b]), o = n.event.special[q] || {}, e || !o.trigger || o.trigger.apply(d, c) !== !1)) { if (!e && !o.noBubble && !n.isWindow(d)) { for (i = o.delegateType || q, X.test(i + q) || (g = g.parentNode); g; g = g.parentNode)p.push(g), h = g; h === (d.ownerDocument || l) && p.push(h.defaultView || h.parentWindow || a) } f = 0; while ((g = p[f++]) && !b.isPropagationStopped())b.type = f > 1 ? i : o.bindType || q, m = (L.get(g, "events") || {})[b.type] && L.get(g, "handle"), m && m.apply(g, c), m = k && g[k], m && m.apply && n.acceptData(g) && (b.result = m.apply(g, c), b.result === !1 && b.preventDefault()); return b.type = q, e || b.isDefaultPrevented() || o._default && o._default.apply(p.pop(), c) !== !1 || !n.acceptData(d) || k && n.isFunction(d[q]) && !n.isWindow(d) && (h = d[k], h && (d[k] = null), n.event.triggered = q, d[q](), n.event.triggered = void 0, h && (d[k] = h)), b.result } }, dispatch: function (a) { a = n.event.fix(a); var b, c, e, f, g, h = [], i = d.call(arguments), j = (L.get(this, "events") || {})[a.type] || [], k = n.event.special[a.type] || {}; if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) { h = n.event.handlers.call(this, a, j), b = 0; while ((f = h[b++]) && !a.isPropagationStopped()) { a.currentTarget = f.elem, c = 0; while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped())(!a.namespace_re || a.namespace_re.test(g.namespace)) && (a.handleObj = g, a.data = g.data, e = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== e && (a.result = e) === !1 && (a.preventDefault(), a.stopPropagation())) } return k.postDispatch && k.postDispatch.call(this, a), a.result } }, handlers: function (a, b) { var c, d, e, f, g = [], h = b.delegateCount, i = a.target; if (h && i.nodeType && (!a.button || "click" !== a.type))for (; i !== this; i = i.parentNode || this)if (i.disabled !== !0 || "click" !== a.type) { for (d = [], c = 0; h > c; c++)f = b[c], e = f.selector + " ", void 0 === d[e] && (d[e] = f.needsContext ? n(e, this).index(i) >= 0 : n.find(e, this, null, [i]).length), d[e] && d.push(f); d.length && g.push({elem: i, handlers: d}) } return h < b.length && g.push({elem: this, handlers: b.slice(h)}), g }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: { props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, b) { var c, d, e, f = b.button; return null == a.pageX && null != b.clientX && (c = a.target.ownerDocument || l, d = c.documentElement, e = c.body, a.pageX = b.clientX + (d && d.scrollLeft || e && e.scrollLeft || 0) - (d && d.clientLeft || e && e.clientLeft || 0), a.pageY = b.clientY + (d && d.scrollTop || e && e.scrollTop || 0) - (d && d.clientTop || e && e.clientTop || 0)), a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a } }, fix: function (a) { if (a[n.expando])return a; var b, c, d, e = a.type, f = a, g = this.fixHooks[e]; g || (this.fixHooks[e] = g = W.test(e) ? this.mouseHooks : V.test(e) ? this.keyHooks : {}), d = g.props ? this.props.concat(g.props) : this.props, a = new n.Event(f), b = d.length; while (b--)c = d[b], a[c] = f[c]; return a.target || (a.target = l), 3 === a.target.nodeType && (a.target = a.target.parentNode), g.filter ? g.filter(a, f) : a }, special: { load: {noBubble: !0}, focus: { trigger: function () { return this !== _() && this.focus ? (this.focus(), !1) : void 0 }, delegateType: "focusin" }, blur: { trigger: function () { return this === _() && this.blur ? (this.blur(), !1) : void 0 }, delegateType: "focusout" }, click: { trigger: function () { return "checkbox" === this.type && this.click && n.nodeName(this, "input") ? (this.click(), !1) : void 0 }, _default: function (a) { return n.nodeName(a.target, "a") } }, beforeunload: { postDispatch: function (a) { void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result) } } }, simulate: function (a, b, c, d) { var e = n.extend(new n.Event, c, {type: a, isSimulated: !0, originalEvent: {}}); d ? n.event.trigger(e, null, b) : n.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, n.removeEvent = function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) }, n.Event = function (a, b) { return this instanceof n.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? Z : $) : this.type = a, b && n.extend(this, b), this.timeStamp = a && a.timeStamp || n.now(), void(this[n.expando] = !0)) : new n.Event(a, b) }, n.Event.prototype = { isDefaultPrevented: $, isPropagationStopped: $, isImmediatePropagationStopped: $, preventDefault: function () { var a = this.originalEvent; this.isDefaultPrevented = Z, a && a.preventDefault && a.preventDefault() }, stopPropagation: function () { var a = this.originalEvent; this.isPropagationStopped = Z, a && a.stopPropagation && a.stopPropagation() }, stopImmediatePropagation: function () { var a = this.originalEvent; this.isImmediatePropagationStopped = Z, a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation() } }, n.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (a, b) { n.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj; return (!e || e !== d && !n.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c } } }), k.focusinBubbles || n.each({focus: "focusin", blur: "focusout"}, function (a, b) { var c = function (a) { n.event.simulate(b, a.target, n.event.fix(a), !0) }; n.event.special[b] = { setup: function () { var d = this.ownerDocument || this, e = L.access(d, b); e || d.addEventListener(a, c, !0), L.access(d, b, (e || 0) + 1) }, teardown: function () { var d = this.ownerDocument || this, e = L.access(d, b) - 1; e ? L.access(d, b, e) : (d.removeEventListener(a, c, !0), L.remove(d, b)) } } }), n.fn.extend({ on: function (a, b, c, d, e) { var f, g; if ("object" == typeof a) { "string" != typeof b && (c = c || b, b = void 0); for (g in a)this.on(g, b, c, a[g], e); return this } if (null == c && null == d ? (d = b, c = b = void 0) : null == d && ("string" == typeof b ? (d = c, c = void 0) : (d = c, c = b, b = void 0)), d === !1) d = $; else if (!d)return this; return 1 === e && (f = d, d = function (a) { return n().off(a), f.apply(this, arguments) }, d.guid = f.guid || (f.guid = n.guid++)), this.each(function () { n.event.add(this, a, d, c, b) }) }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1) }, off: function (a, b, c) { var d, e; if (a && a.preventDefault && a.handleObj)return d = a.handleObj, n(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this; if ("object" == typeof a) { for (e in a)this.off(e, b, a[e]); return this } return (b === !1 || "function" == typeof b) && (c = b, b = void 0), c === !1 && (c = $), this.each(function () { n.event.remove(this, a, c, b) }) }, trigger: function (a, b) { return this.each(function () { n.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { var c = this[0]; return c ? n.event.trigger(a, b, c, !0) : void 0 } }); var aa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, ba = /<([\w:]+)/, ca = /<|&#?\w+;/, da = /<(?:script|style|link)/i, ea = /checked\s*(?:[^=]|=\s*.checked.)/i, fa = /^$|\/(?:java|ecma)script/i, ga = /^true\/(.*)/, ha = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, ia = { option: [1, "<select multiple='multiple'>", "</select>"], thead: [1, "<table>", "</table>"], col: [2, "<table><colgroup>", "</colgroup></table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: [0, "", ""] }; ia.optgroup = ia.option, ia.tbody = ia.tfoot = ia.colgroup = ia.caption = ia.thead, ia.th = ia.td; function ja(a, b) { return n.nodeName(a, "table") && n.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a } function ka(a) { return a.type = (null !== a.getAttribute("type")) + "/" + a.type, a } function la(a) { var b = ga.exec(a.type); return b ? a.type = b[1] : a.removeAttribute("type"), a } function ma(a, b) { for (var c = 0, d = a.length; d > c; c++)L.set(a[c], "globalEval", !b || L.get(b[c], "globalEval")) } function na(a, b) { var c, d, e, f, g, h, i, j; if (1 === b.nodeType) { if (L.hasData(a) && (f = L.access(a), g = L.set(b, f), j = f.events)) { delete g.handle, g.events = {}; for (e in j)for (c = 0, d = j[e].length; d > c; c++)n.event.add(b, e, j[e][c]) } M.hasData(a) && (h = M.access(a), i = n.extend({}, h), M.set(b, i)) } } function oa(a, b) { var c = a.getElementsByTagName ? a.getElementsByTagName(b || "*") : a.querySelectorAll ? a.querySelectorAll(b || "*") : []; return void 0 === b || b && n.nodeName(a, b) ? n.merge([a], c) : c } function pa(a, b) { var c = b.nodeName.toLowerCase(); "input" === c && T.test(a.type) ? b.checked = a.checked : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue) } n.extend({ clone: function (a, b, c) { var d, e, f, g, h = a.cloneNode(!0), i = n.contains(a.ownerDocument, a); if (!(k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || n.isXMLDoc(a)))for (g = oa(h), f = oa(a), d = 0, e = f.length; e > d; d++)pa(f[d], g[d]); if (b)if (c)for (f = f || oa(a), g = g || oa(h), d = 0, e = f.length; e > d; d++)na(f[d], g[d]); else na(a, h); return g = oa(h, "script"), g.length > 0 && ma(g, !i && oa(a, "script")), h }, buildFragment: function (a, b, c, d) { for (var e, f, g, h, i, j, k = b.createDocumentFragment(), l = [], m = 0, o = a.length; o > m; m++)if (e = a[m], e || 0 === e)if ("object" === n.type(e)) n.merge(l, e.nodeType ? [e] : e); else if (ca.test(e)) { f = f || k.appendChild(b.createElement("div")), g = (ba.exec(e) || ["", ""])[1].toLowerCase(), h = ia[g] || ia._default, f.innerHTML = h[1] + e.replace(aa, "<$1></$2>") + h[2], j = h[0]; while (j--)f = f.lastChild; n.merge(l, f.childNodes), f = k.firstChild, f.textContent = "" } else l.push(b.createTextNode(e)); k.textContent = "", m = 0; while (e = l[m++])if ((!d || -1 === n.inArray(e, d)) && (i = n.contains(e.ownerDocument, e), f = oa(k.appendChild(e), "script"), i && ma(f), c)) { j = 0; while (e = f[j++])fa.test(e.type || "") && c.push(e) } return k }, cleanData: function (a) { for (var b, c, d, e, f = n.event.special, g = 0; void 0 !== (c = a[g]); g++) { if (n.acceptData(c) && (e = c[L.expando], e && (b = L.cache[e]))) { if (b.events)for (d in b.events)f[d] ? n.event.remove(c, d) : n.removeEvent(c, d, b.handle); L.cache[e] && delete L.cache[e] } delete M.cache[c[M.expando]] } } }), n.fn.extend({ text: function (a) { return J(this, function (a) { return void 0 === a ? n.text(this) : this.empty().each(function () { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = a) }) }, null, a, arguments.length) }, append: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = ja(this, a); b.appendChild(a) } }) }, prepend: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = ja(this, a); b.insertBefore(a, b.firstChild) } }) }, before: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this) }) }, after: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) }) }, remove: function (a, b) { for (var c, d = a ? n.filter(a, this) : this, e = 0; null != (c = d[e]); e++)b || 1 !== c.nodeType || n.cleanData(oa(c)), c.parentNode && (b && n.contains(c.ownerDocument, c) && ma(oa(c, "script")), c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]); b++)1 === a.nodeType && (n.cleanData(oa(a, !1)), a.textContent = ""); return this }, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return n.clone(this, a, b) }) }, html: function (a) { return J(this, function (a) { var b = this[0] || {}, c = 0, d = this.length; if (void 0 === a && 1 === b.nodeType)return b.innerHTML; if ("string" == typeof a && !da.test(a) && !ia[(ba.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(aa, "<$1></$2>"); try { for (; d > c; c++)b = this[c] || {}, 1 === b.nodeType && (n.cleanData(oa(b, !1)), b.innerHTML = a); b = 0 } catch (e) { } } b && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function () { var a = arguments[0]; return this.domManip(arguments, function (b) { a = this.parentNode, n.cleanData(oa(this)), a && a.replaceChild(b, this) }), a && (a.length || a.nodeType) ? this : this.remove() }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, b) { a = e.apply([], a); var c, d, f, g, h, i, j = 0, l = this.length, m = this, o = l - 1, p = a[0], q = n.isFunction(p); if (q || l > 1 && "string" == typeof p && !k.checkClone && ea.test(p))return this.each(function (c) { var d = m.eq(c); q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b) }); if (l && (c = n.buildFragment(a, this[0].ownerDocument, !1, this), d = c.firstChild, 1 === c.childNodes.length && (c = d), d)) { for (f = n.map(oa(c, "script"), ka), g = f.length; l > j; j++)h = c, j !== o && (h = n.clone(h, !0, !0), g && n.merge(f, oa(h, "script"))), b.call(this[j], h, j); if (g)for (i = f[f.length - 1].ownerDocument, n.map(f, la), j = 0; g > j; j++)h = f[j], fa.test(h.type || "") && !L.access(h, "globalEval") && n.contains(i, h) && (h.src ? n._evalUrl && n._evalUrl(h.src) : n.globalEval(h.textContent.replace(ha, ""))) } return this } }), n.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { n.fn[a] = function (a) { for (var c, d = [], e = n(a), g = e.length - 1, h = 0; g >= h; h++)c = h === g ? this : this.clone(!0), n(e[h])[b](c), f.apply(d, c.get()); return this.pushStack(d) } }); var qa, ra = {}; function sa(b, c) { var d, e = n(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : n.css(e[0], "display"); return e.detach(), f } function ta(a) { var b = l, c = ra[a]; return c || (c = sa(a, b), "none" !== c && c || (qa = (qa || n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = qa[0].contentDocument, b.write(), b.close(), c = sa(a, b), qa.detach()), ra[a] = c), c } var ua = /^margin/, va = new RegExp("^(" + Q + ")(?!px)[a-z%]+$", "i"), wa = function (b) { return b.ownerDocument.defaultView.opener ? b.ownerDocument.defaultView.getComputedStyle(b, null) : a.getComputedStyle(b, null) }; function xa(a, b, c) { var d, e, f, g, h = a.style; return c = c || wa(a), c && (g = c.getPropertyValue(b) || c[b]), c && ("" !== g || n.contains(a.ownerDocument, a) || (g = n.style(a, b)), va.test(g) && ua.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 !== g ? g + "" : g } function ya(a, b) { return { get: function () { return a() ? void delete this.get : (this.get = b).apply(this, arguments) } } } !function () { var b, c, d = l.documentElement, e = l.createElement("div"), f = l.createElement("div"); if (f.style) { f.style.backgroundClip = "content-box", f.cloneNode(!0).style.backgroundClip = "", k.clearCloneStyle = "content-box" === f.style.backgroundClip, e.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute", e.appendChild(f); function g() { f.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", f.innerHTML = "", d.appendChild(e); var g = a.getComputedStyle(f, null); b = "1%" !== g.top, c = "4px" === g.width, d.removeChild(e) } a.getComputedStyle && n.extend(k, { pixelPosition: function () { return g(), b }, boxSizingReliable: function () { return null == c && g(), c }, reliableMarginRight: function () { var b, c = f.appendChild(l.createElement("div")); return c.style.cssText = f.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", c.style.marginRight = c.style.width = "0", f.style.width = "1px", d.appendChild(e), b = !parseFloat(a.getComputedStyle(c, null).marginRight), d.removeChild(e), f.removeChild(c), b } }) } }(), n.swap = function (a, b, c, d) { var e, f, g = {}; for (f in b)g[f] = a.style[f], a.style[f] = b[f]; e = c.apply(a, d || []); for (f in b)a.style[f] = g[f]; return e }; var za = /^(none|table(?!-c[ea]).+)/, Aa = new RegExp("^(" + Q + ")(.*)$", "i"), Ba = new RegExp("^([+-])=(" + Q + ")", "i"), Ca = { position: "absolute", visibility: "hidden", display: "block" }, Da = {letterSpacing: "0", fontWeight: "400"}, Ea = ["Webkit", "O", "Moz", "ms"]; function Fa(a, b) { if (b in a)return b; var c = b[0].toUpperCase() + b.slice(1), d = b, e = Ea.length; while (e--)if (b = Ea[e] + c, b in a)return b; return d } function Ga(a, b, c) { var d = Aa.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b } function Ha(a, b, c, d, e) { for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2)"margin" === c && (g += n.css(a, c + R[f], !0, e)), d ? ("content" === c && (g -= n.css(a, "padding" + R[f], !0, e)), "margin" !== c && (g -= n.css(a, "border" + R[f] + "Width", !0, e))) : (g += n.css(a, "padding" + R[f], !0, e), "padding" !== c && (g += n.css(a, "border" + R[f] + "Width", !0, e))); return g } function Ia(a, b, c) { var d = !0, e = "width" === b ? a.offsetWidth : a.offsetHeight, f = wa(a), g = "border-box" === n.css(a, "boxSizing", !1, f); if (0 >= e || null == e) { if (e = xa(a, b, f), (0 > e || null == e) && (e = a.style[b]), va.test(e))return e; d = g && (k.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0 } return e + Ha(a, b, c || (g ? "border" : "content"), d, f) + "px" } function Ja(a, b) { for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)d = a[g], d.style && (f[g] = L.get(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && S(d) && (f[g] = L.access(d, "olddisplay", ta(d.nodeName)))) : (e = S(d), "none" === c && e || L.set(d, "olddisplay", e ? c : n.css(d, "display")))); for (g = 0; h > g; g++)d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none")); return a } n.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = xa(a, "opacity"); return "" === c ? "1" : c } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: {"float": "cssFloat"}, style: function (a, b, c, d) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var e, f, g, h = n.camelCase(b), i = a.style; return b = n.cssProps[h] || (n.cssProps[h] = Fa(i, h)), g = n.cssHooks[b] || n.cssHooks[h], void 0 === c ? g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b] : (f = typeof c, "string" === f && (e = Ba.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(n.css(a, b)), f = "number"), null != c && c === c && ("number" !== f || n.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), g && "set" in g && void 0 === (c = g.set(a, c, d)) || (i[b] = c)), void 0) } }, css: function (a, b, c, d) { var e, f, g, h = n.camelCase(b); return b = n.cssProps[h] || (n.cssProps[h] = Fa(a.style, h)), g = n.cssHooks[b] || n.cssHooks[h], g && "get" in g && (e = g.get(a, !0, c)), void 0 === e && (e = xa(a, b, d)), "normal" === e && b in Da && (e = Da[b]), "" === c || c ? (f = parseFloat(e), c === !0 || n.isNumeric(f) ? f || 0 : e) : e } }), n.each(["height", "width"], function (a, b) { n.cssHooks[b] = { get: function (a, c, d) { return c ? za.test(n.css(a, "display")) && 0 === a.offsetWidth ? n.swap(a, Ca, function () { return Ia(a, b, d) }) : Ia(a, b, d) : void 0 }, set: function (a, c, d) { var e = d && wa(a); return Ga(a, c, d ? Ha(a, b, d, "border-box" === n.css(a, "boxSizing", !1, e), e) : 0) } } }), n.cssHooks.marginRight = ya(k.reliableMarginRight, function (a, b) { return b ? n.swap(a, {display: "inline-block"}, xa, [a, "marginRight"]) : void 0 }), n.each({margin: "", padding: "", border: "Width"}, function (a, b) { n.cssHooks[a + b] = { expand: function (c) { for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++)e[a + R[d] + b] = f[d] || f[d - 2] || f[0]; return e } }, ua.test(a) || (n.cssHooks[a + b].set = Ga) }), n.fn.extend({ css: function (a, b) { return J(this, function (a, b, c) { var d, e, f = {}, g = 0; if (n.isArray(b)) { for (d = wa(a), e = b.length; e > g; g++)f[b[g]] = n.css(a, b[g], !1, d); return f } return void 0 !== c ? n.style(a, b, c) : n.css(a, b) }, a, b, arguments.length > 1) }, show: function () { return Ja(this, !0) }, hide: function () { return Ja(this) }, toggle: function (a) { return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () { S(this) ? n(this).show() : n(this).hide() }) } }); function Ka(a, b, c, d, e) { return new Ka.prototype.init(a, b, c, d, e) } n.Tween = Ka, Ka.prototype = { constructor: Ka, init: function (a, b, c, d, e, f) { this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (n.cssNumber[c] ? "" : "px") }, cur: function () { var a = Ka.propHooks[this.prop]; return a && a.get ? a.get(this) : Ka.propHooks._default.get(this) }, run: function (a) { var b, c = Ka.propHooks[this.prop]; return this.options.duration ? this.pos = b = n.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Ka.propHooks._default.set(this), this } }, Ka.prototype.init.prototype = Ka.prototype, Ka.propHooks = { _default: { get: function (a) { var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = n.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop] }, set: function (a) { n.fx.step[a.prop] ? n.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[n.cssProps[a.prop]] || n.cssHooks[a.prop]) ? n.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, Ka.propHooks.scrollTop = Ka.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, n.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, n.fx = Ka.prototype.init, n.fx.step = {}; var La, Ma, Na = /^(?:toggle|show|hide)$/, Oa = new RegExp("^(?:([+-])=|)(" + Q + ")([a-z%]*)$", "i"), Pa = /queueHooks$/, Qa = [Va], Ra = { "*": [function (a, b) { var c = this.createTween(a, b), d = c.cur(), e = Oa.exec(b), f = e && e[3] || (n.cssNumber[a] ? "" : "px"), g = (n.cssNumber[a] || "px" !== f && +d) && Oa.exec(n.css(c.elem, a)), h = 1, i = 20; if (g && g[3] !== f) { f = f || g[3], e = e || [], g = +d || 1; do h = h || ".5", g /= h, n.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i) } return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c }] }; function Sa() { return setTimeout(function () { La = void 0 }), La = n.now() } function Ta(a, b) { var c, d = 0, e = {height: a}; for (b = b ? 1 : 0; 4 > d; d += 2 - b)c = R[d], e["margin" + c] = e["padding" + c] = a; return b && (e.opacity = e.width = a), e } function Ua(a, b, c) { for (var d, e = (Ra[b] || []).concat(Ra["*"]), f = 0, g = e.length; g > f; f++)if (d = e[f].call(c, b, a))return d } function Va(a, b, c) { var d, e, f, g, h, i, j, k, l = this, m = {}, o = a.style, p = a.nodeType && S(a), q = L.get(a, "fxshow"); c.queue || (h = n._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () { h.unqueued || i() }), h.unqueued++, l.always(function () { l.always(function () { h.unqueued--, n.queue(a, "fx").length || h.empty.fire() }) })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [o.overflow, o.overflowX, o.overflowY], j = n.css(a, "display"), k = "none" === j ? L.get(a, "olddisplay") || ta(a.nodeName) : j, "inline" === k && "none" === n.css(a, "float") && (o.display = "inline-block")), c.overflow && (o.overflow = "hidden", l.always(function () { o.overflow = c.overflow[0], o.overflowX = c.overflow[1], o.overflowY = c.overflow[2] })); for (d in b)if (e = b[d], Na.exec(e)) { if (delete b[d], f = f || "toggle" === e, e === (p ? "hide" : "show")) { if ("show" !== e || !q || void 0 === q[d])continue; p = !0 } m[d] = q && q[d] || n.style(a, d) } else j = void 0; if (n.isEmptyObject(m)) "inline" === ("none" === j ? ta(a.nodeName) : j) && (o.display = j); else { q ? "hidden" in q && (p = q.hidden) : q = L.access(a, "fxshow", {}), f && (q.hidden = !p), p ? n(a).show() : l.done(function () { n(a).hide() }), l.done(function () { var b; L.remove(a, "fxshow"); for (b in m)n.style(a, b, m[b]) }); for (d in m)g = Ua(p ? q[d] : 0, d, l), d in q || (q[d] = g.start, p && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0)) } } function Wa(a, b) { var c, d, e, f, g; for (c in a)if (d = n.camelCase(c), e = b[d], f = a[c], n.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = n.cssHooks[d], g && "expand" in g) { f = g.expand(f), delete a[d]; for (c in f)c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } function Xa(a, b, c) { var d, e, f = 0, g = Qa.length, h = n.Deferred().always(function () { delete i.elem }), i = function () { if (e)return !1; for (var b = La || Sa(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)j.tweens[g].run(f); return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1) }, j = h.promise({ elem: a, props: n.extend({}, b), opts: n.extend(!0, {specialEasing: {}}, c), originalProperties: b, originalOptions: c, startTime: La || Sa(), duration: c.duration, tweens: [], createTween: function (b, c) { var d = n.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); return j.tweens.push(d), d }, stop: function (b) { var c = 0, d = b ? j.tweens.length : 0; if (e)return this; for (e = !0; d > c; c++)j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this } }), k = j.props; for (Wa(k, j.opts.specialEasing); g > f; f++)if (d = Qa[f].call(j, a, k, j.opts))return d; return n.map(k, Ua, j), n.isFunction(j.opts.start) && j.opts.start.call(a, j), n.fx.timer(n.extend(i, { elem: a, anim: j, queue: j.opts.queue })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) } n.Animation = n.extend(Xa, { tweener: function (a, b) { n.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, d = 0, e = a.length; e > d; d++)c = a[d], Ra[c] = Ra[c] || [], Ra[c].unshift(b) }, prefilter: function (a, b) { b ? Qa.unshift(a) : Qa.push(a) } }), n.speed = function (a, b, c) { var d = a && "object" == typeof a ? n.extend({}, a) : { complete: c || !c && b || n.isFunction(a) && a, duration: a, easing: c && b || b && !n.isFunction(b) && b }; return d.duration = n.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in n.fx.speeds ? n.fx.speeds[d.duration] : n.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function () { n.isFunction(d.old) && d.old.call(this), d.queue && n.dequeue(this, d.queue) }, d }, n.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(S).css("opacity", 0).show().end().animate({opacity: b}, a, c, d) }, animate: function (a, b, c, d) { var e = n.isEmptyObject(a), f = n.speed(b, c, d), g = function () { var b = Xa(this, n.extend({}, a), f); (e || L.get(this, "finish")) && b.stop(!0) }; return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, b, c) { var d = function (a) { var b = a.stop; delete a.stop, b(c) }; return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function () { var b = !0, e = null != a && a + "queueHooks", f = n.timers, g = L.get(this); if (e) g[e] && g[e].stop && d(g[e]); else for (e in g)g[e] && g[e].stop && Pa.test(e) && d(g[e]); for (e = f.length; e--;)f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); (b || !c) && n.dequeue(this, a) }) }, finish: function (a) { return a !== !1 && (a = a || "fx"), this.each(function () { var b, c = L.get(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = n.timers, g = d ? d.length : 0; for (c.finish = !0, n.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;)f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); for (b = 0; g > b; b++)d[b] && d[b].finish && d[b].finish.call(this); delete c.finish }) } }), n.each(["toggle", "show", "hide"], function (a, b) { var c = n.fn[b]; n.fn[b] = function (a, d, e) { return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(Ta(b, !0), a, d, e) } }), n.each({ slideDown: Ta("show"), slideUp: Ta("hide"), slideToggle: Ta("toggle"), fadeIn: {opacity: "show"}, fadeOut: {opacity: "hide"}, fadeToggle: {opacity: "toggle"} }, function (a, b) { n.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), n.timers = [], n.fx.tick = function () { var a, b = 0, c = n.timers; for (La = n.now(); b < c.length; b++)a = c[b], a() || c[b] !== a || c.splice(b--, 1); c.length || n.fx.stop(), La = void 0 }, n.fx.timer = function (a) { n.timers.push(a), a() ? n.fx.start() : n.timers.pop() }, n.fx.interval = 13, n.fx.start = function () { Ma || (Ma = setInterval(n.fx.tick, n.fx.interval)) }, n.fx.stop = function () { clearInterval(Ma), Ma = null }, n.fx.speeds = {slow: 600, fast: 200, _default: 400}, n.fn.delay = function (a, b) { return a = n.fx ? n.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, function () { var a = l.createElement("input"), b = l.createElement("select"), c = b.appendChild(l.createElement("option")); a.type = "checkbox", k.checkOn = "" !== a.value, k.optSelected = c.selected, b.disabled = !0, k.optDisabled = !c.disabled, a = l.createElement("input"), a.value = "t", a.type = "radio", k.radioValue = "t" === a.value }(); var Ya, Za, $a = n.expr.attrHandle; n.fn.extend({ attr: function (a, b) { return J(this, n.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { n.removeAttr(this, a) }) } }), n.extend({ attr: function (a, b, c) { var d, e, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f)return typeof a.getAttribute === U ? n.prop(a, b, c) : (1 === f && n.isXMLDoc(a) || (b = b.toLowerCase(), d = n.attrHooks[b] || (n.expr.match.bool.test(b) ? Za : Ya)), void 0 === c ? d && "get" in d && null !== (e = d.get(a, b)) ? e : (e = n.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && "set" in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""), c) : void n.removeAttr(a, b)) }, removeAttr: function (a, b) { var c, d, e = 0, f = b && b.match(E); if (f && 1 === a.nodeType)while (c = f[e++])d = n.propFix[c] || c, n.expr.match.bool.test(c) && (a[d] = !1), a.removeAttribute(c) }, attrHooks: { type: { set: function (a, b) { if (!k.radioValue && "radio" === b && n.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } } } }), Za = { set: function (a, b, c) { return b === !1 ? n.removeAttr(a, c) : a.setAttribute(c, c), c } }, n.each(n.expr.match.bool.source.match(/\w+/g), function (a, b) { var c = $a[b] || n.find.attr; $a[b] = function (a, b, d) { var e, f; return d || (f = $a[b], $a[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, $a[b] = f), e } }); var _a = /^(?:input|select|textarea|button)$/i; n.fn.extend({ prop: function (a, b) { return J(this, n.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return this.each(function () { delete this[n.propFix[a] || a] }) } }), n.extend({ propFix: {"for": "htmlFor", "class": "className"}, prop: function (a, b, c) { var d, e, f, g = a.nodeType; if (a && 3 !== g && 8 !== g && 2 !== g)return f = 1 !== g || !n.isXMLDoc(a), f && (b = n.propFix[b] || b, e = n.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b] }, propHooks: { tabIndex: { get: function (a) { return a.hasAttribute("tabindex") || _a.test(a.nodeName) || a.href ? a.tabIndex : -1 } } } }), k.optSelected || (n.propHooks.selected = { get: function (a) { var b = a.parentNode; return b && b.parentNode && b.parentNode.selectedIndex, null } }), n.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { n.propFix[this.toLowerCase()] = this }); var ab = /[\t\r\n\f]/g; n.fn.extend({ addClass: function (a) { var b, c, d, e, f, g, h = "string" == typeof a && a, i = 0, j = this.length; if (n.isFunction(a))return this.each(function (b) { n(this).addClass(a.call(this, b, this.className)) }); if (h)for (b = (a || "").match(E) || []; j > i; i++)if (c = this[i], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ab, " ") : " ")) { f = 0; while (e = b[f++])d.indexOf(" " + e + " ") < 0 && (d += e + " "); g = n.trim(d), c.className !== g && (c.className = g) } return this }, removeClass: function (a) { var b, c, d, e, f, g, h = 0 === arguments.length || "string" == typeof a && a, i = 0, j = this.length; if (n.isFunction(a))return this.each(function (b) { n(this).removeClass(a.call(this, b, this.className)) }); if (h)for (b = (a || "").match(E) || []; j > i; i++)if (c = this[i], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ab, " ") : "")) { f = 0; while (e = b[f++])while (d.indexOf(" " + e + " ") >= 0)d = d.replace(" " + e + " ", " "); g = a ? n.trim(d) : "", c.className !== g && (c.className = g) } return this }, toggleClass: function (a, b) { var c = typeof a; return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(n.isFunction(a) ? function (c) { n(this).toggleClass(a.call(this, c, this.className, b), b) } : function () { if ("string" === c) { var b, d = 0, e = n(this), f = a.match(E) || []; while (b = f[d++])e.hasClass(b) ? e.removeClass(b) : e.addClass(b) } else(c === U || "boolean" === c) && (this.className && L.set(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : L.get(this, "__className__") || "") }) }, hasClass: function (a) { for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++)if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(ab, " ").indexOf(b) >= 0)return !0; return !1 } }); var bb = /\r/g; n.fn.extend({ val: function (a) { var b, c, d, e = this[0]; { if (arguments.length)return d = n.isFunction(a), this.each(function (c) { var e; 1 === this.nodeType && (e = d ? a.call(this, c, n(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : n.isArray(e) && (e = n.map(e, function (a) { return null == a ? "" : a + "" })), b = n.valHooks[this.type] || n.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e)) }); if (e)return b = n.valHooks[e.type] || n.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(bb, "") : null == c ? "" : c) } } }), n.extend({ valHooks: { option: { get: function (a) { var b = n.find.attr(a, "value"); return null != b ? b : n.trim(n.text(a)) } }, select: { get: function (a) { for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)if (c = d[i], !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && n.nodeName(c.parentNode, "optgroup"))) { if (b = n(c).val(), f)return b; g.push(b) } return g }, set: function (a, b) { var c, d, e = a.options, f = n.makeArray(b), g = e.length; while (g--)d = e[g], (d.selected = n.inArray(d.value, f) >= 0) && (c = !0); return c || (a.selectedIndex = -1), f } } } }), n.each(["radio", "checkbox"], function () { n.valHooks[this] = { set: function (a, b) { return n.isArray(b) ? a.checked = n.inArray(n(a).val(), b) >= 0 : void 0 } }, k.checkOn || (n.valHooks[this].get = function (a) { return null === a.getAttribute("value") ? "on" : a.value }) }), n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { n.fn[b] = function (a, c) { return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) } }), n.fn.extend({ hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c) } }); var cb = n.now(), db = /\?/; n.parseJSON = function (a) { return JSON.parse(a + "") }, n.parseXML = function (a) { var b, c; if (!a || "string" != typeof a)return null; try { c = new DOMParser, b = c.parseFromString(a, "text/xml") } catch (d) { b = void 0 } return (!b || b.getElementsByTagName("parsererror").length) && n.error("Invalid XML: " + a), b }; var eb = /#.*$/, fb = /([?&])_=[^&]*/, gb = /^(.*?):[ \t]*([^\r\n]*)$/gm, hb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, ib = /^(?:GET|HEAD)$/, jb = /^\/\//, kb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, lb = {}, mb = {}, nb = "*/".concat("*"), ob = a.location.href, pb = kb.exec(ob.toLowerCase()) || []; function qb(a) { return function (b, c) { "string" != typeof b && (c = b, b = "*"); var d, e = 0, f = b.toLowerCase().match(E) || []; if (n.isFunction(c))while (d = f[e++])"+" === d[0] ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) } } function rb(a, b, c, d) { var e = {}, f = a === mb; function g(h) { var i; return e[h] = !0, n.each(a[h] || [], function (a, h) { var j = h(b, c, d); return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) }), i } return g(b.dataTypes[0]) || !e["*"] && g("*") } function sb(a, b) { var c, d, e = n.ajaxSettings.flatOptions || {}; for (c in b)void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]); return d && n.extend(!0, a, d), a } function tb(a, b, c) { var d, e, f, g, h = a.contents, i = a.dataTypes; while ("*" === i[0])i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader("Content-Type")); if (d)for (e in h)if (h[e] && h[e].test(d)) { i.unshift(e); break } if (i[0] in c) f = i[0]; else { for (e in c) { if (!i[0] || a.converters[e + " " + i[0]]) { f = e; break } g || (g = e) } f = f || g } return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0 } function ub(a, b, c, d) { var e, f, g, h, i, j = {}, k = a.dataTypes.slice(); if (k[1])for (g in a.converters)j[g.toLowerCase()] = a.converters[g]; f = k.shift(); while (f)if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift())if ("*" === f) f = i; else if ("*" !== i && i !== f) { if (g = j[i + " " + f] || j["* " + f], !g)for (e in j)if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) { g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); break } if (g !== !0)if (g && a["throws"]) b = g(b); else try { b = g(b) } catch (l) { return {state: "parsererror", error: g ? l : "No conversion from " + i + " to " + f} } } return {state: "success", data: b} } n.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: ob, type: "GET", isLocal: hb.test(pb[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": nb, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: {xml: /xml/, html: /html/, json: /json/}, responseFields: {xml: "responseXML", text: "responseText", json: "responseJSON"}, converters: {"* text": String, "text html": !0, "text json": n.parseJSON, "text xml": n.parseXML}, flatOptions: {url: !0, context: !0} }, ajaxSetup: function (a, b) { return b ? sb(sb(a, n.ajaxSettings), b) : sb(n.ajaxSettings, a) }, ajaxPrefilter: qb(lb), ajaxTransport: qb(mb), ajax: function (a, b) { "object" == typeof a && (b = a, a = void 0), b = b || {}; var c, d, e, f, g, h, i, j, k = n.ajaxSetup({}, b), l = k.context || k, m = k.context && (l.nodeType || l.jquery) ? n(l) : n.event, o = n.Deferred(), p = n.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = { readyState: 0, getResponseHeader: function (a) { var b; if (2 === t) { if (!f) { f = {}; while (b = gb.exec(e))f[b[1].toLowerCase()] = b[2] } b = f[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === t ? e : null }, setRequestHeader: function (a, b) { var c = a.toLowerCase(); return t || (a = s[c] = s[c] || a, r[a] = b), this }, overrideMimeType: function (a) { return t || (k.mimeType = a), this }, statusCode: function (a) { var b; if (a)if (2 > t)for (b in a)q[b] = [q[b], a[b]]; else v.always(a[v.status]); return this }, abort: function (a) { var b = a || u; return c && c.abort(b), x(0, b), this } }; if (o.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || ob) + "").replace(eb, "").replace(jb, pb[1] + "//"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = n.trim(k.dataType || "*").toLowerCase().match(E) || [""], null == k.crossDomain && (h = kb.exec(k.url.toLowerCase()), k.crossDomain = !(!h || h[1] === pb[1] && h[2] === pb[2] && (h[3] || ("http:" === h[1] ? "80" : "443")) === (pb[3] || ("http:" === pb[1] ? "80" : "443")))), k.data && k.processData && "string" != typeof k.data && (k.data = n.param(k.data, k.traditional)), rb(lb, k, b, v), 2 === t)return v; i = n.event && k.global, i && 0 === n.active++ && n.event.trigger("ajaxStart"), k.type = k.type.toUpperCase(), k.hasContent = !ib.test(k.type), d = k.url, k.hasContent || (k.data && (d = k.url += (db.test(d) ? "&" : "?") + k.data, delete k.data), k.cache === !1 && (k.url = fb.test(d) ? d.replace(fb, "$1_=" + cb++) : d + (db.test(d) ? "&" : "?") + "_=" + cb++)), k.ifModified && (n.lastModified[d] && v.setRequestHeader("If-Modified-Since", n.lastModified[d]), n.etag[d] && v.setRequestHeader("If-None-Match", n.etag[d])), (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType), v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + nb + "; q=0.01" : "") : k.accepts["*"]); for (j in k.headers)v.setRequestHeader(j, k.headers[j]); if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t))return v.abort(); u = "abort"; for (j in{success: 1, error: 1, complete: 1})v[j](k[j]); if (c = rb(mb, k, b, v)) { v.readyState = 1, i && m.trigger("ajaxSend", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function () { v.abort("timeout") }, k.timeout)); try { t = 1, c.send(r, x) } catch (w) { if (!(2 > t))throw w; x(-1, w) } } else x(-1, "No Transport"); function x(a, b, f, h) { var j, r, s, u, w, x = b; 2 !== t && (t = 2, g && clearTimeout(g), c = void 0, e = h || "", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, f && (u = tb(k, v, f)), u = ub(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"), w && (n.lastModified[d] = w), w = v.getResponseHeader("etag"), w && (n.etag[d] = w)), 204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state, r = u.data, s = u.error, j = !s)) : (s = x, (a || !x) && (x = "error", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + "", j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, i && m.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]), p.fireWith(l, [v, x]), i && (m.trigger("ajaxComplete", [v, k]), --n.active || n.event.trigger("ajaxStop"))) } return v }, getJSON: function (a, b, c) { return n.get(a, b, c, "json") }, getScript: function (a, b) { return n.get(a, void 0, b, "script") } }), n.each(["get", "post"], function (a, b) { n[b] = function (a, c, d, e) { return n.isFunction(c) && (e = e || d, d = c, c = void 0), n.ajax({ url: a, type: b, dataType: e, data: c, success: d }) } }), n._evalUrl = function (a) { return n.ajax({url: a, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0}) }, n.fn.extend({ wrapAll: function (a) { var b; return n.isFunction(a) ? this.each(function (b) { n(this).wrapAll(a.call(this, b)) }) : (this[0] && (b = n(a, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstElementChild)a = a.firstElementChild; return a }).append(this)), this) }, wrapInner: function (a) { return this.each(n.isFunction(a) ? function (b) { n(this).wrapInner(a.call(this, b)) } : function () { var b = n(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = n.isFunction(a); return this.each(function (c) { n(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { n.nodeName(this, "body") || n(this).replaceWith(this.childNodes) }).end() } }), n.expr.filters.hidden = function (a) { return a.offsetWidth <= 0 && a.offsetHeight <= 0 }, n.expr.filters.visible = function (a) { return !n.expr.filters.hidden(a) }; var vb = /%20/g, wb = /\[\]$/, xb = /\r?\n/g, yb = /^(?:submit|button|image|reset|file)$/i, zb = /^(?:input|select|textarea|keygen)/i; function Ab(a, b, c, d) { var e; if (n.isArray(b)) n.each(b, function (b, e) { c || wb.test(a) ? d(a, e) : Ab(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d) }); else if (c || "object" !== n.type(b)) d(a, b); else for (e in b)Ab(a + "[" + e + "]", b[e], c, d) } n.param = function (a, b) { var c, d = [], e = function (a, b) { b = n.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (void 0 === b && (b = n.ajaxSettings && n.ajaxSettings.traditional), n.isArray(a) || a.jquery && !n.isPlainObject(a)) n.each(a, function () { e(this.name, this.value) }); else for (c in a)Ab(c, a[c], b, e); return d.join("&").replace(vb, "+") }, n.fn.extend({ serialize: function () { return n.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var a = n.prop(this, "elements"); return a ? n.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !n(this).is(":disabled") && zb.test(this.nodeName) && !yb.test(a) && (this.checked || !T.test(a)) }).map(function (a, b) { var c = n(this).val(); return null == c ? null : n.isArray(c) ? n.map(c, function (a) { return {name: b.name, value: a.replace(xb, "\r\n")} }) : {name: b.name, value: c.replace(xb, "\r\n")} }).get() } }), n.ajaxSettings.xhr = function () { try { return new XMLHttpRequest } catch (a) { } }; var Bb = 0, Cb = {}, Db = {0: 200, 1223: 204}, Eb = n.ajaxSettings.xhr(); a.attachEvent && a.attachEvent("onunload", function () { for (var a in Cb)Cb[a]() }), k.cors = !!Eb && "withCredentials" in Eb, k.ajax = Eb = !!Eb, n.ajaxTransport(function (a) { var b; return k.cors || Eb && !a.crossDomain ? { send: function (c, d) { var e, f = a.xhr(), g = ++Bb; if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields)for (e in a.xhrFields)f[e] = a.xhrFields[e]; a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest"); for (e in c)f.setRequestHeader(e, c[e]); b = function (a) { return function () { b && (delete Cb[g], b = f.onload = f.onerror = null, "abort" === a ? f.abort() : "error" === a ? d(f.status, f.statusText) : d(Db[f.status] || f.status, f.statusText, "string" == typeof f.responseText ? {text: f.responseText} : void 0, f.getAllResponseHeaders())) } }, f.onload = b(), f.onerror = b("error"), b = Cb[g] = b("abort"); try { f.send(a.hasContent && a.data || null) } catch (h) { if (b)throw h } }, abort: function () { b && b() } } : void 0 }), n.ajaxSetup({ accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"}, contents: {script: /(?:java|ecma)script/}, converters: { "text script": function (a) { return n.globalEval(a), a } } }), n.ajaxPrefilter("script", function (a) { void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET") }), n.ajaxTransport("script", function (a) { if (a.crossDomain) { var b, c; return { send: function (d, e) { b = n("<script>").prop({ async: !0, charset: a.scriptCharset, src: a.url }).on("load error", c = function (a) { b.remove(), c = null, a && e("error" === a.type ? 404 : 200, a.type) }), l.head.appendChild(b[0]) }, abort: function () { c && c() } } } }); var Fb = [], Gb = /(=)\?(?=&|$)|\?\?/; n.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = Fb.pop() || n.expando + "_" + cb++; return this[a] = !0, a } }), n.ajaxPrefilter("json jsonp", function (b, c, d) { var e, f, g, h = b.jsonp !== !1 && (Gb.test(b.url) ? "url" : "string" == typeof b.data && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && Gb.test(b.data) && "data"); return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = n.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(Gb, "$1" + e) : b.jsonp !== !1 && (b.url += (db.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () { return g || n.error(e + " was not called"), g[0] }, b.dataTypes[0] = "json", f = a[e], a[e] = function () { g = arguments }, d.always(function () { a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, Fb.push(e)), g && n.isFunction(f) && f(g[0]), g = f = void 0 }), "script") : void 0 }), n.parseHTML = function (a, b, c) { if (!a || "string" != typeof a)return null; "boolean" == typeof b && (c = b, b = !1), b = b || l; var d = v.exec(a), e = !c && []; return d ? [b.createElement(d[1])] : (d = n.buildFragment([a], b, e), e && e.length && n(e).remove(), n.merge([], d.childNodes)) }; var Hb = n.fn.load; n.fn.load = function (a, b, c) { if ("string" != typeof a && Hb)return Hb.apply(this, arguments); var d, e, f, g = this, h = a.indexOf(" "); return h >= 0 && (d = n.trim(a.slice(h)), a = a.slice(0, h)), n.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (e = "POST"), g.length > 0 && n.ajax({ url: a, type: e, dataType: "html", data: b }).done(function (a) { f = arguments, g.html(d ? n("<div>").append(n.parseHTML(a)).find(d) : a) }).complete(c && function (a, b) { g.each(c, f || [a.responseText, b, a]) }), this }, n.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) { n.fn[b] = function (a) { return this.on(b, a) } }), n.expr.filters.animated = function (a) { return n.grep(n.timers, function (b) { return a === b.elem }).length }; var Ib = a.document.documentElement; function Jb(a) { return n.isWindow(a) ? a : 9 === a.nodeType && a.defaultView } n.offset = { setOffset: function (a, b, c) { var d, e, f, g, h, i, j, k = n.css(a, "position"), l = n(a), m = {}; "static" === k && (a.style.position = "relative"), h = l.offset(), f = n.css(a, "top"), i = n.css(a, "left"), j = ("absolute" === k || "fixed" === k) && (f + i).indexOf("auto") > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), n.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), "using" in b ? b.using.call(a, m) : l.css(m) } }, n.fn.extend({ offset: function (a) { if (arguments.length)return void 0 === a ? this : this.each(function (b) { n.offset.setOffset(this, a, b) }); var b, c, d = this[0], e = {top: 0, left: 0}, f = d && d.ownerDocument; if (f)return b = f.documentElement, n.contains(b, d) ? (typeof d.getBoundingClientRect !== U && (e = d.getBoundingClientRect()), c = Jb(f), { top: e.top + c.pageYOffset - b.clientTop, left: e.left + c.pageXOffset - b.clientLeft }) : e }, position: function () { if (this[0]) { var a, b, c = this[0], d = {top: 0, left: 0}; return "fixed" === n.css(c, "position") ? b = c.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), n.nodeName(a[0], "html") || (d = a.offset()), d.top += n.css(a[0], "borderTopWidth", !0), d.left += n.css(a[0], "borderLeftWidth", !0)), { top: b.top - d.top - n.css(c, "marginTop", !0), left: b.left - d.left - n.css(c, "marginLeft", !0) } } }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || Ib; while (a && !n.nodeName(a, "html") && "static" === n.css(a, "position"))a = a.offsetParent; return a || Ib }) } }), n.each({scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function (b, c) { var d = "pageYOffset" === c; n.fn[b] = function (e) { return J(this, function (b, e, f) { var g = Jb(b); return void 0 === f ? g ? g[c] : b[e] : void(g ? g.scrollTo(d ? a.pageXOffset : f, d ? f : a.pageYOffset) : b[e] = f) }, b, e, arguments.length, null) } }), n.each(["top", "left"], function (a, b) { n.cssHooks[b] = ya(k.pixelPosition, function (a, c) { return c ? (c = xa(a, b), va.test(c) ? n(a).position()[b] + "px" : c) : void 0 }) }), n.each({Height: "height", Width: "width"}, function (a, b) { n.each({padding: "inner" + a, content: b, "": "outer" + a}, function (c, d) { n.fn[d] = function (d, e) { var f = arguments.length && (c || "boolean" != typeof d), g = c || (d === !0 || e === !0 ? "margin" : "border"); return J(this, function (b, c, d) { var e; return n.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? n.css(b, c, g) : n.style(b, c, d, g) }, b, f ? d : void 0, f, null) } }) }), n.fn.size = function () { return this.length }, n.fn.andSelf = n.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function () { return n }); var Kb = a.jQuery, Lb = a.$; return n.noConflict = function (b) { return a.$ === n && (a.$ = Lb), b && a.jQuery === n && (a.jQuery = Kb), n }, typeof b === U && (a.jQuery = a.$ = n), n }); //# sourceMappingURL=jquery.min.map
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (factory(global.jQuery)); }(this, (function ($) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; /** * @author Mudit Ameta * @license https://github.com/zeusdeux/isInViewport/blob/master/license.md MIT */ // expose isInViewport as a custom pseudo-selector $.extend($.expr.pseudos || $.expr[':'], { // if $.expr.createPseudo is available, use it 'in-viewport': $.expr.createPseudo ? $.expr.createPseudo(function (argsString) { return function (currElement) { return isInViewport(currElement, getSelectorArgs(argsString)); }; }) : function (currObj, index, meta) { return isInViewport(currObj, getSelectorArgs(meta[3])); } }); // expose isInViewport as a function too // this lets folks pass around actual objects as options (like custom viewport) // and doesn't tie 'em down to strings. It also prevents isInViewport from // having to look up and wrap the dom element corresponding to the viewport selector $.fn.isInViewport = function(options) { return this.filter(function (i, el) { return isInViewport(el, options); }) }; $.fn.run = run; // lets you chain any arbitrary function or an array of functions and returns a jquery object function run(args) { var this$1 = this; if (arguments.length === 1 && typeof args === 'function') { args = [args]; } if (!(args instanceof Array)) { throw new SyntaxError('isInViewport: Argument(s) passed to .do/.run should be a function or an array of functions') } args.forEach(function (arg) { if (typeof arg !== 'function') { console.warn('isInViewport: Argument(s) passed to .do/.run should be a function or an array of functions'); console.warn('isInViewport: Ignoring non-function values in array and moving on'); } else { [].slice.call(this$1).forEach(function (t) { return arg.call($(t)); }); } }); return this } // gets the width of the scrollbar function getScrollbarWidth(viewport) { // append a div that has 100% width to get true width of viewport var el = $('<div></div>').css({ width: '100%' }); viewport.append(el); // subtract true width from the viewport width which is inclusive // of scrollbar by default var scrollBarWidth = viewport.width() - el.width(); // remove our element from DOM el.remove(); return scrollBarWidth } // Returns true if DOM element `element` is in viewport function isInViewport(element, options) { var ref = element.getBoundingClientRect(); var top = ref.top; var bottom = ref.bottom; var left = ref.left; var right = ref.right; var settings = $.extend({ tolerance: 0, viewport: window }, options); var isVisibleFlag = false; var $viewport = settings.viewport.jquery ? settings.viewport : $(settings.viewport); if (!$viewport.length) { console.warn('isInViewport: The viewport selector you have provided matches no element on page.'); console.warn('isInViewport: Defaulting to viewport as window'); $viewport = $(window); } var $viewportHeight = $viewport.height(); var $viewportWidth = $viewport.width(); var typeofViewport = $viewport[0].toString(); // if the viewport is other than window recalculate the top, // bottom,left and right wrt the new viewport // the [object DOMWindow] check is for window object type in PhantomJS if ($viewport[0] !== window && typeofViewport !== '[object Window]' && typeofViewport !== '[object DOMWindow]') { // use getBoundingClientRect() instead of $.Offset() // since the original top/bottom positions are calculated relative to browser viewport and not document var viewportRect = $viewport[0].getBoundingClientRect(); // recalculate these relative to viewport top = top - viewportRect.top; bottom = bottom - viewportRect.top; left = left - viewportRect.left; right = right - viewportRect.left; // get the scrollbar width from cache or calculate it isInViewport.scrollBarWidth = isInViewport.scrollBarWidth || getScrollbarWidth($viewport); // remove the width of the scrollbar from the viewport width $viewportWidth -= isInViewport.scrollBarWidth; } // handle falsy, non-number and non-integer tolerance value // same as checking using isNaN and then setting to 0 // bitwise operators deserve some love too you know settings.tolerance = ~~Math.round(parseFloat(settings.tolerance)); if (settings.tolerance < 0) { settings.tolerance = $viewportHeight + settings.tolerance; // viewport height - tol } // the element is NOT in viewport iff it is completely out of // viewport laterally or if it is completely out of the tolerance // region. Therefore, if it is partially in view then it is considered // to be in the viewport and hence true is returned. Because we have adjusted // the left/right positions relative to the viewport, we should check the // element's right against the viewport's 0 (left side), and the element's // left against the viewport's width to see if it is outside of the viewport. if (right <= 0 || left >= $viewportWidth) { return isVisibleFlag } // if the element is bound to some tolerance isVisibleFlag = settings.tolerance ? top <= settings.tolerance && bottom >= settings.tolerance : bottom > 0 && top <= $viewportHeight; return isVisibleFlag } // get the selector args from the args string proved by Sizzle function getSelectorArgs(argsString) { if (argsString) { var args = argsString.split(','); // when user only gives viewport and no tolerance if (args.length === 1 && isNaN(args[0])) { args[1] = args[0]; args[0] = void 0; } return { tolerance: args[0] ? args[0].trim() : void 0, viewport: args[1] ? $(args[1].trim()) : void 0 } } return {} } }))); //# sourceMappingURL=isInViewport.js.map
"use strict" exports.__esModule = true; exports.TorahIconConfig = { name: 'TorahIcon', height: 512, width: 640, svgPath: 'M320.05 366.48l17.72-29.64h-35.46zm99.21-166H382.4l18.46 30.82zM48 0C21.49 0 0 14.33 0 32v448c0 17.67 21.49 32 48 32s48-14.33 48-32V32C96 14.33 74.51 0 48 0zm172.74 311.5h36.85l-18.46-30.82zm161.71 0h36.86l-18.45-30.8zM128 464h384V48H128zm66.77-278.13a21.22 21.22 0 0 1 18.48-10.71h59.45l29.13-48.71a21.13 21.13 0 0 1 18.22-10.37A20.76 20.76 0 0 1 338 126.29l29.25 48.86h59.52a21.12 21.12 0 0 1 18.1 32L415.63 256 445 305a20.69 20.69 0 0 1 .24 21.12 21.25 21.25 0 0 1-18.48 10.72h-59.47l-29.13 48.7a21.13 21.13 0 0 1-18.16 10.4 20.79 20.79 0 0 1-18-10.22l-29.25-48.88h-59.5a21.11 21.11 0 0 1-18.1-32L224.36 256 195 207a20.7 20.7 0 0 1-.23-21.13zM592 0c-26.51 0-48 14.33-48 32v448c0 17.67 21.49 32 48 32s48-14.33 48-32V32c0-17.67-21.49-32-48-32zM320 145.53l-17.78 29.62h35.46zm-62.45 55h-36.81l18.44 30.8zm29.58 111h65.79L386.09 256l-33.23-55.52h-65.79L253.9 256z', yOffset: 0, xOffset: 0, transform: '' }; exports.TorahIcon = require('../createIcon').createIcon(exports.TorahIconConfig); exports["default"] = exports.TorahIcon;
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.default = exports.test = exports.serialize = void 0; var _collections = require('../collections'); /** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // SENTINEL constants are from https://github.com/facebook/immutable-js const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; const IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; const IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4 const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; const IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; const getImmutableName = name => 'Immutable.' + name; const printAsLeaf = name => '[' + name + ']'; const SPACE = ' '; const LAZY = '…'; // Seq is lazy if it calls a method like filter const printImmutableEntries = ( val, config, indentation, depth, refs, printer, type ) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '{' + (0, _collections.printIteratorEntries)( val.entries(), config, indentation, depth, refs, printer ) + '}'; // Record has an entries method because it is a collection in immutable v3. // Return an iterator for Immutable Record from version v3 or v4. const getRecordEntries = val => { let i = 0; return { next() { if (i < val._keys.length) { const key = val._keys[i++]; return { done: false, value: [key, val.get(key)] }; } return { done: true }; } }; }; const printImmutableRecord = ( val, config, indentation, depth, refs, printer ) => { // _name property is defined only for an Immutable Record instance // which was constructed with a second optional descriptive name arg const name = getImmutableName(val._name || 'Record'); return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE + '{' + (0, _collections.printIteratorEntries)( getRecordEntries(val), config, indentation, depth, refs, printer ) + '}'; }; const printImmutableSeq = (val, config, indentation, depth, refs, printer) => { const name = getImmutableName('Seq'); if (++depth > config.maxDepth) { return printAsLeaf(name); } if (val[IS_KEYED_SENTINEL]) { return ( name + SPACE + '{' + // from Immutable collection of entries or from ECMAScript object (val._iter || val._object ? (0, _collections.printIteratorEntries)( val.entries(), config, indentation, depth, refs, printer ) : LAZY) + '}' ); } return ( name + SPACE + '[' + (val._iter || // from Immutable collection of values val._array || // from ECMAScript array val._collection || // from ECMAScript collection in immutable v4 val._iterable // from ECMAScript collection in immutable v3 ? (0, _collections.printIteratorValues)( val.values(), config, indentation, depth, refs, printer ) : LAZY) + ']' ); }; const printImmutableValues = ( val, config, indentation, depth, refs, printer, type ) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '[' + (0, _collections.printIteratorValues)( val.values(), config, indentation, depth, refs, printer ) + ']'; const serialize = (val, config, indentation, depth, refs, printer) => { if (val[IS_MAP_SENTINEL]) { return printImmutableEntries( val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map' ); } if (val[IS_LIST_SENTINEL]) { return printImmutableValues( val, config, indentation, depth, refs, printer, 'List' ); } if (val[IS_SET_SENTINEL]) { return printImmutableValues( val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set' ); } if (val[IS_STACK_SENTINEL]) { return printImmutableValues( val, config, indentation, depth, refs, printer, 'Stack' ); } if (val[IS_SEQ_SENTINEL]) { return printImmutableSeq(val, config, indentation, depth, refs, printer); } // For compatibility with immutable v3 and v4, let record be the default. return printImmutableRecord(val, config, indentation, depth, refs, printer); }; // Explicitly comparing sentinel properties to true avoids false positive // when mock identity-obj-proxy returns the key as the value for any key. exports.serialize = serialize; const test = val => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true); exports.test = test; const plugin = { serialize, test }; var _default = plugin; exports.default = _default;
'use strict'; const server = require('browser-sync').create(); server.init({ server: './www', files: [ './www/**/*.html', './www/**/*.css', './www/**/*.js', './www/**/*.png', './www/**/*.svg' ], notify: false }); server.reload();
define({ 'UserView': 'User View', 'AdminView': 'Admin View', 'Logout': 'Logout', 'Norwegian': 'Norsk', 'English': 'English' });
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ // This icon file is generated by build/generate.ts // tslint:disable /** @type {?} */ export var ReconciliationTwoTone = { name: 'reconciliation', theme: 'twotone', icon: '<svg viewBox="64 64 896 896"><path fill="#D9D9D9" d="M740 344H404V240H304v160h176c17.7 0 32 14.3 32 32v360h328V240H740v104zM584 448c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-56zm92 301c-50.8 0-92-41.2-92-92s41.2-92 92-92 92 41.2 92 92-41.2 92-92 92zm92-341v96c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-96c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8z"/><path fill="#D9D9D9" d="M642 657a34 34 0 1 0 68 0 34 34 0 1 0-68 0z"/><path d="M592 512h48c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm112-104v96c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-96c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8z"/><path d="M880 168H668c0-30.9-25.1-56-56-56h-80c-30.9 0-56 25.1-56 56H264c-17.7 0-32 14.3-32 32v200h-88c-17.7 0-32 14.3-32 32v448c0 17.7 14.3 32 32 32h336c17.7 0 32-14.3 32-32v-16h368c17.7 0 32-14.3 32-32V200c0-17.7-14.3-32-32-32zm-412 64h72v-56h64v56h72v48H468v-48zm-20 616H176V616h272v232zm0-296H176v-88h272v88zm392 240H512V432c0-17.7-14.3-32-32-32H304V240h100v104h336V240h100v552z"/><path d="M676 565c-50.8 0-92 41.2-92 92s41.2 92 92 92 92-41.2 92-92-41.2-92-92-92zm0 126c-18.8 0-34-15.2-34-34s15.2-34 34-34 34 15.2 34 34-15.2 34-34 34z"/></svg>' }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb25jaWxpYXRpb25Ud29Ub25lLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFudC1kZXNpZ24vaWNvbnMtYW5ndWxhci9pY29ucy8iLCJzb3VyY2VzIjpbInR3b3RvbmUvUmVjb25jaWxpYXRpb25Ud29Ub25lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFLQSxNQUFNLEtBQU8scUJBQXFCLEdBQW1CO0lBQ25ELElBQUksRUFBRSxnQkFBZ0I7SUFDdEIsS0FBSyxFQUFFLFNBQVM7SUFDaEIsSUFBSSxFQUNGLDRwQ0FBNHBDO0NBQy9wQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRoaXMgaWNvbiBmaWxlIGlzIGdlbmVyYXRlZCBieSBidWlsZC9nZW5lcmF0ZS50c1xuLy8gdHNsaW50OmRpc2FibGVcblxuaW1wb3J0IHsgSWNvbkRlZmluaXRpb24gfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBSZWNvbmNpbGlhdGlvblR3b1RvbmU6IEljb25EZWZpbml0aW9uID0ge1xuICBuYW1lOiAncmVjb25jaWxpYXRpb24nLFxuICB0aGVtZTogJ3R3b3RvbmUnLFxuICBpY29uOlxuICAgICc8c3ZnIHZpZXdCb3g9XCI2NCA2NCA4OTYgODk2XCI+PHBhdGggZmlsbD1cIiNEOUQ5RDlcIiBkPVwiTTc0MCAzNDRINDA0VjI0MEgzMDR2MTYwaDE3NmMxNy43IDAgMzIgMTQuMyAzMiAzMnYzNjBoMzI4VjI0MEg3NDB2MTA0ek01ODQgNDQ4YzAtNC40IDMuNi04IDgtOGg0OGM0LjQgMCA4IDMuNiA4IDh2NTZjMCA0LjQtMy42IDgtOCA4aC00OGMtNC40IDAtOC0zLjYtOC04di01NnptOTIgMzAxYy01MC44IDAtOTItNDEuMi05Mi05MnM0MS4yLTkyIDkyLTkyIDkyIDQxLjIgOTIgOTItNDEuMiA5Mi05MiA5MnptOTItMzQxdjk2YzAgNC40LTMuNiA4LTggOGgtNDhjLTQuNCAwLTgtMy42LTgtOHYtOTZjMC00LjQgMy42LTggOC04aDQ4YzQuNCAwIDggMy42IDggOHpcIi8+PHBhdGggZmlsbD1cIiNEOUQ5RDlcIiBkPVwiTTY0MiA2NTdhMzQgMzQgMCAxIDAgNjggMCAzNCAzNCAwIDEgMC02OCAwelwiLz48cGF0aCBkPVwiTTU5MiA1MTJoNDhjNC40IDAgOC0zLjYgOC04di01NmMwLTQuNC0zLjYtOC04LThoLTQ4Yy00LjQgMC04IDMuNi04IDh2NTZjMCA0LjQgMy42IDggOCA4em0xMTItMTA0djk2YzAgNC40IDMuNiA4IDggOGg0OGM0LjQgMCA4LTMuNiA4LTh2LTk2YzAtNC40LTMuNi04LTgtOGgtNDhjLTQuNCAwLTggMy42LTggOHpcIi8+PHBhdGggZD1cIk04ODAgMTY4SDY2OGMwLTMwLjktMjUuMS01Ni01Ni01NmgtODBjLTMwLjkgMC01NiAyNS4xLTU2IDU2SDI2NGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2MjAwaC04OGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJ2NDQ4YzAgMTcuNyAxNC4zIDMyIDMyIDMyaDMzNmMxNy43IDAgMzItMTQuMyAzMi0zMnYtMTZoMzY4YzE3LjcgMCAzMi0xNC4zIDMyLTMyVjIwMGMwLTE3LjctMTQuMy0zMi0zMi0zMnptLTQxMiA2NGg3MnYtNTZoNjR2NTZoNzJ2NDhINDY4di00OHptLTIwIDYxNkgxNzZWNjE2aDI3MnYyMzJ6bTAtMjk2SDE3NnYtODhoMjcydjg4em0zOTIgMjQwSDUxMlY0MzJjMC0xNy43LTE0LjMtMzItMzItMzJIMzA0VjI0MGgxMDB2MTA0aDMzNlYyNDBoMTAwdjU1MnpcIi8+PHBhdGggZD1cIk02NzYgNTY1Yy01MC44IDAtOTIgNDEuMi05MiA5MnM0MS4yIDkyIDkyIDkyIDkyLTQxLjIgOTItOTItNDEuMi05Mi05Mi05MnptMCAxMjZjLTE4LjggMC0zNC0xNS4yLTM0LTM0czE1LjItMzQgMzQtMzQgMzQgMTUuMiAzNCAzNC0xNS4yIDM0LTM0IDM0elwiLz48L3N2Zz4nXG59O1xuIl19
# ============================================================================ # FILE: sorter_rank.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ from .base import Base class Filter(Base): def __init__(self, vim): super().__init__(vim) self.name = 'sorter_rank' self.description = 'rank sorter' def filter(self, context): rank = context['vars']['deoplete#_rank'] complete_str = context['complete_str'].lower() input_len = len(complete_str) return sorted(context['candidates'], key=lambda x: -1 * rank[x['word']] if x['word'] in rank else abs(x['word'].lower().find( complete_str, 0, input_len)))
const AbstractMutation = require("../../Abstract/Mutation.js"); /** * A single mutation record, indication a value change */ class ValueMutation extends AbstractMutation { /** * Apply the mutation to the target, changing the value for given key */ apply() { this.target[this.key] = this.value; } /** * Represent the mutation as a string */ toString() { const string = super.toString(); const { value } = this; return `${string} = ${value}`; } /** * Represent the mutation as a JSONable object */ toJSON() { const json = super.toJSON(); const { value } = this; return { ...json, value }; } } module.exports = ValueMutation;
const firstName = 'William'; const lastName = 'Johnson'; const age = 37; const str = 'Hello there my name is Kyle'; const tags = 'Web design, Web development, Programming' // console.log(firstName, lastName); let val; val = firstName + lastName; // Appending (using +=) val = 'Kyle '; val += 'Denman'; // Concatenation val = firstName + ' ' + lastName; val = 'Hello, my name is ' + firstName + ' and I am ' + age; // Escaping (using [\] instead of single and double quotes to continue a string) val = 'That\'s awesome, I can\'t wait!'; // .length val = firstName.length; // .concat val = firstName.concat(' ', lastName); // Change case val = firstName.toLowerCase(); val = firstName.toUpperCase(); val = firstName[1]; // indexOf() val = firstName.indexOf('l'); // finds first occurence of the letter "l" val = firstName.lastIndexOf('l'); // finds the last occurence of the duplcate letter "l" // charAt() val = firstName.charAt('2'); // Get last character val = firstName.charAt(firstName.length -1); // substring() val = firstName.substring(0, 4); // slice() val = firstName.slice(0, 4); val = firstName.slice(-3); // split() val = str.split(' '); val = tags.split(', '); // replace() val = str.replace('Kyle', 'Brad'); // includes() val = str.includes('Hello'); console.log(val);
"use strict"; $(function () {}); //# sourceMappingURL=app.js.map
module.exports = { siteMetadata: { title: `Is This Essential?`, description: `Check to see what stores are open.`, author: `@gatsbyjs`, }, plugins: [ `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-filesystem`, options: { name: `images`, path: `${__dirname}/src/images`, }, }, `gatsby-transformer-sharp`, `gatsby-plugin-sharp`, { resolve: `gatsby-plugin-manifest`, options: { name: `gatsby-starter-default`, short_name: `starter`, start_url: `/`, background_color: `#663399`, theme_color: `#663399`, display: `minimal-ui`, icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site. }, }, 'gatsby-plugin-emotion', // this (optional) plugin enables Progressive Web App + Offline functionality // To learn more, visit: https://gatsby.app/offline // 'gatsby-plugin-offline', ], };
from django import forms from django.utils.translation import gettext_lazy as _ from .models import Project, Category, ProjectImage class ProjectForm(forms.ModelForm): category = forms.ModelChoiceField(Category.objects.filter(parent=None), label=_('category')) subcategory = forms.ChoiceField(label=_('subcategory')) new_subcategory = forms.CharField(required=False, label=_('new subcategory')) field_order = ( 'name', 'category', 'subcategory', 'new_subcategory', 'manufacturer', 'typ', 'description', 'visibility', ) def __init__(self, *args, **kwargs): super(ProjectForm, self).__init__(*args, **kwargs) self.fields['subcategory'].choices = self.get_subcategory_choices() def get_subcategory_choices(self): choices = [(None, '---------')] choices += [(0, 'new subcategory')] category = self.data.get('category', False) if not category and self.instance and hasattr(self.instance, 'category'): category = self.instance.category if category: subcategories = Category.objects.allDescandends(parent=category) subcategories = subcategories.order_by('id') choices += [(c.id, c.name) for c in subcategories] return choices def clan_new_subcategory(self): category = self.cleaned_data['category'] subcategory = self.data.get('subcategory', '0') if not subcategory == '0': return None new_subcategory = self.cleaned_data.get( 'new_subcategory', self.data.get('new_subcategory', None) ) if not new_subcategory: raise forms.ValidationError( 'Required', code='required' ) try: new_category = Category.objects.get(name=new_subcategory, parent=category) except Category.DoesNotExist: new_category = Category(name=new_subcategory, parent=category) new_category.save() return new_category def clean_subcategory(self): subcategory = self.cleaned_data['subcategory'] if subcategory == '0': return self.clan_new_subcategory() try: data = Category.objects.get(id=subcategory) except Category.DoesNotExist: raise forms.ValidationError('foo') return data class Meta: """ Meta informations. """ model = Project fields = ( 'name', 'category', 'subcategory', 'manufacturer', 'typ', 'description', 'visibility', ) class ProjectImageForm(forms.ModelForm): class Meta: model = ProjectImage fields = ['path'] ProjectImageCreateFormSet = forms.inlineformset_factory( Project, ProjectImage, fk_name='project', form=ProjectImageForm, extra=3, max_num=3, fields=('path',), can_delete=False, ) ProjectImageFormSet = forms.inlineformset_factory( Project, ProjectImage, fk_name='project', form=ProjectImageForm, extra=3, max_num=3, fields=('path',) )
class Weather { isStormy() { return Math.random(10) > 8 }; };
/* global describe it expect */ import { getAccessTokenFromRequest, errorTypes, setAccessTokenToResponse, removeCookies } from './getSetAccessToken'; import { mockReq, mockRes } from 'sinon-express-mock'; import jwt from 'jsonwebtoken'; describe('getSetAccessToken', () => { const validJWTSecret = 'this is a super secret string'; const invalidJWTSecret = 'This is not correct secret'; const now = new Date(Date.now()); const theBeginningOfTime = new Date(0); const accessToken = { id: '123abc', userId: '456def', ttl: 60000, created: now }; describe('getAccessTokenFromRequest', () => { it('return `no token` error if no token is found', () => { const req = mockReq({ headers: {}, cookie: {} }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toEqual(errorTypes.noTokenFound); }); describe('cookies', () => { it('returns `invalid token` error for malformed tokens', () => { const invalidJWT = jwt.sign({ accessToken }, invalidJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ cookie: { jwt_access_token: invalidJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toEqual(errorTypes.invalidToken); }); it('returns `expired token` error for expired tokens', () => { const invalidJWT = jwt.sign( { accessToken: { ...accessToken, created: theBeginningOfTime } }, validJWTSecret ); // eslint-disable-next-line camelcase const req = mockReq({ cookie: { jwt_access_token: invalidJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toEqual(errorTypes.expiredToken); }); it('returns a valid access token with no errors ', () => { expect.assertions(2); const validJWT = jwt.sign({ accessToken }, validJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ cookie: { jwt_access_token: validJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toBeFalsy(); expect(result.accessToken).toEqual({ ...accessToken, created: accessToken.created.toISOString() }); }); it('returns the signed jwt if found', () => { const validJWT = jwt.sign({ accessToken }, validJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ cookie: { jwt_access_token: validJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.jwt).toEqual(validJWT); }); }); describe('Auth headers', () => { it('returns `invalid token` error for malformed tokens', () => { const invalidJWT = jwt.sign({ accessToken }, invalidJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ headers: { 'X-fcc-access-token': invalidJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toEqual(errorTypes.invalidToken); }); it('returns `expired token` error for expired tokens', () => { const invalidJWT = jwt.sign( { accessToken: { ...accessToken, created: theBeginningOfTime } }, validJWTSecret ); // eslint-disable-next-line camelcase const req = mockReq({ headers: { 'X-fcc-access-token': invalidJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toEqual(errorTypes.expiredToken); }); it('returns a valid access token with no errors ', () => { expect.assertions(2); const validJWT = jwt.sign({ accessToken }, validJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ headers: { 'X-fcc-access-token': validJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.error).toBeFalsy(); expect(result.accessToken).toEqual({ ...accessToken, created: accessToken.created.toISOString() }); }); it('returns the signed jwt if found', () => { const validJWT = jwt.sign({ accessToken }, validJWTSecret); // eslint-disable-next-line camelcase const req = mockReq({ headers: { 'X-fcc-access-token': validJWT } }); const result = getAccessTokenFromRequest(req, validJWTSecret); expect(result.jwt).toEqual(validJWT); }); }); }); describe('setAccessTokenToResponse', () => { it('sets three cookies in the response', () => { expect.assertions(3); const req = mockReq(); const res = mockRes(); const expectedJWT = jwt.sign({ accessToken }, validJWTSecret); setAccessTokenToResponse({ accessToken }, req, res, validJWTSecret); expect(res.cookie.getCall(0).args).toEqual([ 'jwt_access_token', expectedJWT, { signed: false, domain: 'localhost', maxAge: accessToken.ttl } ]); expect(res.cookie.getCall(1).args).toEqual([ 'access_token', accessToken.id, { signed: false, domain: 'localhost', maxAge: accessToken.ttl } ]); expect(res.cookie.getCall(2).args).toEqual([ 'userId', accessToken.userId, { signed: false, domain: 'localhost', maxAge: accessToken.ttl } ]); }); }); describe('removeCookies', () => { // eslint-disable-next-line max-len it('removes four cookies set in the lifetime of an authenticated session', () => { // expect.assertions(4); const req = mockReq(); const res = mockRes(); removeCookies(req, res); expect(res.clearCookie.getCall(0).args).toEqual([ 'jwt_access_token', { signed: false, domain: 'localhost' } ]); expect(res.clearCookie.getCall(1).args).toEqual([ 'access_token', { signed: false, domain: 'localhost' } ]); expect(res.clearCookie.getCall(2).args).toEqual([ 'userId', { signed: false, domain: 'localhost' } ]); expect(res.clearCookie.getCall(3).args).toEqual([ '_csrf', { signed: false, domain: 'localhost' } ]); }); }); });
module.exports = function enableAuthentication(server) { // enable authentication server.enableAuth(); };
var searchData= [ ['example_5fstruct_0',['example_struct',['../structexample__struct.html',1,'']]] ];
/*! * jQuery JavaScript Library v1.12.4 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-05-20T17:17Z */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Support: Firefox 18+ // Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) //"use strict"; var deletedIds = []; var document = window.document; var slice = deletedIds.slice; var concat = deletedIds.concat; var push = deletedIds.push; var indexOf = deletedIds.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "1.12.4", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1, IE<9 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: deletedIds.sort, splice: deletedIds.splice }; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = jQuery.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type( obj ) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type( obj ) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) var realStringObj = obj && obj.toString(); return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call( obj, "constructor" ) && !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( !support.ownFirst ) { for ( key in obj ) { return hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, type: function( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; }, // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // Support: Android<4.1, IE<9 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( indexOf ) { return indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; while ( j < len ) { first[ i++ ] = second[ j++ ]; } // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { while ( second[ j ] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: function() { return +( new Date() ); }, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); // JSHint would error on this code due to the Symbol not being defined in ES5. // Defining this global in .jshintrc would create a danger of using the global // unguarded in another place, it seems safer to just disable JSHint for these // three lines. /* jshint ignore: start */ if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; } /* jshint ignore: end */ // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: iOS 8.2 (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.2.1 * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2015-10-17 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // http://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, nidselect, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // ID selector if ( (m = match[1]) ) { // Document context if ( nodeType === 9 ) { if ( (elem = context.getElementById( m )) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && (elem = newContext.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !compilerCache[ selector + " " ] && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { if ( nodeType !== 1 ) { newContext = context; newSelector = selector; // qSA looks outside Element context, which is not what we want // Thanks to Andrew Dupont for this workaround technique // Support: IE <=8 // Exclude object elements } else if ( context.nodeName.toLowerCase() !== "object" ) { // Capture the context ID, setting it first if necessary if ( (nid = context.getAttribute( "id" )) ) { nid = nid.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", (nid = expando) ); } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; while ( i-- ) { groups[i] = nidselect + " " + toSelector( groups[i] ); } newSelector = groups.join( "," ); // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9-11, Edge // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) if ( (parent = document.defaultView) && parent.top !== parent ) { // Support: IE 11 if ( parent.addEventListener ) { parent.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", unloadHandler ); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( document.createComment("") ); return !div.getElementsByTagName("*").length; }); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); return m ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibing-combinator selector` fails if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch (e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[0] = null; return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); if ( (oldCache = uniqueCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; if ( !context && elem.ownerDocument !== document ) { setDocument( elem ); xml = !documentIsHTML; } while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; } ); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; } ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // init accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt( 0 ) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[ 2 ] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[ 0 ] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof root.ready !== "undefined" ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( pos ? pos.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[ 0 ], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem, this ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.uniqueSort( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; } ); var rnotwhite = ( /\S+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( jQuery.isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = true; if ( !memory ) { self.disable(); } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], [ "notify", "progress", jQuery.Callbacks( "memory" ) ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. // If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .progress( updateFunc( i, progressContexts, progressValues ) ) .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } } ); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } } ); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } } /** * The ready event handler and self cleanup method */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || window.event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE6-10 // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch ( e ) {} if ( top && top.doScroll ) { ( function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll( "left" ); } catch ( e ) { return window.setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } } )(); } } } return readyList.promise( obj ); }; // Kick off the DOM ready check even if the user does not jQuery.ready.promise(); // Support: IE<9 // Iteration over object's inherited properties before its own var i; for ( i in jQuery( support ) ) { break; } support.ownFirst = i === "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom jQuery( function() { // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== "undefined" ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); } ); ( function() { var div = document.createElement( "div" ); // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch ( e ) { support.deleteExpando = false; } // Null elements to avoid leaks in IE. div = null; } )(); var acceptData = function( elem ) { var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 && nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true && elem.getAttribute( "classid" ) === noData; }; var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch ( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { if ( !acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split( " " ); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[ i ] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, undefined } else { cache[ id ] = undefined; } } jQuery.extend( { cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) // throw uncatchable exceptions if you attempt to set expando properties noData: { "applet ": true, "embed ": true, // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { jQuery.data( this, key ); } ); } return arguments.length > 1 ? // Sets one value this.each( function() { jQuery.data( this, key, value ); } ) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; }, removeData: function( key ) { return this.each( function() { jQuery.removeData( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, // or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); ( function() { var shrinkWrapBlocksVal; support.shrinkWrapBlocks = function() { if ( shrinkWrapBlocksVal != null ) { return shrinkWrapBlocksVal; } // Will be changed later if needed. shrinkWrapBlocksVal = false; // Minified: var b,c,d var div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); // Support: IE6 // Check if elements with layout shrink-wrap their children if ( typeof div.style.zoom !== "undefined" ) { // Reset CSS: box-sizing; display; margin; border div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;" + "padding:1px;width:1px;zoom:1"; div.appendChild( document.createElement( "div" ) ).style.width = "5px"; shrinkWrapBlocksVal = div.offsetWidth !== 3; } body.removeChild( container ); return shrinkWrapBlocksVal; }; } )(); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Make sure we update the tween properties later on valueParts = valueParts || []; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; do { // If previous iteration zeroed out, double until we get *something*. // Use string for doubling so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply initialInUnit = initialInUnit / scale; jQuery.style( elem, prop, initialInUnit + unit ); // Update scale, tolerating zero or NaN from tween.cur() // Break the loop if scale is unchanged or perfect, or if we've just had enough. } while ( scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations ); } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[ 0 ], key ) : emptyGet; }; var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([\w:-]+)/ ); var rscriptType = ( /^$|\/(?:java|ecma)script/i ); var rleadingWhitespace = ( /^\s+/ ); var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } ( function() { var div = document.createElement( "div" ), fragment = document.createDocumentFragment(), input = document.createElement( "input" ); // Setup div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName( "tbody" ).length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) input.type = "checkbox"; input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE6-IE11+ div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input = document.createElement( "input" ); input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ support.noCloneEvent = !!div.addEventListener; // Support: IE<9 // Since attributes and properties are the same in IE, // cleanData must set properties to undefined rather than use removeAttribute div[ jQuery.expando ] = 1; support.attributes = !div.getAttribute( jQuery.expando ); } )(); // We have to close these tags to support XHTML (#13200) var wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], // Support: IE8 param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }; // Support: IE8-IE9 wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; ( elem = elems[ i ] ) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; ( elem = elems[ i ] ) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/, rtbody = /<tbody/i; function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } function buildFragment( elems, context, scripts, selection, ignored ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; } ( function() { var i, eventName, div = document.createElement( "div" ); // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) for ( i in { submit: true, change: true, focusin: true } ) { eventName = "on" + i; if ( !( support[ i ] = eventName in window ) ) { // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); support[ i ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; } )(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE9 // See #13393 for more info function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = {}; } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && ( !e || jQuery.event.triggered !== e.type ) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak // with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "." ) > -1 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join( "." ); event.rnamespace = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || special._default.apply( eventPath.pop(), data ) === false ) && acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, j, ret, matched, handleObj, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or 2) have namespace(s) // a subset or equal to those in the bound event (both can have no namespace). if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Support (at least): Chrome, IE9 // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // // Support: Firefox<=42+ // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) if ( delegateCount && cur.nodeType && ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push( { elem: cur, handlers: matches } ); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Safari 6-8+ // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split( " " ), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: ( "button buttons clientX clientY fromElement offsetX offsetY " + "pageX pageY screenX screenY toElement" ).split( " " ), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, // Piggyback on a donor event to simulate a different one simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true // Previously, `originalEvent: {}` was set here, so stopPropagation call // would not be triggered on donor event, since in our own // jQuery.event.stopPropagation function we had a check for existence of // originalEvent.stopPropagation method, so, consequently it would be a noop. // // Guard for simulated events was moved to jQuery.event.stopPropagation function // since `originalEvent` should point to the original event for the // constancy with other events and for more focused logic } ); jQuery.event.trigger( e, null, elem ); if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, // to properly expose it to GC if ( typeof elem[ name ] === "undefined" ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e || this.isSimulated ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://code.google.com/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); // IE submit delegation if ( !support.submit ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? // Support: IE <=8 // We use jQuery.prop instead of elem.form // to allow fixing the IE8 delegated submit issue (gh-2332) // by 3rd party polyfills/workarounds. jQuery.prop( elem, "form" ) : undefined; if ( form && !jQuery._data( form, "submit" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submitBubble = true; } ); jQuery._data( form, "submit", true ); } } ); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submitBubble ) { delete event._submitBubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !support.change ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._justChanged = true; } } ); jQuery.event.add( this, "click._change", function( event ) { if ( this._justChanged && !event.isTrigger ) { this._justChanged = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event ); } ); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event ); } } ); jQuery._data( elem, "change", true ); } } ); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Support: Firefox // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 // // Support: Chrome, Safari // focus(in | out) events fire after focus & blur events, // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 if ( !support.focusin ) { jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); jQuery._removeData( doc, fix ); } else { jQuery._data( doc, fix, attaches ); } } }; } ); } jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); }, trigger: function( type, data ) { return this.each( function() { jQuery.event.trigger( type, data, this ); } ); }, triggerHandler: function( type, data ) { var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } } ); var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, // Support: IE 10-11, Edge 10240+ // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /<script|<style|<link/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName( "tbody" )[ 0 ] || elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[ 1 ]; } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( isFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android<4.1, PhantomJS<2 // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ) .replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return collection; } function remove( elem, selector, keepData ) { var node, elems = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = elems[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html.replace( rxhtmlTag, "<$1></$2>" ); }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( support.html5Clone || jQuery.isXMLDoc( elem ) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( ( !support.noCloneEvent || !support.noCloneChecked ) && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[ i ] ) { fixCloneNodeIssues( node, destElements[ i ] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { cloneCopyEvent( node, destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, cleanData: function( elems, /* internal */ forceAcceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, attributes = support.attributes, special = jQuery.event.special; for ( ; ( elem = elems[ i ] ) != null; i++ ) { if ( forceAcceptData || acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // Support: IE<9 // IE does not allow us to delete expando properties from nodes // IE creates expando attributes along with the property // IE does not have a removeAttribute function on Document nodes if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { elem.removeAttribute( internalKey ); // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://code.google.com/p/chromium/issues/detail?id=378607 } else { elem[ internalKey ] = undefined; } deletedIds.push( id ); } } } } } } ); jQuery.fn.extend( { // Keep domManip exposed until 3.0 (gh-2225) domManip: domManip, detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[ i ] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var iframe, elemdisplay = { // Support: Firefox // We have to pre-define these values for FF (#10227) HTML: "block", BODY: "block" }; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) .appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; // Support: IE doc.write(); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } var rmargin = ( /^margin/ ); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var swap = function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var documentElement = document.documentElement; ( function() { var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); // Finish early in limited (non-browser) environments if ( !div.style ) { return; } div.style.cssText = "float:left;opacity:.5"; // Support: IE<9 // Make sure that element opacity exists (as opposed to filter) support.opacity = div.style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!div.style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; container = document.createElement( "div" ); container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute"; div.innerHTML = ""; container.appendChild( div ); // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || div.style.WebkitBoxSizing === ""; jQuery.extend( support, { reliableHiddenOffsets: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableHiddenOffsetsVal; }, boxSizingReliable: function() { // We're checking for pixelPositionVal here instead of boxSizingReliableVal // since that compresses better and they're computed together anyway. if ( pixelPositionVal == null ) { computeStyleTests(); } return boxSizingReliableVal; }, pixelMarginRight: function() { // Support: Android 4.0-4.3 if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelMarginRightVal; }, pixelPosition: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelPositionVal; }, reliableMarginRight: function() { // Support: Android 2.3 if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableMarginRightVal; }, reliableMarginLeft: function() { // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableMarginLeftVal; } } ); function computeStyleTests() { var contents, divStyle, documentElement = document.documentElement; // Setup documentElement.appendChild( container ); div.style.cssText = // Support: Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:border-box;box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%"; // Support: IE<9 // Assume reasonable values in the absence of getComputedStyle pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; pixelMarginRightVal = reliableMarginRightVal = true; // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { divStyle = window.getComputedStyle( div ); pixelPositionVal = ( divStyle || {} ).top !== "1%"; reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; // Support: Android 4.0 - 4.3 only // Some styles come back with percentage values, even though they shouldn't div.style.marginRight = "50%"; pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; // Support: Android 2.3 only // Div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container (#3333) // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right contents = div.appendChild( document.createElement( "div" ) ); // Reset CSS: box-sizing; display; margin; border; padding contents.style.cssText = div.style.cssText = // Support: Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; contents.style.marginRight = contents.style.width = "0"; div.style.width = "1px"; reliableMarginRightVal = !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); div.removeChild( contents ); } // Support: IE6-8 // First check that getClientRects works as expected // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.style.display = "none"; reliableHiddenOffsetsVal = div.getClientRects().length === 0; if ( reliableHiddenOffsetsVal ) { div.style.display = ""; div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; div.childNodes[ 0 ].style.borderCollapse = "separate"; contents = div.getElementsByTagName( "td" ); contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; if ( reliableHiddenOffsetsVal ) { contents[ 0 ].style.display = ""; contents[ 1 ].style.display = "none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; } } // Teardown documentElement.removeChild( container ); } } )(); var getStyles, curCSS, rposition = /^(top|right|bottom|left)$/; if ( window.getComputedStyle ) { getStyles = function( elem ) { // Support: IE<=11+, Firefox<=30+ (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); }; curCSS = function( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; // Support: Opera 12.1x only // Fall back to style even without computed // computed is undefined for elems on document fragments if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } if ( computed ) { // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" // instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, // but width seems to be reliably pixels // this is against the CSSOM draft spec: // http://dev.w3.org/csswg/cssom/#resolved-values if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + ""; }; } else if ( documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, computed ) { var left, rs, rsLeft, ret, style = elem.style; computed = computed || getStyles( elem ); ret = computed ? computed[ name ] : undefined; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are // proportional to the parent element instead // and we can't measure the parent instead because it // might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + "" || "auto"; }; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return ( this.get = hookFn ).apply( this, arguments ); } }; } var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/i, // swappable if display is none or starts with table except // "table", "table-cell", or "table-caption" // see here for display values: // https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( name ) { // shortcut for names that are not vendor prefixed if ( name in emptyStyle ) { return name; } // check for vendor prefixed names var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); } } else { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test( val ) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } jQuery.extend( { // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "animationIterationCount": true, "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // Convert "+=" or "-=" to relative numbers (#7345) if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { value = adjustCSS( elem, name, ret ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set. See: #7116 if ( value == null || value !== value ) { return; } // If a number was passed in, add the unit (except for certain CSS properties) if ( type === "number" ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight // (for every problematic property) identical functions if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !( "set" in hooks ) || ( value = hooks.set( elem, value, extra ) ) !== undefined ) { // Support: IE // Swallow errors from 'invalid' CSS values (#5509) try { style[ name ] = value; } catch ( e ) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || isFinite( num ) ? num || 0 : val; } return val; } } ); jQuery.each( [ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); } ) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; } ); if ( !support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( ( computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter ) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - // attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule // or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, function( elem, computed ) { if ( computed ) { return swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } ); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function( elem, computed ) { if ( computed ) { return ( parseFloat( curCSS( elem, "marginLeft" ) ) || // Support: IE<=11+ // Running getBoundingClientRect on a disconnected node in IE throws an error // Support: IE8 only // getClientRects() errors on disconnected elems ( jQuery.contains( elem.ownerDocument, elem ) ? elem.getBoundingClientRect().left - swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) : 0 ) ) + "px"; } } ); // These hooks are used by animate to expand properties jQuery.each( { margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split( " " ) : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } } ); jQuery.fn.extend( { css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each( function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } } ); } } ); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; // Use a property on the element directly when it is not a DOM element, // or when there is no matching style property that exists. if ( tween.elem.nodeType !== 1 || tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; // Back Compat <1.8 extension point jQuery.fx.step = {}; var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = jQuery.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { // we're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always( function() { // doing this makes sure that the complete handler will be called // before this completes anim.always( function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } } ); } ); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); // Test default display if display is currently "none" checkDisplay = display === "none" ? jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !support.shrinkWrapBlocks() ) { anim.always( function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; } ); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // If there is dataShow left over from a stopped hide or show // and we are going to proceed with show, we should pretend to be hidden if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); // Any non-fx value stops us from restoring the original display value } else { display = undefined; } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done( function() { jQuery( elem ).hide(); } ); } anim.done( function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } } ); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } // If this is a noop like .hide().hide(), restore an overwritten display value } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { style.display = display; } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; } ), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // Support: Android 2.3 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ] ); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise( { elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {}, easing: jQuery.easing._default }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } } ), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { if ( jQuery.isFunction( result.stop ) ) { jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = jQuery.proxy( result.stop, result ); } return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue } ) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } jQuery.Animation = jQuery.extend( Animation, { tweeners: { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ); adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); return tween; } ] }, tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.match( rnotwhite ); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; Animation.tweeners[ prop ].unshift( callback ); } }, prefilters: [ defaultPrefilter ], prefilter: function( callback, prepend ) { if ( prepend ) { Animation.prefilters.unshift( callback ); } else { Animation.prefilters.push( callback ); } } } ); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend( { fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each( function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && ( type == null || timers[ index ].queue === type ) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } } ); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each( function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; } ); } } ); jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; } ); // Generate shortcuts for custom animations jQuery.each( { slideDown: genFx( "show" ), slideUp: genFx( "hide" ), slideToggle: genFx( "toggle" ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; } ); jQuery.timers = []; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); if ( timer() ) { jQuery.fx.start(); } else { jQuery.timers.pop(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { window.clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = window.setTimeout( next, time ); hooks.stop = function() { window.clearTimeout( timeout ); }; } ); }; ( function() { var a, input = document.createElement( "input" ), div = document.createElement( "div" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); // Setup div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; // Support: Windows Web Apps (WWA) // `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "checkbox" ); div.appendChild( input ); a = div.getElementsByTagName( "a" )[ 0 ]; // First batch of tests. a.style.cssText = "top:1px"; // Test setAttribute on camelCase class. // If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute( "style" ) ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute( "href" ) === "/a"; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement( "form" ).enctype; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE8 only // Check if we can trust getAttribute("value") input = document.createElement( "input" ); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; } )(); var rreturn = /\r/g, rspaces = /[\x20\t\r\n\f]+/g; jQuery.fn.extend( { val: function( value ) { var hooks, ret, isFunction, elem = this[ 0 ]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && ( ret = hooks.get( elem, "value" ) ) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace( rreturn, "" ) : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each( function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } } ); } } ); jQuery.extend( { valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE10-11+ // option.text throws exceptions (#14686, #14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { // Support: IE6 // When new option element is added to select box we need to // force reflow of newly added node in order to workaround delay // of initialization properties try { option.selected = optionSet = true; } catch ( _ ) { // Will be executed only in IE6 option.scrollHeight; } } else { option.selected = false; } } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return options; } } } } ); // Radios and checkboxes getter/setter jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { return elem.getAttribute( "value" ) === null ? "on" : elem.value; }; } } ); var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = support.getSetAttribute, getSetInput = support.input; jQuery.fn.extend( { attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each( function() { jQuery.removeAttr( this, name ); } ); } } ); jQuery.extend( { attr: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } elem.setAttribute( name, value + "" ); return value; } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName( elem, "input" ) ) { // Setting the type on a radio button after the value resets the value in IE8-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( ( name = attrNames[ i++ ] ) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } } } ); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); } else { // Support: IE<9 // Use defaultChecked and defaultSelected for oldIE elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle; if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ]; attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ? name.toLowerCase() : null; attrHandle[ name ] = handle; } return ret; }; } else { attrHandle[ name ] = function( elem, name, isXML ) { if ( !isXML ) { return elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; } }; } } ); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( ( ret = elem.ownerDocument.createAttribute( name ) ) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) if ( name === "value" || value === elem.getAttribute( name ) ) { return value; } } }; // Some attributes are constructed with empty-string values when not defined attrHandle.id = attrHandle.name = attrHandle.coords = function( elem, name, isXML ) { var ret; if ( !isXML ) { return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ? ret.value : null; } }; // Fixing value retrieval on a button requires this module jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); if ( ret && ret.specified ) { return ret.value; } }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each( [ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; } ); } if ( !support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case sensitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } var rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each( function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch ( e ) {} } ); } } ); jQuery.extend( { prop: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } return ( elem[ name ] = value ); } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } return elem[ name ]; }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the // correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } }, propFix: { "for": "htmlFor", "class": "className" } } ); // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each( [ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; } ); } // Support: Safari, IE9+ // Accessing the selectedIndex property // forces the browser to respect setting selected // on the option // The getter ensures a default option is selected // when in an optgroup if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; }, set: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } }; } jQuery.each( [ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; } ); // IE6/7 call enctype encoding if ( !support.enctype ) { jQuery.propFix.enctype = "encoding"; } var rclass = /[\t\r\n\f]/g; function getClass( elem ) { return jQuery.attr( elem, "class" ) || ""; } jQuery.fn.extend( { addClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); } ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { jQuery.attr( elem, "class", finalValue ); } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); } ); } if ( !arguments.length ) { return this.attr( "class", "" ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) > -1 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // Only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { jQuery.attr( elem, "class", finalValue ); } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each( function( i ) { jQuery( this ).toggleClass( value.call( this, i, getClass( this ), stateVal ), stateVal ); } ); } return this.each( function() { var className, i, self, classNames; if ( type === "string" ) { // Toggle individual class names i = 0; self = jQuery( this ); classNames = value.match( rnotwhite ) || []; while ( ( className = classNames[ i++ ] ) ) { // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( value === undefined || type === "boolean" ) { className = getClass( this ); if ( className ) { // store className if set jQuery._data( this, "__className__", className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. jQuery.attr( this, "class", className || value === false ? "" : jQuery._data( this, "__className__" ) || "" ); } } ); }, hasClass: function( selector ) { var className, elem, i = 0; className = " " + selector + " "; while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + getClass( elem ) + " " ).replace( rclass, " " ) .indexOf( className ) > -1 ) { return true; } } return false; } } ); // Return jQuery for attributes-only inclusion jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu" ).split( " " ), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; } ); jQuery.fn.extend( { hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } } ); var location = window.location; var nonce = jQuery.now(); var rquery = ( /\?/ ); var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; jQuery.parseJSON = function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { // Support: Android 2.3 // Workaround failure to string-cast null input return window.JSON.parse( data + "" ); } var requireNonComma, depth = null, str = jQuery.trim( data + "" ); // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains // after removing valid tokens return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { // Force termination if we see a misplaced comma if ( requireNonComma && comma ) { depth = 0; } // Perform no more replacements after returning to outermost depth if ( depth === 0 ) { return token; } // Commas must not follow "[", "{", or "," requireNonComma = open || comma; // Determine new depth // array/object open ("[" or "{"): depth += true - false (increment) // array/object close ("]" or "}"): depth += false - true (decrement) // other cases ("," or primitive): depth += true - true (numeric cast) depth += !close - !open; // Remove this token return ""; } ) ) ? ( Function( "return " + str ) )() : jQuery.error( "Invalid JSON: " + data ); }; // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new window.DOMParser(); xml = tmp.parseFromString( data, "text/xml" ); } else { // IE xml = new window.ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch ( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var rhash = /#.*$/, rts = /([?&])_=[^&]*/, // IE leaves an \r character at EOL rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat( "*" ), // Document location ajaxLocation = location.href, // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType.charAt( 0 ) === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend( { // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ) .replace( rhash, "" ) .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + nonce++ ) : // Otherwise add one to the end cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? s.accepts[ s.dataTypes[ 0 ] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // If request was aborted inside ajaxSend, stop there if ( state === 2 ) { return jqXHR; } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = window.setTimeout( function() { jqXHR.abort( "timeout" ); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } } ); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } // The url can be an options object (which then must have .url) return jQuery.ajax( jQuery.extend( { url: url, type: method, dataType: type, data: data, success: callback }, jQuery.isPlainObject( url ) && url ) ); }; } ); jQuery._evalUrl = function( url ) { return jQuery.ajax( { url: url, // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", cache: true, async: false, global: false, "throws": true } ); }; jQuery.fn.extend( { wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapAll( html.call( this, i ) ); } ); } if ( this[ 0 ] ) { // The elements to wrap the target around var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map( function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; } ).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapInner( html.call( this, i ) ); } ); } return this.each( function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } } ); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each( function( i ) { jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); } ); }, unwrap: function() { return this.parent().each( function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } } ).end(); } } ); function getDisplay( elem ) { return elem.style && elem.style.display || jQuery.css( elem, "display" ); } function filterHidden( elem ) { // Disconnected elements are considered hidden if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) { return true; } while ( elem && elem.nodeType === 1 ) { if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { return true; } elem = elem.parentNode; } return false; } jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return support.reliableHiddenOffsets() ? ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && !elem.getClientRects().length ) : filterHidden( elem ); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", v, traditional, add ); } } ); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; jQuery.fn.extend( { serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map( function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; } ) .filter( function() { var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ) .map( function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // Support: IE6-IE8 function() { // XHR cannot access local files, always use ActiveX for that case if ( this.isLocal ) { return createActiveXHR(); } // Support: IE 9-11 // IE seems to error on cross-domain PATCH requests when ActiveX XHR // is used. In IE 9+ always use the native XHR. // Note: this condition won't catch Edge as it doesn't define // document.documentMode but it also doesn't support ActiveX so it won't // reach this code. if ( document.documentMode > 8 ) { return createStandardXHR(); } // Support: IE<9 // oldIE XHR does not support non-RFC2616 methods (#13240) // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // Although this check for six methods instead of eight // since IE also does not support "trace" and "connect" return /^(get|post|head|put|delete|options)$/i.test( this.type ) && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; var xhrId = 0, xhrCallbacks = {}, xhrSupported = jQuery.ajaxSettings.xhr(); // Support: IE<10 // Open requests must be manually aborted on unload (#5280) // See https://support.microsoft.com/kb/2856746 for more info if ( window.attachEvent ) { window.attachEvent( "onunload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } } ); } // Determine support properties support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport( function( options ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !options.crossDomain || support.cors ) { var callback; return { send: function( headers, complete ) { var i, xhr = options.xhr(), id = ++xhrId; // Open the socket xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { // Support: IE<9 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting // request header to a null-value. // // To keep consistent with other XHR implementations, cast the value // to string and ignore `undefined`. if ( headers[ i ] !== undefined ) { xhr.setRequestHeader( i, headers[ i ] + "" ); } } // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( options.hasContent && options.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responses; // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Clean up delete xhrCallbacks[ id ]; callback = undefined; xhr.onreadystatechange = jQuery.noop; // Abort manually if needed if ( isAbort ) { if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; // Support: IE<10 // Accessing binary-data responseText throws an exception // (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch ( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && options.isLocal && !options.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, xhr.getAllResponseHeaders() ); } }; // Do send the request // `xhr.send` may raise an exception, but it will be // handled in jQuery.ajax (so no try/catch here) if ( !options.async ) { // If we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback window.setTimeout( callback ); } else { // Register the callback, but delay it in case `xhr.send` throws // Add to the list of active xhr callbacks xhr.onreadystatechange = xhrCallbacks[ id ] = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } } ); } // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch ( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch ( e ) {} } // Install script dataType jQuery.ajaxSetup( { accepts: { script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } } ); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery( "head" )[ 0 ] || document.documentElement; return { send: function( _, callback ) { script = document.createElement( "script" ); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } } ); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup( { jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); this[ callback ] = true; return callback; } } ); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters[ "script json" ] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always( function() { // If previous value didn't exist - remove it if ( overwritten === undefined ) { jQuery( window ).removeProp( callbackName ); // Otherwise restore preexisting value } else { window[ callbackName ] = overwritten; } // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; } ); // Delegate to script return "script"; } } ); // data: string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; // Keep a copy of the old load method var _load = jQuery.fn.load; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, type, response, self = this, off = url.indexOf( " " ); if ( off > -1 ) { selector = jQuery.trim( url.slice( off, url.length ) ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax( { url: url, // If "type" variable is undefined, then "GET" method will be used. // Make value of this field explicit since // user can override it through ajaxSetup method type: type || "GET", dataType: "html", data: params } ).done( function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); // If the request succeeds, this function gets "data", "status", "jqXHR" // but they are ignored because response was set above. // If it fails, this function gets "jqXHR", "status", "error" } ).always( callback && function( jqXHR, status ) { self.each( function() { callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); } ); } ); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; } ); jQuery.expr.filters.animated = function( elem ) { return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; } ).length; }; /** * Gets a window from an element */ function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1; // need to be able to calculate position if either top or left // is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend( { offset: function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each( function( i ) { jQuery.offset.setOffset( this, options, i ); } ); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== "undefined" ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }, position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, // because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) }; }, offsetParent: function() { return this.map( function() { var offsetParent = this.offsetParent; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || documentElement; } ); } } ); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? ( prop in win ) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; } ); // Support: Safari<7-8+, Chrome<37-44+ // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); } ); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, // but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; } ); } ); jQuery.fn.extend( { bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } } ); // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; } ); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( !noGlobal ) { window.jQuery = window.$ = jQuery; } return jQuery; })); (function($, undefined) { /** * Unobtrusive scripting adapter for jQuery * https://github.com/rails/jquery-ujs * * Requires jQuery 1.8.0 or later. * * Released under the MIT license * */ // Cut down on the number of issues from people inadvertently including jquery_ujs twice // by detecting and raising an error when it happens. 'use strict'; if ( $.rails !== undefined ) { $.error('jquery-ujs has already been loaded!'); } // Shorthand to make it a little easier to call public rails functions from within rails.js var rails; var $document = $(document); $.rails = rails = { // Link elements bound by jquery-ujs linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', // Button elements bound by jquery-ujs buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)', // Select elements bound by jquery-ujs inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', // Form elements bound by jquery-ujs formSubmitSelector: 'form', // Form input elements bound by jquery-ujs formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', // Form input elements disabled during form submission disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', // Form input elements re-enabled after form submission enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', // Form required input elements requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])', // Form file input elements fileInputSelector: 'input[name][type=file]:not([disabled])', // Link onClick disable selector with possible reenable after remote submission linkDisableSelector: 'a[data-disable-with], a[data-disable]', // Button onClick disable selector with possible reenable after remote submission buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]', // Up-to-date Cross-Site Request Forgery token csrfToken: function() { return $('meta[name=csrf-token]').attr('content'); }, // URL param that must contain the CSRF token csrfParam: function() { return $('meta[name=csrf-param]').attr('content'); }, // Make sure that every Ajax request sends the CSRF token CSRFProtection: function(xhr) { var token = rails.csrfToken(); if (token) xhr.setRequestHeader('X-CSRF-Token', token); }, // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones) refreshCSRFTokens: function(){ $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken()); }, // Triggers an event on an element and returns false if the event result is false fire: function(obj, name, data) { var event = $.Event(name); obj.trigger(event, data); return event.result !== false; }, // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm confirm: function(message) { return confirm(message); }, // Default ajax function, may be overridden with custom function in $.rails.ajax ajax: function(options) { return $.ajax(options); }, // Default way to get an element's href. May be overridden at $.rails.href. href: function(element) { return element[0].href; }, // Checks "data-remote" if true to handle the request through a XHR request. isRemote: function(element) { return element.data('remote') !== undefined && element.data('remote') !== false; }, // Submits "remote" forms and links with ajax handleRemote: function(element) { var method, url, data, withCredentials, dataType, options; if (rails.fire(element, 'ajax:before')) { withCredentials = element.data('with-credentials') || null; dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); if (element.is('form')) { method = element.data('ujs:submit-button-formmethod') || element.attr('method'); url = element.data('ujs:submit-button-formaction') || element.attr('action'); data = $(element[0]).serializeArray(); // memoized value from clicked submit button var button = element.data('ujs:submit-button'); if (button) { data.push(button); element.data('ujs:submit-button', null); } element.data('ujs:submit-button-formmethod', null); element.data('ujs:submit-button-formaction', null); } else if (element.is(rails.inputChangeSelector)) { method = element.data('method'); url = element.data('url'); data = element.serialize(); if (element.data('params')) data = data + '&' + element.data('params'); } else if (element.is(rails.buttonClickSelector)) { method = element.data('method') || 'get'; url = element.data('url'); data = element.serialize(); if (element.data('params')) data = data + '&' + element.data('params'); } else { method = element.data('method'); url = rails.href(element); data = element.data('params') || null; } options = { type: method || 'GET', data: data, dataType: dataType, // stopping the "ajax:beforeSend" event will cancel the ajax request beforeSend: function(xhr, settings) { if (settings.dataType === undefined) { xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); } if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) { element.trigger('ajax:send', xhr); } else { return false; } }, success: function(data, status, xhr) { element.trigger('ajax:success', [data, status, xhr]); }, complete: function(xhr, status) { element.trigger('ajax:complete', [xhr, status]); }, error: function(xhr, status, error) { element.trigger('ajax:error', [xhr, status, error]); }, crossDomain: rails.isCrossDomain(url) }; // There is no withCredentials for IE6-8 when // "Enable native XMLHTTP support" is disabled if (withCredentials) { options.xhrFields = { withCredentials: withCredentials }; } // Only pass url to `ajax` options if not blank if (url) { options.url = url; } return rails.ajax(options); } else { return false; } }, // Determines if the request is a cross domain request. isCrossDomain: function(url) { var originAnchor = document.createElement('a'); originAnchor.href = location.href; var urlAnchor = document.createElement('a'); try { urlAnchor.href = url; // This is a workaround to a IE bug. urlAnchor.href = urlAnchor.href; // If URL protocol is false or is a string containing a single colon // *and* host are false, assume it is not a cross-domain request // (should only be the case for IE7 and IE compatibility mode). // Otherwise, evaluate protocol and host of the URL against the origin // protocol and host. return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host)); } catch (e) { // If there is an error parsing the URL, assume it is crossDomain. return true; } }, // Handles "data-method" on links such as: // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a> handleMethod: function(link) { var href = rails.href(link), method = link.data('method'), target = link.attr('target'), csrfToken = rails.csrfToken(), csrfParam = rails.csrfParam(), form = $('<form method="post" action="' + href + '"></form>'), metadataInput = '<input name="_method" value="' + method + '" type="hidden" />'; if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) { metadataInput += '<input name="' + csrfParam + '" value="' + csrfToken + '" type="hidden" />'; } if (target) { form.attr('target', target); } form.hide().append(metadataInput).appendTo('body'); form.submit(); }, // Helper function that returns form elements that match the specified CSS selector // If form is actually a "form" element this will return associated elements outside the from that have // the html form attribute set formElements: function(form, selector) { return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector); }, /* Disables form elements: - Caches element value in 'ujs:enable-with' data store - Replaces element text with value of 'data-disable-with' attribute - Sets disabled property to true */ disableFormElements: function(form) { rails.formElements(form, rails.disableSelector).each(function() { rails.disableFormElement($(this)); }); }, disableFormElement: function(element) { var method, replacement; method = element.is('button') ? 'html' : 'val'; replacement = element.data('disable-with'); if (replacement !== undefined) { element.data('ujs:enable-with', element[method]()); element[method](replacement); } element.prop('disabled', true); element.data('ujs:disabled', true); }, /* Re-enables disabled form elements: - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`) - Sets disabled property to false */ enableFormElements: function(form) { rails.formElements(form, rails.enableSelector).each(function() { rails.enableFormElement($(this)); }); }, enableFormElement: function(element) { var method = element.is('button') ? 'html' : 'val'; if (element.data('ujs:enable-with') !== undefined) { element[method](element.data('ujs:enable-with')); element.removeData('ujs:enable-with'); // clean up cache } element.prop('disabled', false); element.removeData('ujs:disabled'); }, /* For 'data-confirm' attribute: - Fires `confirm` event - Shows the confirmation dialog - Fires the `confirm:complete` event Returns `true` if no function stops the chain and user chose yes; `false` otherwise. Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog. Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog. */ allowAction: function(element) { var message = element.data('confirm'), answer = false, callback; if (!message) { return true; } if (rails.fire(element, 'confirm')) { try { answer = rails.confirm(message); } catch (e) { (console.error || console.log).call(console, e.stack || e); } callback = rails.fire(element, 'confirm:complete', [answer]); } return answer && callback; }, // Helper function which checks for blank inputs in a form that match the specified CSS selector blankInputs: function(form, specifiedSelector, nonBlank) { var foundInputs = $(), input, valueToCheck, radiosForNameWithNoneSelected, radioName, selector = specifiedSelector || 'input,textarea', requiredInputs = form.find(selector), checkedRadioButtonNames = {}; requiredInputs.each(function() { input = $(this); if (input.is('input[type=radio]')) { // Don't count unchecked required radio as blank if other radio with same name is checked, // regardless of whether same-name radio input has required attribute or not. The spec // states https://www.w3.org/TR/html5/forms.html#the-required-attribute radioName = input.attr('name'); // Skip if we've already seen the radio with this name. if (!checkedRadioButtonNames[radioName]) { // If none checked if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) { radiosForNameWithNoneSelected = form.find( 'input[type=radio][name="' + radioName + '"]'); foundInputs = foundInputs.add(radiosForNameWithNoneSelected); } // We only need to check each name once. checkedRadioButtonNames[radioName] = radioName; } } else { valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val(); if (valueToCheck === nonBlank) { foundInputs = foundInputs.add(input); } } }); return foundInputs.length ? foundInputs : false; }, // Helper function which checks for non-blank inputs in a form that match the specified CSS selector nonBlankInputs: function(form, specifiedSelector) { return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank }, // Helper function, needed to provide consistent behavior in IE stopEverything: function(e) { $(e.target).trigger('ujs:everythingStopped'); e.stopImmediatePropagation(); return false; }, // Replace element's html with the 'data-disable-with' after storing original html // and prevent clicking on it disableElement: function(element) { var replacement = element.data('disable-with'); if (replacement !== undefined) { element.data('ujs:enable-with', element.html()); // store enabled state element.html(replacement); } element.bind('click.railsDisable', function(e) { // prevent further clicking return rails.stopEverything(e); }); element.data('ujs:disabled', true); }, // Restore element to its original state which was disabled by 'disableElement' above enableElement: function(element) { if (element.data('ujs:enable-with') !== undefined) { element.html(element.data('ujs:enable-with')); // set to old enabled state element.removeData('ujs:enable-with'); // clean up cache } element.unbind('click.railsDisable'); // enable element element.removeData('ujs:disabled'); } }; if (rails.fire($document, 'rails:attachBindings')) { $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }}); // This event works the same as the load event, except that it fires every // time the page is loaded. // // See https://github.com/rails/jquery-ujs/issues/357 // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching $(window).on('pageshow.rails', function () { $($.rails.enableSelector).each(function () { var element = $(this); if (element.data('ujs:disabled')) { $.rails.enableFormElement(element); } }); $($.rails.linkDisableSelector).each(function () { var element = $(this); if (element.data('ujs:disabled')) { $.rails.enableElement(element); } }); }); $document.on('ajax:complete', rails.linkDisableSelector, function() { rails.enableElement($(this)); }); $document.on('ajax:complete', rails.buttonDisableSelector, function() { rails.enableFormElement($(this)); }); $document.on('click.rails', rails.linkClickSelector, function(e) { var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey; if (!rails.allowAction(link)) return rails.stopEverything(e); if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link); if (rails.isRemote(link)) { if (metaClick && (!method || method === 'GET') && !data) { return true; } var handleRemote = rails.handleRemote(link); // Response from rails.handleRemote() will either be false or a deferred object promise. if (handleRemote === false) { rails.enableElement(link); } else { handleRemote.fail( function() { rails.enableElement(link); } ); } return false; } else if (method) { rails.handleMethod(link); return false; } }); $document.on('click.rails', rails.buttonClickSelector, function(e) { var button = $(this); if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e); if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button); var handleRemote = rails.handleRemote(button); // Response from rails.handleRemote() will either be false or a deferred object promise. if (handleRemote === false) { rails.enableFormElement(button); } else { handleRemote.fail( function() { rails.enableFormElement(button); } ); } return false; }); $document.on('change.rails', rails.inputChangeSelector, function(e) { var link = $(this); if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e); rails.handleRemote(link); return false; }); $document.on('submit.rails', rails.formSubmitSelector, function(e) { var form = $(this), remote = rails.isRemote(form), blankRequiredInputs, nonBlankFileInputs; if (!rails.allowAction(form)) return rails.stopEverything(e); // Skip other logic when required values are missing or file upload is present if (form.attr('novalidate') === undefined) { if (form.data('ujs:formnovalidate-button') === undefined) { blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false); if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { return rails.stopEverything(e); } } else { // Clear the formnovalidate in case the next button click is not on a formnovalidate button // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain form.data('ujs:formnovalidate-button', undefined); } } if (remote) { nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); if (nonBlankFileInputs) { // Slight timeout so that the submit button gets properly serialized // (make it easy for event handler to serialize form without disabled values) setTimeout(function(){ rails.disableFormElements(form); }, 13); var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); // Re-enable form elements if event bindings return false (canceling normal form submission) if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); } return aborted; } rails.handleRemote(form); return false; } else { // Slight timeout so that the submit button gets properly serialized setTimeout(function(){ rails.disableFormElements(form); }, 13); } }); $document.on('click.rails', rails.formInputClickSelector, function(event) { var button = $(this); if (!rails.allowAction(button)) return rails.stopEverything(event); // Register the pressed submit button var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null; var form = button.closest('form'); if (form.length === 0) { form = $('#' + button.attr('form')); } form.data('ujs:submit-button', data); // Save attributes from button form.data('ujs:formnovalidate-button', button.attr('formnovalidate')); form.data('ujs:submit-button-formaction', button.attr('formaction')); form.data('ujs:submit-button-formmethod', button.attr('formmethod')); }); $document.on('ajax:send.rails', rails.formSubmitSelector, function(event) { if (this === event.target) rails.disableFormElements($(this)); }); $document.on('ajax:complete.rails', rails.formSubmitSelector, function(event) { if (this === event.target) rails.enableFormElements($(this)); }); $(function(){ rails.refreshCSRFTokens(); }); } })( jQuery ); /*! * Bootstrap v4.3.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) : typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) : (global = global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper)); }(this, function (exports, $, Popper) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 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; } 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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * -------------------------------------------------------------------------- * Bootstrap (v4.3.1): util.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ /** * ------------------------------------------------------------------------ * Private TransitionEnd Helpers * ------------------------------------------------------------------------ */ var TRANSITION_END = 'transitionend'; var MAX_UID = 1000000; var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); } function getSpecialTransitionEndEvent() { return { bindType: TRANSITION_END, delegateType: TRANSITION_END, handle: function handle(event) { if ($(event.target).is(this)) { return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params } return undefined; // eslint-disable-line no-undefined } }; } function transitionEndEmulator(duration) { var _this = this; var called = false; $(this).one(Util.TRANSITION_END, function () { called = true; }); setTimeout(function () { if (!called) { Util.triggerTransitionEnd(_this); } }, duration); return this; } function setTransitionEndSupport() { $.fn.emulateTransitionEnd = transitionEndEmulator; $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); } /** * -------------------------------------------------------------------------- * Public Util Api * -------------------------------------------------------------------------- */ var Util = { TRANSITION_END: 'bsTransitionEnd', getUID: function getUID(prefix) { do { // eslint-disable-next-line no-bitwise prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here } while (document.getElementById(prefix)); return prefix; }, getSelectorFromElement: function getSelectorFromElement(element) { var selector = element.getAttribute('data-target'); if (!selector || selector === '#') { var hrefAttr = element.getAttribute('href'); selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; } try { return document.querySelector(selector) ? selector : null; } catch (err) { return null; } }, getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { if (!element) { return 0; } // Get transition-duration of the element var transitionDuration = $(element).css('transition-duration'); var transitionDelay = $(element).css('transition-delay'); var floatTransitionDuration = parseFloat(transitionDuration); var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found if (!floatTransitionDuration && !floatTransitionDelay) { return 0; } // If multiple durations are defined, take the first transitionDuration = transitionDuration.split(',')[0]; transitionDelay = transitionDelay.split(',')[0]; return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; }, reflow: function reflow(element) { return element.offsetHeight; }, triggerTransitionEnd: function triggerTransitionEnd(element) { $(element).trigger(TRANSITION_END); }, // TODO: Remove in v5 supportsTransitionEnd: function supportsTransitionEnd() { return Boolean(TRANSITION_END); }, isElement: function isElement(obj) { return (obj[0] || obj).nodeType; }, typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { for (var property in configTypes) { if (Object.prototype.hasOwnProperty.call(configTypes, property)) { var expectedTypes = configTypes[property]; var value = config[property]; var valueType = value && Util.isElement(value) ? 'element' : toType(value); if (!new RegExp(expectedTypes).test(valueType)) { throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); } } } }, findShadowRoot: function findShadowRoot(element) { if (!document.documentElement.attachShadow) { return null; } // Can find the shadow root otherwise it'll return the document if (typeof element.getRootNode === 'function') { var root = element.getRootNode(); return root instanceof ShadowRoot ? root : null; } if (element instanceof ShadowRoot) { return element; } // when we don't find a shadow root if (!element.parentNode) { return null; } return Util.findShadowRoot(element.parentNode); } }; setTransitionEndSupport(); /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME = 'alert'; var VERSION = '4.3.1'; var DATA_KEY = 'bs.alert'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Selector = { DISMISS: '[data-dismiss="alert"]' }; var Event = { CLOSE: "close" + EVENT_KEY, CLOSED: "closed" + EVENT_KEY, CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY }; var ClassName = { ALERT: 'alert', FADE: 'fade', SHOW: 'show' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Alert = /*#__PURE__*/ function () { function Alert(element) { this._element = element; } // Getters var _proto = Alert.prototype; // Public _proto.close = function close(element) { var rootElement = this._element; if (element) { rootElement = this._getRootElement(element); } var customEvent = this._triggerCloseEvent(rootElement); if (customEvent.isDefaultPrevented()) { return; } this._removeElement(rootElement); }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY); this._element = null; } // Private ; _proto._getRootElement = function _getRootElement(element) { var selector = Util.getSelectorFromElement(element); var parent = false; if (selector) { parent = document.querySelector(selector); } if (!parent) { parent = $(element).closest("." + ClassName.ALERT)[0]; } return parent; }; _proto._triggerCloseEvent = function _triggerCloseEvent(element) { var closeEvent = $.Event(Event.CLOSE); $(element).trigger(closeEvent); return closeEvent; }; _proto._removeElement = function _removeElement(element) { var _this = this; $(element).removeClass(ClassName.SHOW); if (!$(element).hasClass(ClassName.FADE)) { this._destroyElement(element); return; } var transitionDuration = Util.getTransitionDurationFromElement(element); $(element).one(Util.TRANSITION_END, function (event) { return _this._destroyElement(element, event); }).emulateTransitionEnd(transitionDuration); }; _proto._destroyElement = function _destroyElement(element) { $(element).detach().trigger(Event.CLOSED).remove(); } // Static ; Alert._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var $element = $(this); var data = $element.data(DATA_KEY); if (!data) { data = new Alert(this); $element.data(DATA_KEY, data); } if (config === 'close') { data[config](this); } }); }; Alert._handleDismiss = function _handleDismiss(alertInstance) { return function (event) { if (event) { event.preventDefault(); } alertInstance.close(this); }; }; _createClass(Alert, null, [{ key: "VERSION", get: function get() { return VERSION; } }]); return Alert; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME] = Alert._jQueryInterface; $.fn[NAME].Constructor = Alert; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; return Alert._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$1 = 'button'; var VERSION$1 = '4.3.1'; var DATA_KEY$1 = 'bs.button'; var EVENT_KEY$1 = "." + DATA_KEY$1; var DATA_API_KEY$1 = '.data-api'; var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; var ClassName$1 = { ACTIVE: 'active', BUTTON: 'btn', FOCUS: 'focus' }; var Selector$1 = { DATA_TOGGLE_CARROT: '[data-toggle^="button"]', DATA_TOGGLE: '[data-toggle="buttons"]', INPUT: 'input:not([type="hidden"])', ACTIVE: '.active', BUTTON: '.btn' }; var Event$1 = { CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1) /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Button = /*#__PURE__*/ function () { function Button(element) { this._element = element; } // Getters var _proto = Button.prototype; // Public _proto.toggle = function toggle() { var triggerChangeEvent = true; var addAriaPressed = true; var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0]; if (rootElement) { var input = this._element.querySelector(Selector$1.INPUT); if (input) { if (input.type === 'radio') { if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { triggerChangeEvent = false; } else { var activeElement = rootElement.querySelector(Selector$1.ACTIVE); if (activeElement) { $(activeElement).removeClass(ClassName$1.ACTIVE); } } } if (triggerChangeEvent) { if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { return; } input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); $(input).trigger('change'); } input.focus(); addAriaPressed = false; } } if (addAriaPressed) { this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); } if (triggerChangeEvent) { $(this._element).toggleClass(ClassName$1.ACTIVE); } }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY$1); this._element = null; } // Static ; Button._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$1); if (!data) { data = new Button(this); $(this).data(DATA_KEY$1, data); } if (config === 'toggle') { data[config](); } }); }; _createClass(Button, null, [{ key: "VERSION", get: function get() { return VERSION$1; } }]); return Button; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { event.preventDefault(); var button = event.target; if (!$(button).hasClass(ClassName$1.BUTTON)) { button = $(button).closest(Selector$1.BUTTON); } Button._jQueryInterface.call($(button), 'toggle'); }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { var button = $(event.target).closest(Selector$1.BUTTON)[0]; $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type)); }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$1] = Button._jQueryInterface; $.fn[NAME$1].Constructor = Button; $.fn[NAME$1].noConflict = function () { $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; return Button._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$2 = 'carousel'; var VERSION$2 = '4.3.1'; var DATA_KEY$2 = 'bs.carousel'; var EVENT_KEY$2 = "." + DATA_KEY$2; var DATA_API_KEY$2 = '.data-api'; var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch var SWIPE_THRESHOLD = 40; var Default = { interval: 5000, keyboard: true, slide: false, pause: 'hover', wrap: true, touch: true }; var DefaultType = { interval: '(number|boolean)', keyboard: 'boolean', slide: '(boolean|string)', pause: '(string|boolean)', wrap: 'boolean', touch: 'boolean' }; var Direction = { NEXT: 'next', PREV: 'prev', LEFT: 'left', RIGHT: 'right' }; var Event$2 = { SLIDE: "slide" + EVENT_KEY$2, SLID: "slid" + EVENT_KEY$2, KEYDOWN: "keydown" + EVENT_KEY$2, MOUSEENTER: "mouseenter" + EVENT_KEY$2, MOUSELEAVE: "mouseleave" + EVENT_KEY$2, TOUCHSTART: "touchstart" + EVENT_KEY$2, TOUCHMOVE: "touchmove" + EVENT_KEY$2, TOUCHEND: "touchend" + EVENT_KEY$2, POINTERDOWN: "pointerdown" + EVENT_KEY$2, POINTERUP: "pointerup" + EVENT_KEY$2, DRAG_START: "dragstart" + EVENT_KEY$2, LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 }; var ClassName$2 = { CAROUSEL: 'carousel', ACTIVE: 'active', SLIDE: 'slide', RIGHT: 'carousel-item-right', LEFT: 'carousel-item-left', NEXT: 'carousel-item-next', PREV: 'carousel-item-prev', ITEM: 'carousel-item', POINTER_EVENT: 'pointer-event' }; var Selector$2 = { ACTIVE: '.active', ACTIVE_ITEM: '.active.carousel-item', ITEM: '.carousel-item', ITEM_IMG: '.carousel-item img', NEXT_PREV: '.carousel-item-next, .carousel-item-prev', INDICATORS: '.carousel-indicators', DATA_SLIDE: '[data-slide], [data-slide-to]', DATA_RIDE: '[data-ride="carousel"]' }; var PointerType = { TOUCH: 'touch', PEN: 'pen' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Carousel = /*#__PURE__*/ function () { function Carousel(element, config) { this._items = null; this._interval = null; this._activeElement = null; this._isPaused = false; this._isSliding = false; this.touchTimeout = null; this.touchStartX = 0; this.touchDeltaX = 0; this._config = this._getConfig(config); this._element = element; this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS); this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); this._addEventListeners(); } // Getters var _proto = Carousel.prototype; // Public _proto.next = function next() { if (!this._isSliding) { this._slide(Direction.NEXT); } }; _proto.nextWhenVisible = function nextWhenVisible() { // Don't call next when the page isn't visible // or the carousel or its parent isn't visible if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { this.next(); } }; _proto.prev = function prev() { if (!this._isSliding) { this._slide(Direction.PREV); } }; _proto.pause = function pause(event) { if (!event) { this._isPaused = true; } if (this._element.querySelector(Selector$2.NEXT_PREV)) { Util.triggerTransitionEnd(this._element); this.cycle(true); } clearInterval(this._interval); this._interval = null; }; _proto.cycle = function cycle(event) { if (!event) { this._isPaused = false; } if (this._interval) { clearInterval(this._interval); this._interval = null; } if (this._config.interval && !this._isPaused) { this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); } }; _proto.to = function to(index) { var _this = this; this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); var activeIndex = this._getItemIndex(this._activeElement); if (index > this._items.length - 1 || index < 0) { return; } if (this._isSliding) { $(this._element).one(Event$2.SLID, function () { return _this.to(index); }); return; } if (activeIndex === index) { this.pause(); this.cycle(); return; } var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; this._slide(direction, this._items[index]); }; _proto.dispose = function dispose() { $(this._element).off(EVENT_KEY$2); $.removeData(this._element, DATA_KEY$2); this._items = null; this._config = null; this._element = null; this._interval = null; this._isPaused = null; this._isSliding = null; this._activeElement = null; this._indicatorsElement = null; } // Private ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default, config); Util.typeCheckConfig(NAME$2, config, DefaultType); return config; }; _proto._handleSwipe = function _handleSwipe() { var absDeltax = Math.abs(this.touchDeltaX); if (absDeltax <= SWIPE_THRESHOLD) { return; } var direction = absDeltax / this.touchDeltaX; // swipe left if (direction > 0) { this.prev(); } // swipe right if (direction < 0) { this.next(); } }; _proto._addEventListeners = function _addEventListeners() { var _this2 = this; if (this._config.keyboard) { $(this._element).on(Event$2.KEYDOWN, function (event) { return _this2._keydown(event); }); } if (this._config.pause === 'hover') { $(this._element).on(Event$2.MOUSEENTER, function (event) { return _this2.pause(event); }).on(Event$2.MOUSELEAVE, function (event) { return _this2.cycle(event); }); } if (this._config.touch) { this._addTouchEventListeners(); } }; _proto._addTouchEventListeners = function _addTouchEventListeners() { var _this3 = this; if (!this._touchSupported) { return; } var start = function start(event) { if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { _this3.touchStartX = event.originalEvent.clientX; } else if (!_this3._pointerEvent) { _this3.touchStartX = event.originalEvent.touches[0].clientX; } }; var move = function move(event) { // ensure swiping with one touch and not pinching if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { _this3.touchDeltaX = 0; } else { _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; } }; var end = function end(event) { if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; } _this3._handleSwipe(); if (_this3._config.pause === 'hover') { // If it's a touch-enabled device, mouseenter/leave are fired as // part of the mouse compatibility events on first tap - the carousel // would stop cycling until user tapped out of it; // here, we listen for touchend, explicitly pause the carousel // (as if it's the second time we tap on it, mouseenter compat event // is NOT fired) and after a timeout (to allow for mouse compatibility // events to fire) we explicitly restart cycling _this3.pause(); if (_this3.touchTimeout) { clearTimeout(_this3.touchTimeout); } _this3.touchTimeout = setTimeout(function (event) { return _this3.cycle(event); }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); } }; $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) { return e.preventDefault(); }); if (this._pointerEvent) { $(this._element).on(Event$2.POINTERDOWN, function (event) { return start(event); }); $(this._element).on(Event$2.POINTERUP, function (event) { return end(event); }); this._element.classList.add(ClassName$2.POINTER_EVENT); } else { $(this._element).on(Event$2.TOUCHSTART, function (event) { return start(event); }); $(this._element).on(Event$2.TOUCHMOVE, function (event) { return move(event); }); $(this._element).on(Event$2.TOUCHEND, function (event) { return end(event); }); } }; _proto._keydown = function _keydown(event) { if (/input|textarea/i.test(event.target.tagName)) { return; } switch (event.which) { case ARROW_LEFT_KEYCODE: event.preventDefault(); this.prev(); break; case ARROW_RIGHT_KEYCODE: event.preventDefault(); this.next(); break; default: } }; _proto._getItemIndex = function _getItemIndex(element) { this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : []; return this._items.indexOf(element); }; _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { var isNextDirection = direction === Direction.NEXT; var isPrevDirection = direction === Direction.PREV; var activeIndex = this._getItemIndex(activeElement); var lastItemIndex = this._items.length - 1; var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; if (isGoingToWrap && !this._config.wrap) { return activeElement; } var delta = direction === Direction.PREV ? -1 : 1; var itemIndex = (activeIndex + delta) % this._items.length; return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; }; _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { var targetIndex = this._getItemIndex(relatedTarget); var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM)); var slideEvent = $.Event(Event$2.SLIDE, { relatedTarget: relatedTarget, direction: eventDirectionName, from: fromIndex, to: targetIndex }); $(this._element).trigger(slideEvent); return slideEvent; }; _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { if (this._indicatorsElement) { var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE)); $(indicators).removeClass(ClassName$2.ACTIVE); var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; if (nextIndicator) { $(nextIndicator).addClass(ClassName$2.ACTIVE); } } }; _proto._slide = function _slide(direction, element) { var _this4 = this; var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); var activeElementIndex = this._getItemIndex(activeElement); var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); var nextElementIndex = this._getItemIndex(nextElement); var isCycling = Boolean(this._interval); var directionalClassName; var orderClassName; var eventDirectionName; if (direction === Direction.NEXT) { directionalClassName = ClassName$2.LEFT; orderClassName = ClassName$2.NEXT; eventDirectionName = Direction.LEFT; } else { directionalClassName = ClassName$2.RIGHT; orderClassName = ClassName$2.PREV; eventDirectionName = Direction.RIGHT; } if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) { this._isSliding = false; return; } var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); if (slideEvent.isDefaultPrevented()) { return; } if (!activeElement || !nextElement) { // Some weirdness is happening, so we bail return; } this._isSliding = true; if (isCycling) { this.pause(); } this._setActiveIndicatorElement(nextElement); var slidEvent = $.Event(Event$2.SLID, { relatedTarget: nextElement, direction: eventDirectionName, from: activeElementIndex, to: nextElementIndex }); if ($(this._element).hasClass(ClassName$2.SLIDE)) { $(nextElement).addClass(orderClassName); Util.reflow(nextElement); $(activeElement).addClass(directionalClassName); $(nextElement).addClass(directionalClassName); var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); if (nextElementInterval) { this._config.defaultInterval = this._config.defaultInterval || this._config.interval; this._config.interval = nextElementInterval; } else { this._config.interval = this._config.defaultInterval || this._config.interval; } var transitionDuration = Util.getTransitionDurationFromElement(activeElement); $(activeElement).one(Util.TRANSITION_END, function () { $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE); $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName); _this4._isSliding = false; setTimeout(function () { return $(_this4._element).trigger(slidEvent); }, 0); }).emulateTransitionEnd(transitionDuration); } else { $(activeElement).removeClass(ClassName$2.ACTIVE); $(nextElement).addClass(ClassName$2.ACTIVE); this._isSliding = false; $(this._element).trigger(slidEvent); } if (isCycling) { this.cycle(); } } // Static ; Carousel._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$2); var _config = _objectSpread({}, Default, $(this).data()); if (typeof config === 'object') { _config = _objectSpread({}, _config, config); } var action = typeof config === 'string' ? config : _config.slide; if (!data) { data = new Carousel(this, _config); $(this).data(DATA_KEY$2, data); } if (typeof config === 'number') { data.to(config); } else if (typeof action === 'string') { if (typeof data[action] === 'undefined') { throw new TypeError("No method named \"" + action + "\""); } data[action](); } else if (_config.interval && _config.ride) { data.pause(); data.cycle(); } }); }; Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { var selector = Util.getSelectorFromElement(this); if (!selector) { return; } var target = $(selector)[0]; if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) { return; } var config = _objectSpread({}, $(target).data(), $(this).data()); var slideIndex = this.getAttribute('data-slide-to'); if (slideIndex) { config.interval = false; } Carousel._jQueryInterface.call($(target), config); if (slideIndex) { $(target).data(DATA_KEY$2).to(slideIndex); } event.preventDefault(); }; _createClass(Carousel, null, [{ key: "VERSION", get: function get() { return VERSION$2; } }, { key: "Default", get: function get() { return Default; } }]); return Carousel; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); $(window).on(Event$2.LOAD_DATA_API, function () { var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE)); for (var i = 0, len = carousels.length; i < len; i++) { var $carousel = $(carousels[i]); Carousel._jQueryInterface.call($carousel, $carousel.data()); } }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$2] = Carousel._jQueryInterface; $.fn[NAME$2].Constructor = Carousel; $.fn[NAME$2].noConflict = function () { $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; return Carousel._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$3 = 'collapse'; var VERSION$3 = '4.3.1'; var DATA_KEY$3 = 'bs.collapse'; var EVENT_KEY$3 = "." + DATA_KEY$3; var DATA_API_KEY$3 = '.data-api'; var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; var Default$1 = { toggle: true, parent: '' }; var DefaultType$1 = { toggle: 'boolean', parent: '(string|element)' }; var Event$3 = { SHOW: "show" + EVENT_KEY$3, SHOWN: "shown" + EVENT_KEY$3, HIDE: "hide" + EVENT_KEY$3, HIDDEN: "hidden" + EVENT_KEY$3, CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 }; var ClassName$3 = { SHOW: 'show', COLLAPSE: 'collapse', COLLAPSING: 'collapsing', COLLAPSED: 'collapsed' }; var Dimension = { WIDTH: 'width', HEIGHT: 'height' }; var Selector$3 = { ACTIVES: '.show, .collapsing', DATA_TOGGLE: '[data-toggle="collapse"]' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Collapse = /*#__PURE__*/ function () { function Collapse(element, config) { this._isTransitioning = false; this._element = element; this._config = this._getConfig(config); this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE)); for (var i = 0, len = toggleList.length; i < len; i++) { var elem = toggleList[i]; var selector = Util.getSelectorFromElement(elem); var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { return foundElem === element; }); if (selector !== null && filterElement.length > 0) { this._selector = selector; this._triggerArray.push(elem); } } this._parent = this._config.parent ? this._getParent() : null; if (!this._config.parent) { this._addAriaAndCollapsedClass(this._element, this._triggerArray); } if (this._config.toggle) { this.toggle(); } } // Getters var _proto = Collapse.prototype; // Public _proto.toggle = function toggle() { if ($(this._element).hasClass(ClassName$3.SHOW)) { this.hide(); } else { this.show(); } }; _proto.show = function show() { var _this = this; if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) { return; } var actives; var activesData; if (this._parent) { actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) { if (typeof _this._config.parent === 'string') { return elem.getAttribute('data-parent') === _this._config.parent; } return elem.classList.contains(ClassName$3.COLLAPSE); }); if (actives.length === 0) { actives = null; } } if (actives) { activesData = $(actives).not(this._selector).data(DATA_KEY$3); if (activesData && activesData._isTransitioning) { return; } } var startEvent = $.Event(Event$3.SHOW); $(this._element).trigger(startEvent); if (startEvent.isDefaultPrevented()) { return; } if (actives) { Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); if (!activesData) { $(actives).data(DATA_KEY$3, null); } } var dimension = this._getDimension(); $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING); this._element.style[dimension] = 0; if (this._triggerArray.length) { $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true); } this.setTransitioning(true); var complete = function complete() { $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW); _this._element.style[dimension] = ''; _this.setTransitioning(false); $(_this._element).trigger(Event$3.SHOWN); }; var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); var scrollSize = "scroll" + capitalizedDimension; var transitionDuration = Util.getTransitionDurationFromElement(this._element); $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); this._element.style[dimension] = this._element[scrollSize] + "px"; }; _proto.hide = function hide() { var _this2 = this; if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) { return; } var startEvent = $.Event(Event$3.HIDE); $(this._element).trigger(startEvent); if (startEvent.isDefaultPrevented()) { return; } var dimension = this._getDimension(); this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; Util.reflow(this._element); $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW); var triggerArrayLength = this._triggerArray.length; if (triggerArrayLength > 0) { for (var i = 0; i < triggerArrayLength; i++) { var trigger = this._triggerArray[i]; var selector = Util.getSelectorFromElement(trigger); if (selector !== null) { var $elem = $([].slice.call(document.querySelectorAll(selector))); if (!$elem.hasClass(ClassName$3.SHOW)) { $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false); } } } } this.setTransitioning(true); var complete = function complete() { _this2.setTransitioning(false); $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN); }; this._element.style[dimension] = ''; var transitionDuration = Util.getTransitionDurationFromElement(this._element); $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); }; _proto.setTransitioning = function setTransitioning(isTransitioning) { this._isTransitioning = isTransitioning; }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY$3); this._config = null; this._parent = null; this._element = null; this._triggerArray = null; this._isTransitioning = null; } // Private ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default$1, config); config.toggle = Boolean(config.toggle); // Coerce string values Util.typeCheckConfig(NAME$3, config, DefaultType$1); return config; }; _proto._getDimension = function _getDimension() { var hasWidth = $(this._element).hasClass(Dimension.WIDTH); return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; }; _proto._getParent = function _getParent() { var _this3 = this; var parent; if (Util.isElement(this._config.parent)) { parent = this._config.parent; // It's a jQuery object if (typeof this._config.parent.jquery !== 'undefined') { parent = this._config.parent[0]; } } else { parent = document.querySelector(this._config.parent); } var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; var children = [].slice.call(parent.querySelectorAll(selector)); $(children).each(function (i, element) { _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); }); return parent; }; _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { var isOpen = $(element).hasClass(ClassName$3.SHOW); if (triggerArray.length) { $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); } } // Static ; Collapse._getTargetFromElement = function _getTargetFromElement(element) { var selector = Util.getSelectorFromElement(element); return selector ? document.querySelector(selector) : null; }; Collapse._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var $this = $(this); var data = $this.data(DATA_KEY$3); var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {}); if (!data && _config.toggle && /show|hide/.test(config)) { _config.toggle = false; } if (!data) { data = new Collapse(this, _config); $this.data(DATA_KEY$3, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(Collapse, null, [{ key: "VERSION", get: function get() { return VERSION$3; } }, { key: "Default", get: function get() { return Default$1; } }]); return Collapse; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { // preventDefault only for <a> elements (which change the URL) not inside the collapsible element if (event.currentTarget.tagName === 'A') { event.preventDefault(); } var $trigger = $(this); var selector = Util.getSelectorFromElement(this); var selectors = [].slice.call(document.querySelectorAll(selector)); $(selectors).each(function () { var $target = $(this); var data = $target.data(DATA_KEY$3); var config = data ? 'toggle' : $trigger.data(); Collapse._jQueryInterface.call($target, config); }); }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$3] = Collapse._jQueryInterface; $.fn[NAME$3].Constructor = Collapse; $.fn[NAME$3].noConflict = function () { $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; return Collapse._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$4 = 'dropdown'; var VERSION$4 = '4.3.1'; var DATA_KEY$4 = 'bs.dropdown'; var EVENT_KEY$4 = "." + DATA_KEY$4; var DATA_API_KEY$4 = '.data-api'; var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); var Event$4 = { HIDE: "hide" + EVENT_KEY$4, HIDDEN: "hidden" + EVENT_KEY$4, SHOW: "show" + EVENT_KEY$4, SHOWN: "shown" + EVENT_KEY$4, CLICK: "click" + EVENT_KEY$4, CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 }; var ClassName$4 = { DISABLED: 'disabled', SHOW: 'show', DROPUP: 'dropup', DROPRIGHT: 'dropright', DROPLEFT: 'dropleft', MENURIGHT: 'dropdown-menu-right', MENULEFT: 'dropdown-menu-left', POSITION_STATIC: 'position-static' }; var Selector$4 = { DATA_TOGGLE: '[data-toggle="dropdown"]', FORM_CHILD: '.dropdown form', MENU: '.dropdown-menu', NAVBAR_NAV: '.navbar-nav', VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' }; var AttachmentMap = { TOP: 'top-start', TOPEND: 'top-end', BOTTOM: 'bottom-start', BOTTOMEND: 'bottom-end', RIGHT: 'right-start', RIGHTEND: 'right-end', LEFT: 'left-start', LEFTEND: 'left-end' }; var Default$2 = { offset: 0, flip: true, boundary: 'scrollParent', reference: 'toggle', display: 'dynamic' }; var DefaultType$2 = { offset: '(number|string|function)', flip: 'boolean', boundary: '(string|element)', reference: '(string|element)', display: 'string' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Dropdown = /*#__PURE__*/ function () { function Dropdown(element, config) { this._element = element; this._popper = null; this._config = this._getConfig(config); this._menu = this._getMenuElement(); this._inNavbar = this._detectNavbar(); this._addEventListeners(); } // Getters var _proto = Dropdown.prototype; // Public _proto.toggle = function toggle() { if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) { return; } var parent = Dropdown._getParentFromElement(this._element); var isActive = $(this._menu).hasClass(ClassName$4.SHOW); Dropdown._clearMenus(); if (isActive) { return; } var relatedTarget = { relatedTarget: this._element }; var showEvent = $.Event(Event$4.SHOW, relatedTarget); $(parent).trigger(showEvent); if (showEvent.isDefaultPrevented()) { return; } // Disable totally Popper.js for Dropdown in Navbar if (!this._inNavbar) { /** * Check for Popper dependency * Popper - https://popper.js.org */ if (typeof Popper === 'undefined') { throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); } var referenceElement = this._element; if (this._config.reference === 'parent') { referenceElement = parent; } else if (Util.isElement(this._config.reference)) { referenceElement = this._config.reference; // Check if it's jQuery element if (typeof this._config.reference.jquery !== 'undefined') { referenceElement = this._config.reference[0]; } } // If boundary is not `scrollParent`, then set position to `static` // to allow the menu to "escape" the scroll parent's boundaries // https://github.com/twbs/bootstrap/issues/24251 if (this._config.boundary !== 'scrollParent') { $(parent).addClass(ClassName$4.POSITION_STATIC); } this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); } // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) { $(document.body).children().on('mouseover', null, $.noop); } this._element.focus(); this._element.setAttribute('aria-expanded', true); $(this._menu).toggleClass(ClassName$4.SHOW); $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); }; _proto.show = function show() { if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) { return; } var relatedTarget = { relatedTarget: this._element }; var showEvent = $.Event(Event$4.SHOW, relatedTarget); var parent = Dropdown._getParentFromElement(this._element); $(parent).trigger(showEvent); if (showEvent.isDefaultPrevented()) { return; } $(this._menu).toggleClass(ClassName$4.SHOW); $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); }; _proto.hide = function hide() { if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) { return; } var relatedTarget = { relatedTarget: this._element }; var hideEvent = $.Event(Event$4.HIDE, relatedTarget); var parent = Dropdown._getParentFromElement(this._element); $(parent).trigger(hideEvent); if (hideEvent.isDefaultPrevented()) { return; } $(this._menu).toggleClass(ClassName$4.SHOW); $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY$4); $(this._element).off(EVENT_KEY$4); this._element = null; this._menu = null; if (this._popper !== null) { this._popper.destroy(); this._popper = null; } }; _proto.update = function update() { this._inNavbar = this._detectNavbar(); if (this._popper !== null) { this._popper.scheduleUpdate(); } } // Private ; _proto._addEventListeners = function _addEventListeners() { var _this = this; $(this._element).on(Event$4.CLICK, function (event) { event.preventDefault(); event.stopPropagation(); _this.toggle(); }); }; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); return config; }; _proto._getMenuElement = function _getMenuElement() { if (!this._menu) { var parent = Dropdown._getParentFromElement(this._element); if (parent) { this._menu = parent.querySelector(Selector$4.MENU); } } return this._menu; }; _proto._getPlacement = function _getPlacement() { var $parentDropdown = $(this._element.parentNode); var placement = AttachmentMap.BOTTOM; // Handle dropup if ($parentDropdown.hasClass(ClassName$4.DROPUP)) { placement = AttachmentMap.TOP; if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { placement = AttachmentMap.TOPEND; } } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) { placement = AttachmentMap.RIGHT; } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) { placement = AttachmentMap.LEFT; } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { placement = AttachmentMap.BOTTOMEND; } return placement; }; _proto._detectNavbar = function _detectNavbar() { return $(this._element).closest('.navbar').length > 0; }; _proto._getOffset = function _getOffset() { var _this2 = this; var offset = {}; if (typeof this._config.offset === 'function') { offset.fn = function (data) { data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); return data; }; } else { offset.offset = this._config.offset; } return offset; }; _proto._getPopperConfig = function _getPopperConfig() { var popperConfig = { placement: this._getPlacement(), modifiers: { offset: this._getOffset(), flip: { enabled: this._config.flip }, preventOverflow: { boundariesElement: this._config.boundary } } // Disable Popper.js if we have a static display }; if (this._config.display === 'static') { popperConfig.modifiers.applyStyle = { enabled: false }; } return popperConfig; } // Static ; Dropdown._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$4); var _config = typeof config === 'object' ? config : null; if (!data) { data = new Dropdown(this, _config); $(this).data(DATA_KEY$4, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; Dropdown._clearMenus = function _clearMenus(event) { if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { return; } var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE)); for (var i = 0, len = toggles.length; i < len; i++) { var parent = Dropdown._getParentFromElement(toggles[i]); var context = $(toggles[i]).data(DATA_KEY$4); var relatedTarget = { relatedTarget: toggles[i] }; if (event && event.type === 'click') { relatedTarget.clickEvent = event; } if (!context) { continue; } var dropdownMenu = context._menu; if (!$(parent).hasClass(ClassName$4.SHOW)) { continue; } if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { continue; } var hideEvent = $.Event(Event$4.HIDE, relatedTarget); $(parent).trigger(hideEvent); if (hideEvent.isDefaultPrevented()) { continue; } // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support if ('ontouchstart' in document.documentElement) { $(document.body).children().off('mouseover', null, $.noop); } toggles[i].setAttribute('aria-expanded', 'false'); $(dropdownMenu).removeClass(ClassName$4.SHOW); $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); } }; Dropdown._getParentFromElement = function _getParentFromElement(element) { var parent; var selector = Util.getSelectorFromElement(element); if (selector) { parent = document.querySelector(selector); } return parent || element.parentNode; } // eslint-disable-next-line complexity ; Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { // If not input/textarea: // - And not a key in REGEXP_KEYDOWN => not a dropdown command // If input/textarea: // - If space key => not a dropdown command // - If key is other than escape // - If key is not up or down => not a dropdown command // - If trigger inside the menu => not a dropdown command if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { return; } event.preventDefault(); event.stopPropagation(); if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) { return; } var parent = Dropdown._getParentFromElement(this); var isActive = $(parent).hasClass(ClassName$4.SHOW); if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { if (event.which === ESCAPE_KEYCODE) { var toggle = parent.querySelector(Selector$4.DATA_TOGGLE); $(toggle).trigger('focus'); } $(this).trigger('click'); return; } var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)); if (items.length === 0) { return; } var index = items.indexOf(event.target); if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up index--; } if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down index++; } if (index < 0) { index = 0; } items[index].focus(); }; _createClass(Dropdown, null, [{ key: "VERSION", get: function get() { return VERSION$4; } }, { key: "Default", get: function get() { return Default$2; } }, { key: "DefaultType", get: function get() { return DefaultType$2; } }]); return Dropdown; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { event.preventDefault(); event.stopPropagation(); Dropdown._jQueryInterface.call($(this), 'toggle'); }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { e.stopPropagation(); }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$4] = Dropdown._jQueryInterface; $.fn[NAME$4].Constructor = Dropdown; $.fn[NAME$4].noConflict = function () { $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; return Dropdown._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$5 = 'modal'; var VERSION$5 = '4.3.1'; var DATA_KEY$5 = 'bs.modal'; var EVENT_KEY$5 = "." + DATA_KEY$5; var DATA_API_KEY$5 = '.data-api'; var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key var Default$3 = { backdrop: true, keyboard: true, focus: true, show: true }; var DefaultType$3 = { backdrop: '(boolean|string)', keyboard: 'boolean', focus: 'boolean', show: 'boolean' }; var Event$5 = { HIDE: "hide" + EVENT_KEY$5, HIDDEN: "hidden" + EVENT_KEY$5, SHOW: "show" + EVENT_KEY$5, SHOWN: "shown" + EVENT_KEY$5, FOCUSIN: "focusin" + EVENT_KEY$5, RESIZE: "resize" + EVENT_KEY$5, CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 }; var ClassName$5 = { SCROLLABLE: 'modal-dialog-scrollable', SCROLLBAR_MEASURER: 'modal-scrollbar-measure', BACKDROP: 'modal-backdrop', OPEN: 'modal-open', FADE: 'fade', SHOW: 'show' }; var Selector$5 = { DIALOG: '.modal-dialog', MODAL_BODY: '.modal-body', DATA_TOGGLE: '[data-toggle="modal"]', DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', STICKY_CONTENT: '.sticky-top' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Modal = /*#__PURE__*/ function () { function Modal(element, config) { this._config = this._getConfig(config); this._element = element; this._dialog = element.querySelector(Selector$5.DIALOG); this._backdrop = null; this._isShown = false; this._isBodyOverflowing = false; this._ignoreBackdropClick = false; this._isTransitioning = false; this._scrollbarWidth = 0; } // Getters var _proto = Modal.prototype; // Public _proto.toggle = function toggle(relatedTarget) { return this._isShown ? this.hide() : this.show(relatedTarget); }; _proto.show = function show(relatedTarget) { var _this = this; if (this._isShown || this._isTransitioning) { return; } if ($(this._element).hasClass(ClassName$5.FADE)) { this._isTransitioning = true; } var showEvent = $.Event(Event$5.SHOW, { relatedTarget: relatedTarget }); $(this._element).trigger(showEvent); if (this._isShown || showEvent.isDefaultPrevented()) { return; } this._isShown = true; this._checkScrollbar(); this._setScrollbar(); this._adjustDialog(); this._setEscapeEvent(); this._setResizeEvent(); $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { return _this.hide(event); }); $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () { $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) { if ($(event.target).is(_this._element)) { _this._ignoreBackdropClick = true; } }); }); this._showBackdrop(function () { return _this._showElement(relatedTarget); }); }; _proto.hide = function hide(event) { var _this2 = this; if (event) { event.preventDefault(); } if (!this._isShown || this._isTransitioning) { return; } var hideEvent = $.Event(Event$5.HIDE); $(this._element).trigger(hideEvent); if (!this._isShown || hideEvent.isDefaultPrevented()) { return; } this._isShown = false; var transition = $(this._element).hasClass(ClassName$5.FADE); if (transition) { this._isTransitioning = true; } this._setEscapeEvent(); this._setResizeEvent(); $(document).off(Event$5.FOCUSIN); $(this._element).removeClass(ClassName$5.SHOW); $(this._element).off(Event$5.CLICK_DISMISS); $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS); if (transition) { var transitionDuration = Util.getTransitionDurationFromElement(this._element); $(this._element).one(Util.TRANSITION_END, function (event) { return _this2._hideModal(event); }).emulateTransitionEnd(transitionDuration); } else { this._hideModal(); } }; _proto.dispose = function dispose() { [window, this._element, this._dialog].forEach(function (htmlElement) { return $(htmlElement).off(EVENT_KEY$5); }); /** * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` * Do not move `document` in `htmlElements` array * It will remove `Event.CLICK_DATA_API` event that should remain */ $(document).off(Event$5.FOCUSIN); $.removeData(this._element, DATA_KEY$5); this._config = null; this._element = null; this._dialog = null; this._backdrop = null; this._isShown = null; this._isBodyOverflowing = null; this._ignoreBackdropClick = null; this._isTransitioning = null; this._scrollbarWidth = null; }; _proto.handleUpdate = function handleUpdate() { this._adjustDialog(); } // Private ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default$3, config); Util.typeCheckConfig(NAME$5, config, DefaultType$3); return config; }; _proto._showElement = function _showElement(relatedTarget) { var _this3 = this; var transition = $(this._element).hasClass(ClassName$5.FADE); if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { // Don't move modal's DOM position document.body.appendChild(this._element); } this._element.style.display = 'block'; this._element.removeAttribute('aria-hidden'); this._element.setAttribute('aria-modal', true); if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) { this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0; } else { this._element.scrollTop = 0; } if (transition) { Util.reflow(this._element); } $(this._element).addClass(ClassName$5.SHOW); if (this._config.focus) { this._enforceFocus(); } var shownEvent = $.Event(Event$5.SHOWN, { relatedTarget: relatedTarget }); var transitionComplete = function transitionComplete() { if (_this3._config.focus) { _this3._element.focus(); } _this3._isTransitioning = false; $(_this3._element).trigger(shownEvent); }; if (transition) { var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); } else { transitionComplete(); } }; _proto._enforceFocus = function _enforceFocus() { var _this4 = this; $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop .on(Event$5.FOCUSIN, function (event) { if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { _this4._element.focus(); } }); }; _proto._setEscapeEvent = function _setEscapeEvent() { var _this5 = this; if (this._isShown && this._config.keyboard) { $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) { if (event.which === ESCAPE_KEYCODE$1) { event.preventDefault(); _this5.hide(); } }); } else if (!this._isShown) { $(this._element).off(Event$5.KEYDOWN_DISMISS); } }; _proto._setResizeEvent = function _setResizeEvent() { var _this6 = this; if (this._isShown) { $(window).on(Event$5.RESIZE, function (event) { return _this6.handleUpdate(event); }); } else { $(window).off(Event$5.RESIZE); } }; _proto._hideModal = function _hideModal() { var _this7 = this; this._element.style.display = 'none'; this._element.setAttribute('aria-hidden', true); this._element.removeAttribute('aria-modal'); this._isTransitioning = false; this._showBackdrop(function () { $(document.body).removeClass(ClassName$5.OPEN); _this7._resetAdjustments(); _this7._resetScrollbar(); $(_this7._element).trigger(Event$5.HIDDEN); }); }; _proto._removeBackdrop = function _removeBackdrop() { if (this._backdrop) { $(this._backdrop).remove(); this._backdrop = null; } }; _proto._showBackdrop = function _showBackdrop(callback) { var _this8 = this; var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : ''; if (this._isShown && this._config.backdrop) { this._backdrop = document.createElement('div'); this._backdrop.className = ClassName$5.BACKDROP; if (animate) { this._backdrop.classList.add(animate); } $(this._backdrop).appendTo(document.body); $(this._element).on(Event$5.CLICK_DISMISS, function (event) { if (_this8._ignoreBackdropClick) { _this8._ignoreBackdropClick = false; return; } if (event.target !== event.currentTarget) { return; } if (_this8._config.backdrop === 'static') { _this8._element.focus(); } else { _this8.hide(); } }); if (animate) { Util.reflow(this._backdrop); } $(this._backdrop).addClass(ClassName$5.SHOW); if (!callback) { return; } if (!animate) { callback(); return; } var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); } else if (!this._isShown && this._backdrop) { $(this._backdrop).removeClass(ClassName$5.SHOW); var callbackRemove = function callbackRemove() { _this8._removeBackdrop(); if (callback) { callback(); } }; if ($(this._element).hasClass(ClassName$5.FADE)) { var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); } else { callbackRemove(); } } else if (callback) { callback(); } } // ---------------------------------------------------------------------- // the following methods are used to handle overflowing modals // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- ; _proto._adjustDialog = function _adjustDialog() { var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; if (!this._isBodyOverflowing && isModalOverflowing) { this._element.style.paddingLeft = this._scrollbarWidth + "px"; } if (this._isBodyOverflowing && !isModalOverflowing) { this._element.style.paddingRight = this._scrollbarWidth + "px"; } }; _proto._resetAdjustments = function _resetAdjustments() { this._element.style.paddingLeft = ''; this._element.style.paddingRight = ''; }; _proto._checkScrollbar = function _checkScrollbar() { var rect = document.body.getBoundingClientRect(); this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; this._scrollbarWidth = this._getScrollbarWidth(); }; _proto._setScrollbar = function _setScrollbar() { var _this9 = this; if (this._isBodyOverflowing) { // Note: DOMNode.style.paddingRight returns the actual value or '' if not set // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding $(fixedContent).each(function (index, element) { var actualPadding = element.style.paddingRight; var calculatedPadding = $(element).css('padding-right'); $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); }); // Adjust sticky content margin $(stickyContent).each(function (index, element) { var actualMargin = element.style.marginRight; var calculatedMargin = $(element).css('margin-right'); $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); }); // Adjust body padding var actualPadding = document.body.style.paddingRight; var calculatedPadding = $(document.body).css('padding-right'); $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); } $(document.body).addClass(ClassName$5.OPEN); }; _proto._resetScrollbar = function _resetScrollbar() { // Restore fixed content padding var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); $(fixedContent).each(function (index, element) { var padding = $(element).data('padding-right'); $(element).removeData('padding-right'); element.style.paddingRight = padding ? padding : ''; }); // Restore sticky content var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT)); $(elements).each(function (index, element) { var margin = $(element).data('margin-right'); if (typeof margin !== 'undefined') { $(element).css('margin-right', margin).removeData('margin-right'); } }); // Restore body padding var padding = $(document.body).data('padding-right'); $(document.body).removeData('padding-right'); document.body.style.paddingRight = padding ? padding : ''; }; _proto._getScrollbarWidth = function _getScrollbarWidth() { // thx d.walsh var scrollDiv = document.createElement('div'); scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; document.body.appendChild(scrollDiv); var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; } // Static ; Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { return this.each(function () { var data = $(this).data(DATA_KEY$5); var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {}); if (!data) { data = new Modal(this, _config); $(this).data(DATA_KEY$5, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](relatedTarget); } else if (_config.show) { data.show(relatedTarget); } }); }; _createClass(Modal, null, [{ key: "VERSION", get: function get() { return VERSION$5; } }, { key: "Default", get: function get() { return Default$3; } }]); return Modal; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { var _this10 = this; var target; var selector = Util.getSelectorFromElement(this); if (selector) { target = document.querySelector(selector); } var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); if (this.tagName === 'A' || this.tagName === 'AREA') { event.preventDefault(); } var $target = $(target).one(Event$5.SHOW, function (showEvent) { if (showEvent.isDefaultPrevented()) { // Only register focus restorer if modal will actually get shown return; } $target.one(Event$5.HIDDEN, function () { if ($(_this10).is(':visible')) { _this10.focus(); } }); }); Modal._jQueryInterface.call($(target), config, this); }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$5] = Modal._jQueryInterface; $.fn[NAME$5].Constructor = Modal; $.fn[NAME$5].noConflict = function () { $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; return Modal._jQueryInterface; }; /** * -------------------------------------------------------------------------- * Bootstrap (v4.3.1): tools/sanitizer.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; var DefaultWhitelist = { // Global attributes allowed on any supplied element below. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], a: ['target', 'href', 'title', 'rel'], area: [], b: [], br: [], col: [], code: [], div: [], em: [], hr: [], h1: [], h2: [], h3: [], h4: [], h5: [], h6: [], i: [], img: ['src', 'alt', 'title', 'width', 'height'], li: [], ol: [], p: [], pre: [], s: [], small: [], span: [], sub: [], sup: [], strong: [], u: [], ul: [] /** * A pattern that recognizes a commonly useful subset of URLs that are safe. * * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts */ }; var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; /** * A pattern that matches safe data URLs. Only matches image, video and audio types. * * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts */ var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; function allowedAttribute(attr, allowedAttributeList) { var attrName = attr.nodeName.toLowerCase(); if (allowedAttributeList.indexOf(attrName) !== -1) { if (uriAttrs.indexOf(attrName) !== -1) { return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); } return true; } var regExp = allowedAttributeList.filter(function (attrRegex) { return attrRegex instanceof RegExp; }); // Check if a regular expression validates the attribute. for (var i = 0, l = regExp.length; i < l; i++) { if (attrName.match(regExp[i])) { return true; } } return false; } function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { if (unsafeHtml.length === 0) { return unsafeHtml; } if (sanitizeFn && typeof sanitizeFn === 'function') { return sanitizeFn(unsafeHtml); } var domParser = new window.DOMParser(); var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); var whitelistKeys = Object.keys(whiteList); var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); var _loop = function _loop(i, len) { var el = elements[i]; var elName = el.nodeName.toLowerCase(); if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { el.parentNode.removeChild(el); return "continue"; } var attributeList = [].slice.call(el.attributes); var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); attributeList.forEach(function (attr) { if (!allowedAttribute(attr, whitelistedAttributes)) { el.removeAttribute(attr.nodeName); } }); }; for (var i = 0, len = elements.length; i < len; i++) { var _ret = _loop(i, len); if (_ret === "continue") continue; } return createdDocument.body.innerHTML; } /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$6 = 'tooltip'; var VERSION$6 = '4.3.1'; var DATA_KEY$6 = 'bs.tooltip'; var EVENT_KEY$6 = "." + DATA_KEY$6; var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; var CLASS_PREFIX = 'bs-tooltip'; var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; var DefaultType$4 = { animation: 'boolean', template: 'string', title: '(string|element|function)', trigger: 'string', delay: '(number|object)', html: 'boolean', selector: '(string|boolean)', placement: '(string|function)', offset: '(number|string|function)', container: '(string|element|boolean)', fallbackPlacement: '(string|array)', boundary: '(string|element)', sanitize: 'boolean', sanitizeFn: '(null|function)', whiteList: 'object' }; var AttachmentMap$1 = { AUTO: 'auto', TOP: 'top', RIGHT: 'right', BOTTOM: 'bottom', LEFT: 'left' }; var Default$4 = { animation: true, template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', trigger: 'hover focus', title: '', delay: 0, html: false, selector: false, placement: 'top', offset: 0, container: false, fallbackPlacement: 'flip', boundary: 'scrollParent', sanitize: true, sanitizeFn: null, whiteList: DefaultWhitelist }; var HoverState = { SHOW: 'show', OUT: 'out' }; var Event$6 = { HIDE: "hide" + EVENT_KEY$6, HIDDEN: "hidden" + EVENT_KEY$6, SHOW: "show" + EVENT_KEY$6, SHOWN: "shown" + EVENT_KEY$6, INSERTED: "inserted" + EVENT_KEY$6, CLICK: "click" + EVENT_KEY$6, FOCUSIN: "focusin" + EVENT_KEY$6, FOCUSOUT: "focusout" + EVENT_KEY$6, MOUSEENTER: "mouseenter" + EVENT_KEY$6, MOUSELEAVE: "mouseleave" + EVENT_KEY$6 }; var ClassName$6 = { FADE: 'fade', SHOW: 'show' }; var Selector$6 = { TOOLTIP: '.tooltip', TOOLTIP_INNER: '.tooltip-inner', ARROW: '.arrow' }; var Trigger = { HOVER: 'hover', FOCUS: 'focus', CLICK: 'click', MANUAL: 'manual' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Tooltip = /*#__PURE__*/ function () { function Tooltip(element, config) { /** * Check for Popper dependency * Popper - https://popper.js.org */ if (typeof Popper === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); } // private this._isEnabled = true; this._timeout = 0; this._hoverState = ''; this._activeTrigger = {}; this._popper = null; // Protected this.element = element; this.config = this._getConfig(config); this.tip = null; this._setListeners(); } // Getters var _proto = Tooltip.prototype; // Public _proto.enable = function enable() { this._isEnabled = true; }; _proto.disable = function disable() { this._isEnabled = false; }; _proto.toggleEnabled = function toggleEnabled() { this._isEnabled = !this._isEnabled; }; _proto.toggle = function toggle(event) { if (!this._isEnabled) { return; } if (event) { var dataKey = this.constructor.DATA_KEY; var context = $(event.currentTarget).data(dataKey); if (!context) { context = new this.constructor(event.currentTarget, this._getDelegateConfig()); $(event.currentTarget).data(dataKey, context); } context._activeTrigger.click = !context._activeTrigger.click; if (context._isWithActiveTrigger()) { context._enter(null, context); } else { context._leave(null, context); } } else { if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) { this._leave(null, this); return; } this._enter(null, this); } }; _proto.dispose = function dispose() { clearTimeout(this._timeout); $.removeData(this.element, this.constructor.DATA_KEY); $(this.element).off(this.constructor.EVENT_KEY); $(this.element).closest('.modal').off('hide.bs.modal'); if (this.tip) { $(this.tip).remove(); } this._isEnabled = null; this._timeout = null; this._hoverState = null; this._activeTrigger = null; if (this._popper !== null) { this._popper.destroy(); } this._popper = null; this.element = null; this.config = null; this.tip = null; }; _proto.show = function show() { var _this = this; if ($(this.element).css('display') === 'none') { throw new Error('Please use show on visible elements'); } var showEvent = $.Event(this.constructor.Event.SHOW); if (this.isWithContent() && this._isEnabled) { $(this.element).trigger(showEvent); var shadowRoot = Util.findShadowRoot(this.element); var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); if (showEvent.isDefaultPrevented() || !isInTheDom) { return; } var tip = this.getTipElement(); var tipId = Util.getUID(this.constructor.NAME); tip.setAttribute('id', tipId); this.element.setAttribute('aria-describedby', tipId); this.setContent(); if (this.config.animation) { $(tip).addClass(ClassName$6.FADE); } var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; var attachment = this._getAttachment(placement); this.addAttachmentClass(attachment); var container = this._getContainer(); $(tip).data(this.constructor.DATA_KEY, this); if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { $(tip).appendTo(container); } $(this.element).trigger(this.constructor.Event.INSERTED); this._popper = new Popper(this.element, tip, { placement: attachment, modifiers: { offset: this._getOffset(), flip: { behavior: this.config.fallbackPlacement }, arrow: { element: Selector$6.ARROW }, preventOverflow: { boundariesElement: this.config.boundary } }, onCreate: function onCreate(data) { if (data.originalPlacement !== data.placement) { _this._handlePopperPlacementChange(data); } }, onUpdate: function onUpdate(data) { return _this._handlePopperPlacementChange(data); } }); $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html if ('ontouchstart' in document.documentElement) { $(document.body).children().on('mouseover', null, $.noop); } var complete = function complete() { if (_this.config.animation) { _this._fixTransition(); } var prevHoverState = _this._hoverState; _this._hoverState = null; $(_this.element).trigger(_this.constructor.Event.SHOWN); if (prevHoverState === HoverState.OUT) { _this._leave(null, _this); } }; if ($(this.tip).hasClass(ClassName$6.FADE)) { var transitionDuration = Util.getTransitionDurationFromElement(this.tip); $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); } else { complete(); } } }; _proto.hide = function hide(callback) { var _this2 = this; var tip = this.getTipElement(); var hideEvent = $.Event(this.constructor.Event.HIDE); var complete = function complete() { if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { tip.parentNode.removeChild(tip); } _this2._cleanTipClass(); _this2.element.removeAttribute('aria-describedby'); $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); if (_this2._popper !== null) { _this2._popper.destroy(); } if (callback) { callback(); } }; $(this.element).trigger(hideEvent); if (hideEvent.isDefaultPrevented()) { return; } $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support if ('ontouchstart' in document.documentElement) { $(document.body).children().off('mouseover', null, $.noop); } this._activeTrigger[Trigger.CLICK] = false; this._activeTrigger[Trigger.FOCUS] = false; this._activeTrigger[Trigger.HOVER] = false; if ($(this.tip).hasClass(ClassName$6.FADE)) { var transitionDuration = Util.getTransitionDurationFromElement(tip); $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); } else { complete(); } this._hoverState = ''; }; _proto.update = function update() { if (this._popper !== null) { this._popper.scheduleUpdate(); } } // Protected ; _proto.isWithContent = function isWithContent() { return Boolean(this.getTitle()); }; _proto.addAttachmentClass = function addAttachmentClass(attachment) { $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); }; _proto.getTipElement = function getTipElement() { this.tip = this.tip || $(this.config.template)[0]; return this.tip; }; _proto.setContent = function setContent() { var tip = this.getTipElement(); this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle()); $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW); }; _proto.setElementContent = function setElementContent($element, content) { if (typeof content === 'object' && (content.nodeType || content.jquery)) { // Content is a DOM node or a jQuery if (this.config.html) { if (!$(content).parent().is($element)) { $element.empty().append(content); } } else { $element.text($(content).text()); } return; } if (this.config.html) { if (this.config.sanitize) { content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); } $element.html(content); } else { $element.text(content); } }; _proto.getTitle = function getTitle() { var title = this.element.getAttribute('data-original-title'); if (!title) { title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; } return title; } // Private ; _proto._getOffset = function _getOffset() { var _this3 = this; var offset = {}; if (typeof this.config.offset === 'function') { offset.fn = function (data) { data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); return data; }; } else { offset.offset = this.config.offset; } return offset; }; _proto._getContainer = function _getContainer() { if (this.config.container === false) { return document.body; } if (Util.isElement(this.config.container)) { return $(this.config.container); } return $(document).find(this.config.container); }; _proto._getAttachment = function _getAttachment(placement) { return AttachmentMap$1[placement.toUpperCase()]; }; _proto._setListeners = function _setListeners() { var _this4 = this; var triggers = this.config.trigger.split(' '); triggers.forEach(function (trigger) { if (trigger === 'click') { $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { return _this4.toggle(event); }); } else if (trigger !== Trigger.MANUAL) { var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; $(_this4.element).on(eventIn, _this4.config.selector, function (event) { return _this4._enter(event); }).on(eventOut, _this4.config.selector, function (event) { return _this4._leave(event); }); } }); $(this.element).closest('.modal').on('hide.bs.modal', function () { if (_this4.element) { _this4.hide(); } }); if (this.config.selector) { this.config = _objectSpread({}, this.config, { trigger: 'manual', selector: '' }); } else { this._fixTitle(); } }; _proto._fixTitle = function _fixTitle() { var titleType = typeof this.element.getAttribute('data-original-title'); if (this.element.getAttribute('title') || titleType !== 'string') { this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); this.element.setAttribute('title', ''); } }; _proto._enter = function _enter(event, context) { var dataKey = this.constructor.DATA_KEY; context = context || $(event.currentTarget).data(dataKey); if (!context) { context = new this.constructor(event.currentTarget, this._getDelegateConfig()); $(event.currentTarget).data(dataKey, context); } if (event) { context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; } if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { context._hoverState = HoverState.SHOW; return; } clearTimeout(context._timeout); context._hoverState = HoverState.SHOW; if (!context.config.delay || !context.config.delay.show) { context.show(); return; } context._timeout = setTimeout(function () { if (context._hoverState === HoverState.SHOW) { context.show(); } }, context.config.delay.show); }; _proto._leave = function _leave(event, context) { var dataKey = this.constructor.DATA_KEY; context = context || $(event.currentTarget).data(dataKey); if (!context) { context = new this.constructor(event.currentTarget, this._getDelegateConfig()); $(event.currentTarget).data(dataKey, context); } if (event) { context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; } if (context._isWithActiveTrigger()) { return; } clearTimeout(context._timeout); context._hoverState = HoverState.OUT; if (!context.config.delay || !context.config.delay.hide) { context.hide(); return; } context._timeout = setTimeout(function () { if (context._hoverState === HoverState.OUT) { context.hide(); } }, context.config.delay.hide); }; _proto._isWithActiveTrigger = function _isWithActiveTrigger() { for (var trigger in this._activeTrigger) { if (this._activeTrigger[trigger]) { return true; } } return false; }; _proto._getConfig = function _getConfig(config) { var dataAttributes = $(this.element).data(); Object.keys(dataAttributes).forEach(function (dataAttr) { if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { delete dataAttributes[dataAttr]; } }); config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); if (typeof config.delay === 'number') { config.delay = { show: config.delay, hide: config.delay }; } if (typeof config.title === 'number') { config.title = config.title.toString(); } if (typeof config.content === 'number') { config.content = config.content.toString(); } Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); if (config.sanitize) { config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); } return config; }; _proto._getDelegateConfig = function _getDelegateConfig() { var config = {}; if (this.config) { for (var key in this.config) { if (this.constructor.Default[key] !== this.config[key]) { config[key] = this.config[key]; } } } return config; }; _proto._cleanTipClass = function _cleanTipClass() { var $tip = $(this.getTipElement()); var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); if (tabClass !== null && tabClass.length) { $tip.removeClass(tabClass.join('')); } }; _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { var popperInstance = popperData.instance; this.tip = popperInstance.popper; this._cleanTipClass(); this.addAttachmentClass(this._getAttachment(popperData.placement)); }; _proto._fixTransition = function _fixTransition() { var tip = this.getTipElement(); var initConfigAnimation = this.config.animation; if (tip.getAttribute('x-placement') !== null) { return; } $(tip).removeClass(ClassName$6.FADE); this.config.animation = false; this.hide(); this.show(); this.config.animation = initConfigAnimation; } // Static ; Tooltip._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$6); var _config = typeof config === 'object' && config; if (!data && /dispose|hide/.test(config)) { return; } if (!data) { data = new Tooltip(this, _config); $(this).data(DATA_KEY$6, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(Tooltip, null, [{ key: "VERSION", get: function get() { return VERSION$6; } }, { key: "Default", get: function get() { return Default$4; } }, { key: "NAME", get: function get() { return NAME$6; } }, { key: "DATA_KEY", get: function get() { return DATA_KEY$6; } }, { key: "Event", get: function get() { return Event$6; } }, { key: "EVENT_KEY", get: function get() { return EVENT_KEY$6; } }, { key: "DefaultType", get: function get() { return DefaultType$4; } }]); return Tooltip; }(); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$6] = Tooltip._jQueryInterface; $.fn[NAME$6].Constructor = Tooltip; $.fn[NAME$6].noConflict = function () { $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; return Tooltip._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$7 = 'popover'; var VERSION$7 = '4.3.1'; var DATA_KEY$7 = 'bs.popover'; var EVENT_KEY$7 = "." + DATA_KEY$7; var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7]; var CLASS_PREFIX$1 = 'bs-popover'; var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); var Default$5 = _objectSpread({}, Tooltip.Default, { placement: 'right', trigger: 'click', content: '', template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' }); var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { content: '(string|element|function)' }); var ClassName$7 = { FADE: 'fade', SHOW: 'show' }; var Selector$7 = { TITLE: '.popover-header', CONTENT: '.popover-body' }; var Event$7 = { HIDE: "hide" + EVENT_KEY$7, HIDDEN: "hidden" + EVENT_KEY$7, SHOW: "show" + EVENT_KEY$7, SHOWN: "shown" + EVENT_KEY$7, INSERTED: "inserted" + EVENT_KEY$7, CLICK: "click" + EVENT_KEY$7, FOCUSIN: "focusin" + EVENT_KEY$7, FOCUSOUT: "focusout" + EVENT_KEY$7, MOUSEENTER: "mouseenter" + EVENT_KEY$7, MOUSELEAVE: "mouseleave" + EVENT_KEY$7 /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Popover = /*#__PURE__*/ function (_Tooltip) { _inheritsLoose(Popover, _Tooltip); function Popover() { return _Tooltip.apply(this, arguments) || this; } var _proto = Popover.prototype; // Overrides _proto.isWithContent = function isWithContent() { return this.getTitle() || this._getContent(); }; _proto.addAttachmentClass = function addAttachmentClass(attachment) { $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); }; _proto.getTipElement = function getTipElement() { this.tip = this.tip || $(this.config.template)[0]; return this.tip; }; _proto.setContent = function setContent() { var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle()); var content = this._getContent(); if (typeof content === 'function') { content = content.call(this.element); } this.setElementContent($tip.find(Selector$7.CONTENT), content); $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW); } // Private ; _proto._getContent = function _getContent() { return this.element.getAttribute('data-content') || this.config.content; }; _proto._cleanTipClass = function _cleanTipClass() { var $tip = $(this.getTipElement()); var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); if (tabClass !== null && tabClass.length > 0) { $tip.removeClass(tabClass.join('')); } } // Static ; Popover._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$7); var _config = typeof config === 'object' ? config : null; if (!data && /dispose|hide/.test(config)) { return; } if (!data) { data = new Popover(this, _config); $(this).data(DATA_KEY$7, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(Popover, null, [{ key: "VERSION", // Getters get: function get() { return VERSION$7; } }, { key: "Default", get: function get() { return Default$5; } }, { key: "NAME", get: function get() { return NAME$7; } }, { key: "DATA_KEY", get: function get() { return DATA_KEY$7; } }, { key: "Event", get: function get() { return Event$7; } }, { key: "EVENT_KEY", get: function get() { return EVENT_KEY$7; } }, { key: "DefaultType", get: function get() { return DefaultType$5; } }]); return Popover; }(Tooltip); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$7] = Popover._jQueryInterface; $.fn[NAME$7].Constructor = Popover; $.fn[NAME$7].noConflict = function () { $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; return Popover._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$8 = 'scrollspy'; var VERSION$8 = '4.3.1'; var DATA_KEY$8 = 'bs.scrollspy'; var EVENT_KEY$8 = "." + DATA_KEY$8; var DATA_API_KEY$6 = '.data-api'; var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; var Default$6 = { offset: 10, method: 'auto', target: '' }; var DefaultType$6 = { offset: 'number', method: 'string', target: '(string|element)' }; var Event$8 = { ACTIVATE: "activate" + EVENT_KEY$8, SCROLL: "scroll" + EVENT_KEY$8, LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 }; var ClassName$8 = { DROPDOWN_ITEM: 'dropdown-item', DROPDOWN_MENU: 'dropdown-menu', ACTIVE: 'active' }; var Selector$8 = { DATA_SPY: '[data-spy="scroll"]', ACTIVE: '.active', NAV_LIST_GROUP: '.nav, .list-group', NAV_LINKS: '.nav-link', NAV_ITEMS: '.nav-item', LIST_ITEMS: '.list-group-item', DROPDOWN: '.dropdown', DROPDOWN_ITEMS: '.dropdown-item', DROPDOWN_TOGGLE: '.dropdown-toggle' }; var OffsetMethod = { OFFSET: 'offset', POSITION: 'position' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var ScrollSpy = /*#__PURE__*/ function () { function ScrollSpy(element, config) { var _this = this; this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; this._config = this._getConfig(config); this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS); this._offsets = []; this._targets = []; this._activeTarget = null; this._scrollHeight = 0; $(this._scrollElement).on(Event$8.SCROLL, function (event) { return _this._process(event); }); this.refresh(); this._process(); } // Getters var _proto = ScrollSpy.prototype; // Public _proto.refresh = function refresh() { var _this2 = this; var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; this._offsets = []; this._targets = []; this._scrollHeight = this._getScrollHeight(); var targets = [].slice.call(document.querySelectorAll(this._selector)); targets.map(function (element) { var target; var targetSelector = Util.getSelectorFromElement(element); if (targetSelector) { target = document.querySelector(targetSelector); } if (target) { var targetBCR = target.getBoundingClientRect(); if (targetBCR.width || targetBCR.height) { // TODO (fat): remove sketch reliance on jQuery position/offset return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; } } return null; }).filter(function (item) { return item; }).sort(function (a, b) { return a[0] - b[0]; }).forEach(function (item) { _this2._offsets.push(item[0]); _this2._targets.push(item[1]); }); }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY$8); $(this._scrollElement).off(EVENT_KEY$8); this._element = null; this._scrollElement = null; this._config = null; this._selector = null; this._offsets = null; this._targets = null; this._activeTarget = null; this._scrollHeight = null; } // Private ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); if (typeof config.target !== 'string') { var id = $(config.target).attr('id'); if (!id) { id = Util.getUID(NAME$8); $(config.target).attr('id', id); } config.target = "#" + id; } Util.typeCheckConfig(NAME$8, config, DefaultType$6); return config; }; _proto._getScrollTop = function _getScrollTop() { return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; }; _proto._getScrollHeight = function _getScrollHeight() { return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); }; _proto._getOffsetHeight = function _getOffsetHeight() { return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; }; _proto._process = function _process() { var scrollTop = this._getScrollTop() + this._config.offset; var scrollHeight = this._getScrollHeight(); var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); if (this._scrollHeight !== scrollHeight) { this.refresh(); } if (scrollTop >= maxScroll) { var target = this._targets[this._targets.length - 1]; if (this._activeTarget !== target) { this._activate(target); } return; } if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { this._activeTarget = null; this._clear(); return; } var offsetLength = this._offsets.length; for (var i = offsetLength; i--;) { var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); if (isActiveTarget) { this._activate(this._targets[i]); } } }; _proto._activate = function _activate(target) { this._activeTarget = target; this._clear(); var queries = this._selector.split(',').map(function (selector) { return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; }); var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) { $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE); $link.addClass(ClassName$8.ACTIVE); } else { // Set triggered link as active $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE); } $(this._scrollElement).trigger(Event$8.ACTIVATE, { relatedTarget: target }); }; _proto._clear = function _clear() { [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { return node.classList.contains(ClassName$8.ACTIVE); }).forEach(function (node) { return node.classList.remove(ClassName$8.ACTIVE); }); } // Static ; ScrollSpy._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY$8); var _config = typeof config === 'object' && config; if (!data) { data = new ScrollSpy(this, _config); $(this).data(DATA_KEY$8, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(ScrollSpy, null, [{ key: "VERSION", get: function get() { return VERSION$8; } }, { key: "Default", get: function get() { return Default$6; } }]); return ScrollSpy; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(window).on(Event$8.LOAD_DATA_API, function () { var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY)); var scrollSpysLength = scrollSpys.length; for (var i = scrollSpysLength; i--;) { var $spy = $(scrollSpys[i]); ScrollSpy._jQueryInterface.call($spy, $spy.data()); } }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$8] = ScrollSpy._jQueryInterface; $.fn[NAME$8].Constructor = ScrollSpy; $.fn[NAME$8].noConflict = function () { $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; return ScrollSpy._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$9 = 'tab'; var VERSION$9 = '4.3.1'; var DATA_KEY$9 = 'bs.tab'; var EVENT_KEY$9 = "." + DATA_KEY$9; var DATA_API_KEY$7 = '.data-api'; var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; var Event$9 = { HIDE: "hide" + EVENT_KEY$9, HIDDEN: "hidden" + EVENT_KEY$9, SHOW: "show" + EVENT_KEY$9, SHOWN: "shown" + EVENT_KEY$9, CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 }; var ClassName$9 = { DROPDOWN_MENU: 'dropdown-menu', ACTIVE: 'active', DISABLED: 'disabled', FADE: 'fade', SHOW: 'show' }; var Selector$9 = { DROPDOWN: '.dropdown', NAV_LIST_GROUP: '.nav, .list-group', ACTIVE: '.active', ACTIVE_UL: '> li > .active', DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DROPDOWN_TOGGLE: '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Tab = /*#__PURE__*/ function () { function Tab(element) { this._element = element; } // Getters var _proto = Tab.prototype; // Public _proto.show = function show() { var _this = this; if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) { return; } var target; var previous; var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0]; var selector = Util.getSelectorFromElement(this._element); if (listElement) { var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; previous = $.makeArray($(listElement).find(itemSelector)); previous = previous[previous.length - 1]; } var hideEvent = $.Event(Event$9.HIDE, { relatedTarget: this._element }); var showEvent = $.Event(Event$9.SHOW, { relatedTarget: previous }); if (previous) { $(previous).trigger(hideEvent); } $(this._element).trigger(showEvent); if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { return; } if (selector) { target = document.querySelector(selector); } this._activate(this._element, listElement); var complete = function complete() { var hiddenEvent = $.Event(Event$9.HIDDEN, { relatedTarget: _this._element }); var shownEvent = $.Event(Event$9.SHOWN, { relatedTarget: previous }); $(previous).trigger(hiddenEvent); $(_this._element).trigger(shownEvent); }; if (target) { this._activate(target, target.parentNode, complete); } else { complete(); } }; _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY$9); this._element = null; } // Private ; _proto._activate = function _activate(element, container, callback) { var _this2 = this; var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE); var active = activeElements[0]; var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE); var complete = function complete() { return _this2._transitionComplete(element, active, callback); }; if (active && isTransitioning) { var transitionDuration = Util.getTransitionDurationFromElement(active); $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); } else { complete(); } }; _proto._transitionComplete = function _transitionComplete(element, active, callback) { if (active) { $(active).removeClass(ClassName$9.ACTIVE); var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0]; if (dropdownChild) { $(dropdownChild).removeClass(ClassName$9.ACTIVE); } if (active.getAttribute('role') === 'tab') { active.setAttribute('aria-selected', false); } } $(element).addClass(ClassName$9.ACTIVE); if (element.getAttribute('role') === 'tab') { element.setAttribute('aria-selected', true); } Util.reflow(element); if (element.classList.contains(ClassName$9.FADE)) { element.classList.add(ClassName$9.SHOW); } if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) { var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0]; if (dropdownElement) { var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE)); $(dropdownToggleList).addClass(ClassName$9.ACTIVE); } element.setAttribute('aria-expanded', true); } if (callback) { callback(); } } // Static ; Tab._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var $this = $(this); var data = $this.data(DATA_KEY$9); if (!data) { data = new Tab(this); $this.data(DATA_KEY$9, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(Tab, null, [{ key: "VERSION", get: function get() { return VERSION$9; } }]); return Tab; }(); /** * ------------------------------------------------------------------------ * Data Api implementation * ------------------------------------------------------------------------ */ $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { event.preventDefault(); Tab._jQueryInterface.call($(this), 'show'); }); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$9] = Tab._jQueryInterface; $.fn[NAME$9].Constructor = Tab; $.fn[NAME$9].noConflict = function () { $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; return Tab._jQueryInterface; }; /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME$a = 'toast'; var VERSION$a = '4.3.1'; var DATA_KEY$a = 'bs.toast'; var EVENT_KEY$a = "." + DATA_KEY$a; var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; var Event$a = { CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, HIDE: "hide" + EVENT_KEY$a, HIDDEN: "hidden" + EVENT_KEY$a, SHOW: "show" + EVENT_KEY$a, SHOWN: "shown" + EVENT_KEY$a }; var ClassName$a = { FADE: 'fade', HIDE: 'hide', SHOW: 'show', SHOWING: 'showing' }; var DefaultType$7 = { animation: 'boolean', autohide: 'boolean', delay: 'number' }; var Default$7 = { animation: true, autohide: true, delay: 500 }; var Selector$a = { DATA_DISMISS: '[data-dismiss="toast"]' /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ }; var Toast = /*#__PURE__*/ function () { function Toast(element, config) { this._element = element; this._config = this._getConfig(config); this._timeout = null; this._setListeners(); } // Getters var _proto = Toast.prototype; // Public _proto.show = function show() { var _this = this; $(this._element).trigger(Event$a.SHOW); if (this._config.animation) { this._element.classList.add(ClassName$a.FADE); } var complete = function complete() { _this._element.classList.remove(ClassName$a.SHOWING); _this._element.classList.add(ClassName$a.SHOW); $(_this._element).trigger(Event$a.SHOWN); if (_this._config.autohide) { _this.hide(); } }; this._element.classList.remove(ClassName$a.HIDE); this._element.classList.add(ClassName$a.SHOWING); if (this._config.animation) { var transitionDuration = Util.getTransitionDurationFromElement(this._element); $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); } else { complete(); } }; _proto.hide = function hide(withoutTimeout) { var _this2 = this; if (!this._element.classList.contains(ClassName$a.SHOW)) { return; } $(this._element).trigger(Event$a.HIDE); if (withoutTimeout) { this._close(); } else { this._timeout = setTimeout(function () { _this2._close(); }, this._config.delay); } }; _proto.dispose = function dispose() { clearTimeout(this._timeout); this._timeout = null; if (this._element.classList.contains(ClassName$a.SHOW)) { this._element.classList.remove(ClassName$a.SHOW); } $(this._element).off(Event$a.CLICK_DISMISS); $.removeData(this._element, DATA_KEY$a); this._element = null; this._config = null; } // Private ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {}); Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); return config; }; _proto._setListeners = function _setListeners() { var _this3 = this; $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { return _this3.hide(true); }); }; _proto._close = function _close() { var _this4 = this; var complete = function complete() { _this4._element.classList.add(ClassName$a.HIDE); $(_this4._element).trigger(Event$a.HIDDEN); }; this._element.classList.remove(ClassName$a.SHOW); if (this._config.animation) { var transitionDuration = Util.getTransitionDurationFromElement(this._element); $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); } else { complete(); } } // Static ; Toast._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var $element = $(this); var data = $element.data(DATA_KEY$a); var _config = typeof config === 'object' && config; if (!data) { data = new Toast(this, _config); $element.data(DATA_KEY$a, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new TypeError("No method named \"" + config + "\""); } data[config](this); } }); }; _createClass(Toast, null, [{ key: "VERSION", get: function get() { return VERSION$a; } }, { key: "DefaultType", get: function get() { return DefaultType$7; } }, { key: "Default", get: function get() { return Default$7; } }]); return Toast; }(); /** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ */ $.fn[NAME$a] = Toast._jQueryInterface; $.fn[NAME$a].Constructor = Toast; $.fn[NAME$a].noConflict = function () { $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; return Toast._jQueryInterface; }; /** * -------------------------------------------------------------------------- * Bootstrap (v4.3.1): index.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ (function () { if (typeof $ === 'undefined') { throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); } var version = $.fn.jquery.split(' ')[0].split('.'); var minMajor = 1; var ltMajor = 2; var minMinor = 9; var minPatch = 1; var maxMajor = 4; if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); } })(); exports.Util = Util; exports.Alert = Alert; exports.Button = Button; exports.Carousel = Carousel; exports.Collapse = Collapse; exports.Dropdown = Dropdown; exports.Modal = Modal; exports.Popover = Popover; exports.Scrollspy = ScrollSpy; exports.Tab = Tab; exports.Toast = Toast; exports.Tooltip = Tooltip; Object.defineProperty(exports, '__esModule', { value: true }); })); (function($) { var cocoon_element_counter = 0; var create_new_id = function() { return (new Date().getTime() + cocoon_element_counter++); } var newcontent_braced = function(id) { return '[' + id + ']$1'; } var newcontent_underscord = function(id) { return '_' + id + '_$1'; } var getInsertionNodeElem = function(insertionNode, insertionTraversal, $this){ if (!insertionNode){ return $this.parent(); } if (typeof insertionNode == 'function'){ if(insertionTraversal){ console.warn('association-insertion-traversal is ignored, because association-insertion-node is given as a function.') } return insertionNode($this); } if(typeof insertionNode == 'string'){ if (insertionTraversal){ return $this[insertionTraversal](insertionNode); }else{ return insertionNode == "this" ? $this : $(insertionNode); } } } $(document).on('click', '.add_fields', function(e) { e.preventDefault(); var $this = $(this), assoc = $this.data('association'), assocs = $this.data('associations'), content = $this.data('association-insertion-template'), insertionMethod = $this.data('association-insertion-method') || $this.data('association-insertion-position') || 'before', insertionNode = $this.data('association-insertion-node'), insertionTraversal = $this.data('association-insertion-traversal'), count = parseInt($this.data('count'), 10), regexp_braced = new RegExp('\\[new_' + assoc + '\\](.*?\\s)', 'g'), regexp_underscord = new RegExp('_new_' + assoc + '_(\\w*)', 'g'), new_id = create_new_id(), new_content = content.replace(regexp_braced, newcontent_braced(new_id)), new_contents = [], originalEvent = e; if (new_content == content) { regexp_braced = new RegExp('\\[new_' + assocs + '\\](.*?\\s)', 'g'); regexp_underscord = new RegExp('_new_' + assocs + '_(\\w*)', 'g'); new_content = content.replace(regexp_braced, newcontent_braced(new_id)); } new_content = new_content.replace(regexp_underscord, newcontent_underscord(new_id)); new_contents = [new_content]; count = (isNaN(count) ? 1 : Math.max(count, 1)); count -= 1; while (count) { new_id = create_new_id(); new_content = content.replace(regexp_braced, newcontent_braced(new_id)); new_content = new_content.replace(regexp_underscord, newcontent_underscord(new_id)); new_contents.push(new_content); count -= 1; } var insertionNodeElem = getInsertionNodeElem(insertionNode, insertionTraversal, $this) if( !insertionNodeElem || (insertionNodeElem.length == 0) ){ console.warn("Couldn't find the element to insert the template. Make sure your `data-association-insertion-*` on `link_to_add_association` is correct.") } $.each(new_contents, function(i, node) { var contentNode = $(node); var before_insert = jQuery.Event('cocoon:before-insert'); insertionNodeElem.trigger(before_insert, [contentNode, originalEvent]); if (!before_insert.isDefaultPrevented()) { // allow any of the jquery dom manipulation methods (after, before, append, prepend, etc) // to be called on the node. allows the insertion node to be the parent of the inserted // code and doesn't force it to be a sibling like after/before does. default: 'before' var addedContent = insertionNodeElem[insertionMethod](contentNode); insertionNodeElem.trigger('cocoon:after-insert', [contentNode, originalEvent]); } }); }); $(document).on('click', '.remove_fields.dynamic, .remove_fields.existing', function(e) { var $this = $(this), wrapper_class = $this.data('wrapper-class') || 'nested-fields', node_to_delete = $this.closest('.' + wrapper_class), trigger_node = node_to_delete.parent(), originalEvent = e; e.preventDefault(); e.stopPropagation(); var before_remove = jQuery.Event('cocoon:before-remove'); trigger_node.trigger(before_remove, [node_to_delete, originalEvent]); if (!before_remove.isDefaultPrevented()) { var timeout = trigger_node.data('remove-timeout') || 0; setTimeout(function() { if ($this.hasClass('dynamic')) { node_to_delete.detach(); } else { $this.prev("input[type=hidden]").val("1"); node_to_delete.hide(); } trigger_node.trigger('cocoon:after-remove', [node_to_delete, originalEvent]); }, timeout); } }); $(document).on("ready page:load turbolinks:load", function() { $('.remove_fields.existing.destroyed').each(function(i, obj) { var $this = $(this), wrapper_class = $this.data('wrapper-class') || 'nested-fields'; $this.closest('.' + wrapper_class).hide(); }); }); })(jQuery); (function() { (function() { (function() { var slice = [].slice; this.ActionCable = { INTERNAL: { "message_types": { "welcome": "welcome", "ping": "ping", "confirmation": "confirm_subscription", "rejection": "reject_subscription" }, "default_mount_path": "/cable", "protocols": ["actioncable-v1-json", "actioncable-unsupported"] }, createConsumer: function(url) { var ref; if (url == null) { url = (ref = this.getConfig("url")) != null ? ref : this.INTERNAL.default_mount_path; } return new ActionCable.Consumer(this.createWebSocketURL(url)); }, getConfig: function(name) { var element; element = document.head.querySelector("meta[name='action-cable-" + name + "']"); return element != null ? element.getAttribute("content") : void 0; }, createWebSocketURL: function(url) { var a; if (url && !/^wss?:/i.test(url)) { a = document.createElement("a"); a.href = url; a.href = a.href; a.protocol = a.protocol.replace("http", "ws"); return a.href; } else { return url; } }, startDebugging: function() { return this.debugging = true; }, stopDebugging: function() { return this.debugging = null; }, log: function() { var messages; messages = 1 <= arguments.length ? slice.call(arguments, 0) : []; if (this.debugging) { messages.push(Date.now()); return console.log.apply(console, ["[ActionCable]"].concat(slice.call(messages))); } } }; }).call(this); }).call(this); var ActionCable = this.ActionCable; (function() { (function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; ActionCable.ConnectionMonitor = (function() { var clamp, now, secondsSince; ConnectionMonitor.pollInterval = { min: 3, max: 30 }; ConnectionMonitor.staleThreshold = 6; function ConnectionMonitor(connection) { this.connection = connection; this.visibilityDidChange = bind(this.visibilityDidChange, this); this.reconnectAttempts = 0; } ConnectionMonitor.prototype.start = function() { if (!this.isRunning()) { this.startedAt = now(); delete this.stoppedAt; this.startPolling(); document.addEventListener("visibilitychange", this.visibilityDidChange); return ActionCable.log("ConnectionMonitor started. pollInterval = " + (this.getPollInterval()) + " ms"); } }; ConnectionMonitor.prototype.stop = function() { if (this.isRunning()) { this.stoppedAt = now(); this.stopPolling(); document.removeEventListener("visibilitychange", this.visibilityDidChange); return ActionCable.log("ConnectionMonitor stopped"); } }; ConnectionMonitor.prototype.isRunning = function() { return (this.startedAt != null) && (this.stoppedAt == null); }; ConnectionMonitor.prototype.recordPing = function() { return this.pingedAt = now(); }; ConnectionMonitor.prototype.recordConnect = function() { this.reconnectAttempts = 0; this.recordPing(); delete this.disconnectedAt; return ActionCable.log("ConnectionMonitor recorded connect"); }; ConnectionMonitor.prototype.recordDisconnect = function() { this.disconnectedAt = now(); return ActionCable.log("ConnectionMonitor recorded disconnect"); }; ConnectionMonitor.prototype.startPolling = function() { this.stopPolling(); return this.poll(); }; ConnectionMonitor.prototype.stopPolling = function() { return clearTimeout(this.pollTimeout); }; ConnectionMonitor.prototype.poll = function() { return this.pollTimeout = setTimeout((function(_this) { return function() { _this.reconnectIfStale(); return _this.poll(); }; })(this), this.getPollInterval()); }; ConnectionMonitor.prototype.getPollInterval = function() { var interval, max, min, ref; ref = this.constructor.pollInterval, min = ref.min, max = ref.max; interval = 5 * Math.log(this.reconnectAttempts + 1); return Math.round(clamp(interval, min, max) * 1000); }; ConnectionMonitor.prototype.reconnectIfStale = function() { if (this.connectionIsStale()) { ActionCable.log("ConnectionMonitor detected stale connection. reconnectAttempts = " + this.reconnectAttempts + ", pollInterval = " + (this.getPollInterval()) + " ms, time disconnected = " + (secondsSince(this.disconnectedAt)) + " s, stale threshold = " + this.constructor.staleThreshold + " s"); this.reconnectAttempts++; if (this.disconnectedRecently()) { return ActionCable.log("ConnectionMonitor skipping reopening recent disconnect"); } else { ActionCable.log("ConnectionMonitor reopening"); return this.connection.reopen(); } } }; ConnectionMonitor.prototype.connectionIsStale = function() { var ref; return secondsSince((ref = this.pingedAt) != null ? ref : this.startedAt) > this.constructor.staleThreshold; }; ConnectionMonitor.prototype.disconnectedRecently = function() { return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold; }; ConnectionMonitor.prototype.visibilityDidChange = function() { if (document.visibilityState === "visible") { return setTimeout((function(_this) { return function() { if (_this.connectionIsStale() || !_this.connection.isOpen()) { ActionCable.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = " + document.visibilityState); return _this.connection.reopen(); } }; })(this), 200); } }; now = function() { return new Date().getTime(); }; secondsSince = function(time) { return (now() - time) / 1000; }; clamp = function(number, min, max) { return Math.max(min, Math.min(max, number)); }; return ConnectionMonitor; })(); }).call(this); (function() { var i, message_types, protocols, ref, supportedProtocols, unsupportedProtocol, slice = [].slice, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; ref = ActionCable.INTERNAL, message_types = ref.message_types, protocols = ref.protocols; supportedProtocols = 2 <= protocols.length ? slice.call(protocols, 0, i = protocols.length - 1) : (i = 0, []), unsupportedProtocol = protocols[i++]; ActionCable.Connection = (function() { Connection.reopenDelay = 500; function Connection(consumer) { this.consumer = consumer; this.open = bind(this.open, this); this.subscriptions = this.consumer.subscriptions; this.monitor = new ActionCable.ConnectionMonitor(this); this.disconnected = true; } Connection.prototype.send = function(data) { if (this.isOpen()) { this.webSocket.send(JSON.stringify(data)); return true; } else { return false; } }; Connection.prototype.open = function() { if (this.isActive()) { ActionCable.log("Attempted to open WebSocket, but existing socket is " + (this.getState())); throw new Error("Existing connection must be closed before opening"); } else { ActionCable.log("Opening WebSocket, current state is " + (this.getState()) + ", subprotocols: " + protocols); if (this.webSocket != null) { this.uninstallEventHandlers(); } this.webSocket = new WebSocket(this.consumer.url, protocols); this.installEventHandlers(); this.monitor.start(); return true; } }; Connection.prototype.close = function(arg) { var allowReconnect, ref1; allowReconnect = (arg != null ? arg : { allowReconnect: true }).allowReconnect; if (!allowReconnect) { this.monitor.stop(); } if (this.isActive()) { return (ref1 = this.webSocket) != null ? ref1.close() : void 0; } }; Connection.prototype.reopen = function() { var error; ActionCable.log("Reopening WebSocket, current state is " + (this.getState())); if (this.isActive()) { try { return this.close(); } catch (error1) { error = error1; return ActionCable.log("Failed to reopen WebSocket", error); } finally { ActionCable.log("Reopening WebSocket in " + this.constructor.reopenDelay + "ms"); setTimeout(this.open, this.constructor.reopenDelay); } } else { return this.open(); } }; Connection.prototype.getProtocol = function() { var ref1; return (ref1 = this.webSocket) != null ? ref1.protocol : void 0; }; Connection.prototype.isOpen = function() { return this.isState("open"); }; Connection.prototype.isActive = function() { return this.isState("open", "connecting"); }; Connection.prototype.isProtocolSupported = function() { var ref1; return ref1 = this.getProtocol(), indexOf.call(supportedProtocols, ref1) >= 0; }; Connection.prototype.isState = function() { var ref1, states; states = 1 <= arguments.length ? slice.call(arguments, 0) : []; return ref1 = this.getState(), indexOf.call(states, ref1) >= 0; }; Connection.prototype.getState = function() { var ref1, state, value; for (state in WebSocket) { value = WebSocket[state]; if (value === ((ref1 = this.webSocket) != null ? ref1.readyState : void 0)) { return state.toLowerCase(); } } return null; }; Connection.prototype.installEventHandlers = function() { var eventName, handler; for (eventName in this.events) { handler = this.events[eventName].bind(this); this.webSocket["on" + eventName] = handler; } }; Connection.prototype.uninstallEventHandlers = function() { var eventName; for (eventName in this.events) { this.webSocket["on" + eventName] = function() {}; } }; Connection.prototype.events = { message: function(event) { var identifier, message, ref1, type; if (!this.isProtocolSupported()) { return; } ref1 = JSON.parse(event.data), identifier = ref1.identifier, message = ref1.message, type = ref1.type; switch (type) { case message_types.welcome: this.monitor.recordConnect(); return this.subscriptions.reload(); case message_types.ping: return this.monitor.recordPing(); case message_types.confirmation: return this.subscriptions.notify(identifier, "connected"); case message_types.rejection: return this.subscriptions.reject(identifier); default: return this.subscriptions.notify(identifier, "received", message); } }, open: function() { ActionCable.log("WebSocket onopen event, using '" + (this.getProtocol()) + "' subprotocol"); this.disconnected = false; if (!this.isProtocolSupported()) { ActionCable.log("Protocol is unsupported. Stopping monitor and disconnecting."); return this.close({ allowReconnect: false }); } }, close: function(event) { ActionCable.log("WebSocket onclose event"); if (this.disconnected) { return; } this.disconnected = true; this.monitor.recordDisconnect(); return this.subscriptions.notifyAll("disconnected", { willAttemptReconnect: this.monitor.isRunning() }); }, error: function() { return ActionCable.log("WebSocket onerror event"); } }; return Connection; })(); }).call(this); (function() { var slice = [].slice; ActionCable.Subscriptions = (function() { function Subscriptions(consumer) { this.consumer = consumer; this.subscriptions = []; } Subscriptions.prototype.create = function(channelName, mixin) { var channel, params, subscription; channel = channelName; params = typeof channel === "object" ? channel : { channel: channel }; subscription = new ActionCable.Subscription(this.consumer, params, mixin); return this.add(subscription); }; Subscriptions.prototype.add = function(subscription) { this.subscriptions.push(subscription); this.consumer.ensureActiveConnection(); this.notify(subscription, "initialized"); this.sendCommand(subscription, "subscribe"); return subscription; }; Subscriptions.prototype.remove = function(subscription) { this.forget(subscription); if (!this.findAll(subscription.identifier).length) { this.sendCommand(subscription, "unsubscribe"); } return subscription; }; Subscriptions.prototype.reject = function(identifier) { var i, len, ref, results, subscription; ref = this.findAll(identifier); results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; this.forget(subscription); this.notify(subscription, "rejected"); results.push(subscription); } return results; }; Subscriptions.prototype.forget = function(subscription) { var s; this.subscriptions = (function() { var i, len, ref, results; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { s = ref[i]; if (s !== subscription) { results.push(s); } } return results; }).call(this); return subscription; }; Subscriptions.prototype.findAll = function(identifier) { var i, len, ref, results, s; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { s = ref[i]; if (s.identifier === identifier) { results.push(s); } } return results; }; Subscriptions.prototype.reload = function() { var i, len, ref, results, subscription; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; results.push(this.sendCommand(subscription, "subscribe")); } return results; }; Subscriptions.prototype.notifyAll = function() { var args, callbackName, i, len, ref, results, subscription; callbackName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; results.push(this.notify.apply(this, [subscription, callbackName].concat(slice.call(args)))); } return results; }; Subscriptions.prototype.notify = function() { var args, callbackName, i, len, results, subscription, subscriptions; subscription = arguments[0], callbackName = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; if (typeof subscription === "string") { subscriptions = this.findAll(subscription); } else { subscriptions = [subscription]; } results = []; for (i = 0, len = subscriptions.length; i < len; i++) { subscription = subscriptions[i]; results.push(typeof subscription[callbackName] === "function" ? subscription[callbackName].apply(subscription, args) : void 0); } return results; }; Subscriptions.prototype.sendCommand = function(subscription, command) { var identifier; identifier = subscription.identifier; return this.consumer.send({ command: command, identifier: identifier }); }; return Subscriptions; })(); }).call(this); (function() { ActionCable.Subscription = (function() { var extend; function Subscription(consumer, params, mixin) { this.consumer = consumer; if (params == null) { params = {}; } this.identifier = JSON.stringify(params); extend(this, mixin); } Subscription.prototype.perform = function(action, data) { if (data == null) { data = {}; } data.action = action; return this.send(data); }; Subscription.prototype.send = function(data) { return this.consumer.send({ command: "message", identifier: this.identifier, data: JSON.stringify(data) }); }; Subscription.prototype.unsubscribe = function() { return this.consumer.subscriptions.remove(this); }; extend = function(object, properties) { var key, value; if (properties != null) { for (key in properties) { value = properties[key]; object[key] = value; } } return object; }; return Subscription; })(); }).call(this); (function() { ActionCable.Consumer = (function() { function Consumer(url) { this.url = url; this.subscriptions = new ActionCable.Subscriptions(this); this.connection = new ActionCable.Connection(this); } Consumer.prototype.send = function(data) { return this.connection.send(data); }; Consumer.prototype.connect = function() { return this.connection.open(); }; Consumer.prototype.disconnect = function() { return this.connection.close({ allowReconnect: false }); }; Consumer.prototype.ensureActiveConnection = function() { if (!this.connection.isActive()) { return this.connection.open(); } }; return Consumer; })(); }).call(this); }).call(this); if (typeof module === "object" && module.exports) { module.exports = ActionCable; } else if (typeof define === "function" && define.amd) { define(ActionCable); } }).call(this); // Action Cable provides the framework to deal with WebSockets in Rails. // You can generate new channels where WebSocket features live using the rails generate channel command. // (function() { this.App || (this.App = {}); App.cable = ActionCable.createConsumer(); }).call(this); // <script type="text/javascript"> // // function get_fio(elmnt,clr) { // var id = "<%=current_user.insints.first.password%>"; // var sub = "<%=current_user.insints.first.subdomen%>"; // var client = clr; // var uri = "http://"+sub+"/admin/clients/"+client+".json"; // var basic = btoa("k-comment:" + id); // console.log(uri); // console.log(basic); // $.ajax({ // type: 'GET', // username: "k-comment", // password: id, // xhrFields: { // withCredentials: true // }, // crossDomain: true, // dataType: 'json', // beforeSend: function (xhr) { // xhr.setRequestHeader('Authorization', 'Basic ' + basic); // }, // url: uri, // success: function(jsondata){ // var searchClass = "fio-"+client ; // $( searchClass ).html( jsondata ); // } // }); // } // // </script> ; function myInnFunction(val) { var searchinn = val; console.log(searchinn); if (searchinn){ var datasearchinn = {"query": searchinn} $.ajax ({ url: "https://dadata.ru/api/v2/suggest/party", dataType: 'json', headers: {"Authorization": "Token c06864b3c1082f24e05f15e674b38c30f906b427"}, type: 'POST', contentType: 'application/json', data: JSON.stringify(datasearchinn), success: function (data) { console.log(data); //$("#company_title").val(data["suggestions"][0]["data"]["name"]["short"]); $("#company_title").val(data["suggestions"][0]["data"]["name"]["full_with_opf"]); $("#company_kpp").val(data["suggestions"][0]["data"]["kpp"]); $("#company_ogrn").val(data["suggestions"][0]["data"]["ogrn"]); $("#company_okpo").val(data["suggestions"][0]["data"]["okpo"]); $("#company_uraddress").val(data["suggestions"][0]["data"]["address"]["data"]["postal_code"] + ' ' + data["suggestions"][0]["data"]["address"]["value"]); } }) } } function myBikFunction(val) { var searchbik = val; console.log(searchbik); if (searchbik) { var datasearchinn = {"query": searchbik} $.ajax ({ url: "https://dadata.ru/api/v2/suggest/bank", dataType: 'json', headers: {"Authorization": "Token c06864b3c1082f24e05f15e674b38c30f906b427"}, type: 'POST', contentType: 'application/json', data: JSON.stringify(datasearchinn), success: function (data) { console.log(data); $("#company_banktitle").val(data["suggestions"][0]["data"]["name"]["payment"]); } }) } } ; (function() { }).call(this); (function() { }).call(this); (function() { }).call(this); (function() { }).call(this); // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. JavaScript code in this file should be added after the last require_* statement. // // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // $(document).ready(function(){ if ($('#new_user').length > 0){ $('.navbar').css('display','none'); } });
var tape = require("tape"); var protobuf = require(".."); var def = { fields: {}, oneofs: undefined, extensions: undefined, reserved: undefined, group: undefined, nested: undefined, options: undefined, }; var def2 = { fields: { a: { type: "uint32", id: 1 } }, oneofs: { kind: { oneof: ["a"] } }, extensions: [[1000, 2000]], reserved: [[900, 999], "b"], nested: { Type: { values: { ONE: 1, TWO: 2 } }, Service: { methods: {} } }, options: { custom: true } }; tape.test("reflected types", function(test) { var type = protobuf.Type.fromJSON("Test", def); test.same(type.toJSON(), def, "should construct from and convert back to JSON"); type = protobuf.Type.fromJSON("Test", def2); test.same(JSON.parse(JSON.stringify(type)), JSON.parse(JSON.stringify(def2)), "should construct from and convert back to JSON (complex parsed)"); function MyMessageAuto() {} type.ctor = MyMessageAuto; test.ok(MyMessageAuto.prototype instanceof protobuf.Message, "should properly register a constructor through assignment"); test.ok(typeof MyMessageAuto.encode === "function", "should populate static methods on assigned constructors"); function MyMessageManual() {} MyMessageManual.prototype = Object.create(protobuf.Message.prototype); type.ctor = MyMessageManual; test.ok(MyMessageManual.prototype instanceof protobuf.Message, "should properly register a constructor through assignment if already extending message"); test.ok(typeof MyMessageManual.encode === "function", "should populate static methods on assigned constructors"); type = protobuf.Type.fromJSON("My", { fields: { a: { type: "string", id: 1 } }, reserved: [[900, 999], "b"], nested: { Type: { fields: {} }, Enum: { values: {} }, Service: { methods: {} }, extensionField: { type: "string", id: 1000, extend: "Message" }, Other: { nested: {} } } }); test.same(type.toJSON(), { fields: { a: { extend: undefined, id: 1, options: undefined, rule: undefined, type: "string" } }, oneofs: undefined, extensions: undefined, reserved: [[900, 999], "b"], group: undefined, nested: { Type: { extensions: undefined, fields: {}, group: undefined, nested: undefined, oneofs: undefined, options: undefined, reserved: undefined }, Enum: { options: undefined, values: {} }, Service: { methods: {}, nested: undefined, options: undefined }, extensionField: { extend: "Message", id: 1000, options: undefined, rule: undefined, type: "string" }, Other: { nested: undefined, options: undefined } }, options: undefined }, "should create from Field, Type, Enum, Service, extension Field and Namespace JSON"); test.throws(function() { type.add(new protobuf.Enum("Enum")); }, Error, "should throw when trying to add duplicate names"); test.throws(function() { type.add(new protobuf.Field("c", 1, "uint32")); }, Error, "should throw when trying to add duplicate ids"); test.throws(function() { type.add(new protobuf.Field("c", 900, "uint32")); }, Error, "should throw when trying to add reserved ids"); test.throws(function() { type.add(new protobuf.Field("b", 2, "uint32")); }, Error, "should throw when trying to add reserved names"); test.end(); });
# Security DEBUG = True SECRET_KEY = 'ngjqVmXKmqfKN46jKIzj' DB = "projectWhiskey" ROOT = "superuser@superuser.com" ROOT_PSWD = "yoMama" TOKEN_VALIDITY_TIMEOUT = 600 TOKEN_TIMEOUT = 3600 # Mail MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'dont.reply.to.project.whiskey' MAIL_PASSWORD = 'webWEB123' MAIL_DEFAULT_SENDER = 'Project Whiskey <dont.reply.to.project.whiskey@gmail.com>' # Auth SESSION_COOKIE_NAME = 'session'
#!/usr/bin/env python import os s = '@' cmd = '''echo {} | wine 2_mod.exe | tail -n +3 | head -n -1 > /tmp/fuck.txt''' def run(s): os.system(cmd.format(s)) out = [s.strip() for s in open('/tmp/fuck.txt', 'r').readlines()][-1] a, _, b = out.split() return a == b alphabet = '1234567890qwertyuiopasdfghjklzxcvbnm.@QWERTYUIOPASDFGHJKLZXCVBNM' for i in range(10): for c in alphabet: if run(s+c): s += c print s break
// ElementList: ( Modified ) // Elisionopt AssignmentExpression // Elisionopt SpreadElement // ElementList, Elisionopt AssignmentExpression // ElementList, Elisionopt SpreadElement // SpreadElement: // ... AssignmentExpression var a0 = [ , , 2, 3, 4 ]; var a1 = [ "hello", "world" ]; var a2 = [ , , , ...a0, "hello" ]; var a3 = [ , , ...a0 ]; var a4 = [ ()=>1, ]; var a5 = [ ...a0, , ]; // Each element expression in a non-empty array literal is processed as follows: // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) // by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, // the element expression is contextually typed by the type of that property. // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is contextually typed by a tuple-like type, // the resulting type is a tuple type constructed from the types of the element expressions. var b0 = [ undefined, null, undefined ]; var b1 = [ [ 1, 2, 3 ], [ "hello", "string" ] ]; // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), // the resulting type is a tuple type constructed from the types of the element expressions. var [c0, c1] = [ 1, 2 ]; // tuple type [number, number] var [c2, c3] = [ 1, 2, true ]; // tuple type [number, number, boolean] // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the // non - spread element expressions and the numeric index signature types of the spread element expressions var temp = [ "s", "t", "r" ]; var temp1 = [ 1, 2, 3 ]; var temp2 = [ [ 1, 2, 3 ], [ "hello", "string" ] ]; var temp3 = [ undefined, null, undefined ]; var temp4 = []; var d0 = [ 1, true, ...temp, ]; // has type (string|number|boolean)[] var d1 = [ ...temp ]; // has type string[] var d2 = [ ...temp1 ]; var d3 = [ ...temp1 ]; var d4 = [ ...temp, ...temp1 ]; var d5 = [ ...temp3 ]; var d6 = [ ...temp4 ]; var d7 = [ ...[ ...temp1 ] ]; var d8 = [ [ ...temp1 ] ]; var d9 = [ [ ...temp1 ], ...[ "hello" ] ];
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 197); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file. // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, functionalTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /***/ 1: /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/emitter"); /***/ }), /***/ 10: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/clickoutside"); /***/ }), /***/ 11: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.extractTimeFormat = exports.extractDateFormat = exports.nextYear = exports.prevYear = exports.nextMonth = exports.prevMonth = exports.changeYearMonthAndClampDate = exports.timeWithinRange = exports.limitTimeRange = exports.clearMilliseconds = exports.clearTime = exports.modifyWithTimeString = exports.modifyTime = exports.modifyDate = exports.range = exports.getRangeHours = exports.getWeekNumber = exports.getStartDateOfMonth = exports.nextDate = exports.prevDate = exports.getFirstDayOfMonth = exports.getDayCountOfYear = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isDateObject = exports.isDate = exports.toDate = undefined; var _date = __webpack_require__(29); var _date2 = _interopRequireDefault(_date); var _locale = __webpack_require__(12); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; var getI18nSettings = function getI18nSettings() { return { dayNamesShort: weeks.map(function (week) { return (0, _locale.t)('el.datepicker.weeks.' + week); }), dayNames: weeks.map(function (week) { return (0, _locale.t)('el.datepicker.weeks.' + week); }), monthNamesShort: months.map(function (month) { return (0, _locale.t)('el.datepicker.months.' + month); }), monthNames: months.map(function (month, index) { return (0, _locale.t)('el.datepicker.month' + (index + 1)); }), amPm: ['am', 'pm'] }; }; var newArray = function newArray(start, end) { var result = []; for (var i = start; i <= end; i++) { result.push(i); } return result; }; var toDate = exports.toDate = function toDate(date) { return isDate(date) ? new Date(date) : null; }; var isDate = exports.isDate = function isDate(date) { if (date === null || date === undefined) return false; if (isNaN(new Date(date).getTime())) return false; if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()` return true; }; var isDateObject = exports.isDateObject = function isDateObject(val) { return val instanceof Date; }; var formatDate = exports.formatDate = function formatDate(date, format) { date = toDate(date); if (!date) return ''; return _date2.default.format(date, format || 'yyyy-MM-dd', getI18nSettings()); }; var parseDate = exports.parseDate = function parseDate(string, format) { return _date2.default.parse(string, format || 'yyyy-MM-dd', getI18nSettings()); }; var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) { if (month === 3 || month === 5 || month === 8 || month === 10) { return 30; } if (month === 1) { if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) { return 29; } else { return 28; } } return 31; }; var getDayCountOfYear = exports.getDayCountOfYear = function getDayCountOfYear(year) { var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0; return isLeapYear ? 366 : 365; }; var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) { var temp = new Date(date.getTime()); temp.setDate(1); return temp.getDay(); }; // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript // {prev, next} Date should work for Daylight Saving Time // Adding 24 * 60 * 60 * 1000 does not work in the above scenario var prevDate = exports.prevDate = function prevDate(date) { var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount); }; var nextDate = exports.nextDate = function nextDate(date) { var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount); }; var getStartDateOfMonth = exports.getStartDateOfMonth = function getStartDateOfMonth(year, month) { var result = new Date(year, month, 1); var day = result.getDay(); if (day === 0) { return prevDate(result, 7); } else { return prevDate(result, day); } }; var getWeekNumber = exports.getWeekNumber = function getWeekNumber(src) { if (!isDate(src)) return null; var date = new Date(src.getTime()); date.setHours(0, 0, 0, 0); // Thursday in current week decides the year. date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); // January 4 is always in week 1. var week1 = new Date(date.getFullYear(), 0, 4); // Adjust to Thursday in week 1 and count number of weeks from date to week 1. // Rounding should be fine for Daylight Saving Time. Its shift should never be more than 12 hours. return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7); }; var getRangeHours = exports.getRangeHours = function getRangeHours(ranges) { var hours = []; var disabledHours = []; (ranges || []).forEach(function (range) { var value = range.map(function (date) { return date.getHours(); }); disabledHours = disabledHours.concat(newArray(value[0], value[1])); }); if (disabledHours.length) { for (var i = 0; i < 24; i++) { hours[i] = disabledHours.indexOf(i) === -1; } } else { for (var _i = 0; _i < 24; _i++) { hours[_i] = false; } } return hours; }; var range = exports.range = function range(n) { // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n return Array.apply(null, { length: n }).map(function (_, n) { return n; }); }; var modifyDate = exports.modifyDate = function modifyDate(date, y, m, d) { return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()); }; var modifyTime = exports.modifyTime = function modifyTime(date, h, m, s) { return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds()); }; var modifyWithTimeString = exports.modifyWithTimeString = function modifyWithTimeString(date, time) { if (date == null || !time) { return date; } time = parseDate(time, 'HH:mm:ss'); return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds()); }; var clearTime = exports.clearTime = function clearTime(date) { return new Date(date.getFullYear(), date.getMonth(), date.getDate()); }; var clearMilliseconds = exports.clearMilliseconds = function clearMilliseconds(date) { return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0); }; var limitTimeRange = exports.limitTimeRange = function limitTimeRange(date, ranges) { var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss'; // TODO: refactory a more elegant solution if (ranges.length === 0) return date; var normalizeDate = function normalizeDate(date) { return _date2.default.parse(_date2.default.format(date, format), format); }; var ndate = normalizeDate(date); var nranges = ranges.map(function (range) { return range.map(normalizeDate); }); if (nranges.some(function (nrange) { return ndate >= nrange[0] && ndate <= nrange[1]; })) return date; var minDate = nranges[0][0]; var maxDate = nranges[0][0]; nranges.forEach(function (nrange) { minDate = new Date(Math.min(nrange[0], minDate)); maxDate = new Date(Math.max(nrange[1], minDate)); }); var ret = ndate < minDate ? minDate : maxDate; // preserve Year/Month/Date return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate()); }; var timeWithinRange = exports.timeWithinRange = function timeWithinRange(date, selectableRange, format) { var limitedDate = limitTimeRange(date, selectableRange, format); return limitedDate.getTime() === date.getTime(); }; var changeYearMonthAndClampDate = exports.changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) { // clamp date to the number of days in `year`, `month` // eg: (2010-1-31, 2010, 2) => 2010-2-28 var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month)); return modifyDate(date, year, month, monthDate); }; var prevMonth = exports.prevMonth = function prevMonth(date) { var year = date.getFullYear(); var month = date.getMonth(); return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1); }; var nextMonth = exports.nextMonth = function nextMonth(date) { var year = date.getFullYear(); var month = date.getMonth(); return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1); }; var prevYear = exports.prevYear = function prevYear(date) { var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var year = date.getFullYear(); var month = date.getMonth(); return changeYearMonthAndClampDate(date, year - amount, month); }; var nextYear = exports.nextYear = function nextYear(date) { var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var year = date.getFullYear(); var month = date.getMonth(); return changeYearMonthAndClampDate(date, year + amount, month); }; var extractDateFormat = exports.extractDateFormat = function extractDateFormat(format) { return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim(); }; var extractTimeFormat = exports.extractTimeFormat = function extractTimeFormat(format) { return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim(); }; /***/ }), /***/ 12: /***/ (function(module, exports) { module.exports = require("element-ui/lib/locale"); /***/ }), /***/ 17: /***/ (function(module, exports) { module.exports = require("element-ui/lib/scrollbar"); /***/ }), /***/ 197: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _timePicker = __webpack_require__(198); var _timePicker2 = _interopRequireDefault(_timePicker); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* istanbul ignore next */ _timePicker2.default.install = function (Vue) { Vue.component(_timePicker2.default.name, _timePicker2.default); }; exports.default = _timePicker2.default; /***/ }), /***/ 198: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _picker = __webpack_require__(27); var _picker2 = _interopRequireDefault(_picker); var _time = __webpack_require__(31); var _time2 = _interopRequireDefault(_time); var _timeRange = __webpack_require__(199); var _timeRange2 = _interopRequireDefault(_timeRange); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { mixins: [_picker2.default], name: 'ElTimePicker', props: { isRange: Boolean, arrowControl: Boolean }, data: function data() { return { type: '' }; }, watch: { isRange: function isRange(_isRange) { if (this.picker) { this.unmountPicker(); this.type = _isRange ? 'timerange' : 'time'; this.panel = _isRange ? _timeRange2.default : _time2.default; this.mountPicker(); } else { this.type = _isRange ? 'timerange' : 'time'; this.panel = _isRange ? _timeRange2.default : _time2.default; } } }, created: function created() { this.type = this.isRange ? 'timerange' : 'time'; this.panel = this.isRange ? _timeRange2.default : _time2.default; } }; /***/ }), /***/ 199: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__ = __webpack_require__(200); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac964a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__ = __webpack_require__(201); var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac964a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/dom"); /***/ }), /***/ 200: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _util = __webpack_require__(11); var _locale = __webpack_require__(5); var _locale2 = _interopRequireDefault(_locale); var _timeSpinner = __webpack_require__(32); var _timeSpinner2 = _interopRequireDefault(_timeSpinner); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var MIN_TIME = (0, _util.parseDate)('00:00:00', 'HH:mm:ss'); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var MAX_TIME = (0, _util.parseDate)('23:59:59', 'HH:mm:ss'); var minTimeOfDay = function minTimeOfDay(date) { return (0, _util.modifyDate)(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate()); }; var maxTimeOfDay = function maxTimeOfDay(date) { return (0, _util.modifyDate)(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate()); }; // increase time by amount of milliseconds, but within the range of day var advanceTime = function advanceTime(date, amount) { return new Date(Math.min(date.getTime() + amount, maxTimeOfDay(date).getTime())); }; exports.default = { mixins: [_locale2.default], components: { TimeSpinner: _timeSpinner2.default }, computed: { showSeconds: function showSeconds() { return (this.format || '').indexOf('ss') !== -1; }, offset: function offset() { return this.showSeconds ? 11 : 8; }, spinner: function spinner() { return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner; }, btnDisabled: function btnDisabled() { return this.minDate.getTime() > this.maxDate.getTime(); }, amPmMode: function amPmMode() { if ((this.format || '').indexOf('A') !== -1) return 'A'; if ((this.format || '').indexOf('a') !== -1) return 'a'; return ''; } }, data: function data() { return { popperClass: '', minDate: new Date(), maxDate: new Date(), value: [], oldValue: [new Date(), new Date()], defaultValue: null, format: 'HH:mm:ss', visible: false, selectionRange: [0, 2], arrowControl: false }; }, watch: { value: function value(_value) { if (Array.isArray(_value)) { this.minDate = new Date(_value[0]); this.maxDate = new Date(_value[1]); } else { if (Array.isArray(this.defaultValue)) { this.minDate = new Date(this.defaultValue[0]); this.maxDate = new Date(this.defaultValue[1]); } else if (this.defaultValue) { this.minDate = new Date(this.defaultValue); this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000); } else { this.minDate = new Date(); this.maxDate = advanceTime(new Date(), 60 * 60 * 1000); } } }, visible: function visible(val) { var _this = this; if (val) { this.oldValue = this.value; this.$nextTick(function () { return _this.$refs.minSpinner.emitSelectRange('hours'); }); } } }, methods: { handleClear: function handleClear() { this.$emit('pick', null); }, handleCancel: function handleCancel() { this.$emit('pick', this.oldValue); }, handleMinChange: function handleMinChange(date) { this.minDate = (0, _util.clearMilliseconds)(date); this.handleChange(); }, handleMaxChange: function handleMaxChange(date) { this.maxDate = (0, _util.clearMilliseconds)(date); this.handleChange(); }, handleChange: function handleChange() { if (this.isValidValue([this.minDate, this.maxDate])) { this.$refs.minSpinner.selectableRange = [[minTimeOfDay(this.minDate), this.maxDate]]; this.$refs.maxSpinner.selectableRange = [[this.minDate, maxTimeOfDay(this.maxDate)]]; this.$emit('pick', [this.minDate, this.maxDate], true); } }, setMinSelectionRange: function setMinSelectionRange(start, end) { this.$emit('select-range', start, end, 'min'); this.selectionRange = [start, end]; }, setMaxSelectionRange: function setMaxSelectionRange(start, end) { this.$emit('select-range', start, end, 'max'); this.selectionRange = [start + this.offset, end + this.offset]; }, handleConfirm: function handleConfirm() { var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var minSelectableRange = this.$refs.minSpinner.selectableRange; var maxSelectableRange = this.$refs.maxSpinner.selectableRange; this.minDate = (0, _util.limitTimeRange)(this.minDate, minSelectableRange, this.format); this.maxDate = (0, _util.limitTimeRange)(this.maxDate, maxSelectableRange, this.format); this.$emit('pick', [this.minDate, this.maxDate], visible); }, adjustSpinners: function adjustSpinners() { this.$refs.minSpinner.adjustSpinners(); this.$refs.maxSpinner.adjustSpinners(); }, changeSelectionRange: function changeSelectionRange(step) { var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11]; var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []); var index = list.indexOf(this.selectionRange[0]); var next = (index + step + list.length) % list.length; var half = list.length / 2; if (next < half) { this.$refs.minSpinner.emitSelectRange(mapping[next]); } else { this.$refs.maxSpinner.emitSelectRange(mapping[next - half]); } }, isValidValue: function isValidValue(date) { return Array.isArray(date) && (0, _util.timeWithinRange)(this.minDate, this.$refs.minSpinner.selectableRange) && (0, _util.timeWithinRange)(this.maxDate, this.$refs.maxSpinner.selectableRange); }, handleKeydown: function handleKeydown(event) { var keyCode = event.keyCode; var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 }; // Left or Right if (keyCode === 37 || keyCode === 39) { var step = mapping[keyCode]; this.changeSelectionRange(step); event.preventDefault(); return; } // Up or Down if (keyCode === 38 || keyCode === 40) { var _step = mapping[keyCode]; this.spinner.scrollDown(_step); event.preventDefault(); return; } } } }; /***/ }), /***/ 201: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"},on:{"after-leave":function($event){_vm.$emit('dodestroy')}}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-time-range-picker el-picker-panel el-popper",class:_vm.popperClass},[_c('div',{staticClass:"el-time-range-picker__content"},[_c('div',{staticClass:"el-time-range-picker__cell"},[_c('div',{staticClass:"el-time-range-picker__header"},[_vm._v(_vm._s(_vm.t('el.datepicker.startTime')))]),_c('div',{staticClass:"el-time-range-picker__body el-time-panel__content",class:{ 'has-seconds': _vm.showSeconds, 'is-arrow': _vm.arrowControl }},[_c('time-spinner',{ref:"minSpinner",attrs:{"show-seconds":_vm.showSeconds,"am-pm-mode":_vm.amPmMode,"arrow-control":_vm.arrowControl,"date":_vm.minDate},on:{"change":_vm.handleMinChange,"select-range":_vm.setMinSelectionRange}})],1)]),_c('div',{staticClass:"el-time-range-picker__cell"},[_c('div',{staticClass:"el-time-range-picker__header"},[_vm._v(_vm._s(_vm.t('el.datepicker.endTime')))]),_c('div',{staticClass:"el-time-range-picker__body el-time-panel__content",class:{ 'has-seconds': _vm.showSeconds, 'is-arrow': _vm.arrowControl }},[_c('time-spinner',{ref:"maxSpinner",attrs:{"show-seconds":_vm.showSeconds,"am-pm-mode":_vm.amPmMode,"arrow-control":_vm.arrowControl,"date":_vm.maxDate},on:{"change":_vm.handleMaxChange,"select-range":_vm.setMaxSelectionRange}})],1)])]),_c('div',{staticClass:"el-time-panel__footer"},[_c('button',{staticClass:"el-time-panel__btn cancel",attrs:{"type":"button"},on:{"click":function($event){_vm.handleCancel()}}},[_vm._v(_vm._s(_vm.t('el.datepicker.cancel')))]),_c('button',{staticClass:"el-time-panel__btn confirm",attrs:{"type":"button","disabled":_vm.btnDisabled},on:{"click":function($event){_vm.handleConfirm()}}},[_vm._v(_vm._s(_vm.t('el.datepicker.confirm')))])])])])} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), /***/ 24: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _dom = __webpack_require__(2); exports.default = { bind: function bind(el, binding, vnode) { var interval = null; var startTime = void 0; var handler = function handler() { return vnode.context[binding.expression].apply(); }; var clear = function clear() { if (new Date() - startTime < 100) { handler(); } clearInterval(interval); interval = null; }; (0, _dom.on)(el, 'mousedown', function (e) { if (e.button !== 0) return; startTime = new Date(); (0, _dom.once)(document, 'mouseup', clear); clearInterval(interval); interval = setInterval(handler, 100); }); } }; /***/ }), /***/ 27: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__ = __webpack_require__(28); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b32bdda0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__ = __webpack_require__(30); var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b32bdda0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 28: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _vue = __webpack_require__(4); var _vue2 = _interopRequireDefault(_vue); var _clickoutside = __webpack_require__(10); var _clickoutside2 = _interopRequireDefault(_clickoutside); var _util = __webpack_require__(11); var _vuePopper = __webpack_require__(7); var _vuePopper2 = _interopRequireDefault(_vuePopper); var _emitter = __webpack_require__(1); var _emitter2 = _interopRequireDefault(_emitter); var _input = __webpack_require__(6); var _input2 = _interopRequireDefault(_input); var _merge = __webpack_require__(9); var _merge2 = _interopRequireDefault(_merge); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NewPopper = { props: { appendToBody: _vuePopper2.default.props.appendToBody, offset: _vuePopper2.default.props.offset, boundariesPadding: _vuePopper2.default.props.boundariesPadding, arrowOffset: _vuePopper2.default.props.arrowOffset }, methods: _vuePopper2.default.methods, data: function data() { return (0, _merge2.default)({ visibleArrow: true }, _vuePopper2.default.data); }, beforeDestroy: _vuePopper2.default.beforeDestroy }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var DEFAULT_FORMATS = { date: 'yyyy-MM-dd', month: 'yyyy-MM', datetime: 'yyyy-MM-dd HH:mm:ss', time: 'HH:mm:ss', week: 'yyyywWW', timerange: 'HH:mm:ss', daterange: 'yyyy-MM-dd', datetimerange: 'yyyy-MM-dd HH:mm:ss', year: 'yyyy' }; var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'timerange', 'datetimerange', 'dates']; var DATE_FORMATTER = function DATE_FORMATTER(value, format) { if (format === 'timestamp') return value.getTime(); return (0, _util.formatDate)(value, format); }; var DATE_PARSER = function DATE_PARSER(text, format) { if (format === 'timestamp') return new Date(Number(text)); return (0, _util.parseDate)(text, format); }; var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) { if (Array.isArray(value) && value.length === 2) { var start = value[0]; var end = value[1]; if (start && end) { return [DATE_FORMATTER(start, format), DATE_FORMATTER(end, format)]; } } return ''; }; var RANGE_PARSER = function RANGE_PARSER(array, format, separator) { if (!Array.isArray(array)) { array = array.split(separator); } if (array.length === 2) { var range1 = array[0]; var range2 = array[1]; return [DATE_PARSER(range1, format), DATE_PARSER(range2, format)]; } return []; }; var TYPE_VALUE_RESOLVER_MAP = { default: { formatter: function formatter(value) { if (!value) return ''; return '' + value; }, parser: function parser(text) { if (text === undefined || text === '') return null; return text; } }, week: { formatter: function formatter(value, format) { var week = (0, _util.getWeekNumber)(value); var month = value.getMonth(); var trueDate = new Date(value); if (week === 1 && month === 11) { trueDate.setHours(0, 0, 0, 0); trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7); } var date = (0, _util.formatDate)(trueDate, format); date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week); return date; }, parser: function parser(text) { var array = (text || '').split('w'); if (array.length === 2) { var year = Number(array[0]); var month = Number(array[1]); if (!isNaN(year) && !isNaN(month) && month < 54) { return text; } } return null; } }, date: { formatter: DATE_FORMATTER, parser: DATE_PARSER }, datetime: { formatter: DATE_FORMATTER, parser: DATE_PARSER }, daterange: { formatter: RANGE_FORMATTER, parser: RANGE_PARSER }, datetimerange: { formatter: RANGE_FORMATTER, parser: RANGE_PARSER }, timerange: { formatter: RANGE_FORMATTER, parser: RANGE_PARSER }, time: { formatter: DATE_FORMATTER, parser: DATE_PARSER }, month: { formatter: DATE_FORMATTER, parser: DATE_PARSER }, year: { formatter: DATE_FORMATTER, parser: DATE_PARSER }, number: { formatter: function formatter(value) { if (!value) return ''; return '' + value; }, parser: function parser(text) { var result = Number(text); if (!isNaN(text)) { return result; } else { return null; } } }, dates: { formatter: function formatter(value, format) { return value.map(function (date) { return DATE_FORMATTER(date, format); }); }, parser: function parser(value, format) { return (typeof value === 'string' ? value.split(', ') : value).map(function (date) { return date instanceof Date ? date : DATE_PARSER(date, format); }); } } }; var PLACEMENT_MAP = { left: 'bottom-start', center: 'bottom', right: 'bottom-end' }; var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) { var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-'; if (!value) return null; var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser; var format = customFormat || DEFAULT_FORMATS[type]; return parser(value, format, rangeSeparator); }; var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) { if (!value) return null; var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter; var format = customFormat || DEFAULT_FORMATS[type]; return formatter(value, format); }; /* * Considers: * 1. Date object * 2. date string * 3. array of 1 or 2 */ var valueEquals = function valueEquals(a, b) { // considers Date object and string var dateEquals = function dateEquals(a, b) { var aIsDate = a instanceof Date; var bIsDate = b instanceof Date; if (aIsDate && bIsDate) { return a.getTime() === b.getTime(); } if (!aIsDate && !bIsDate) { return a === b; } return false; }; var aIsArray = a instanceof Array; var bIsArray = b instanceof Array; if (aIsArray && bIsArray) { if (a.length !== b.length) { return false; } return a.every(function (item, index) { return dateEquals(item, b[index]); }); } if (!aIsArray && !bIsArray) { return dateEquals(a, b); } return false; }; var isString = function isString(val) { return typeof val === 'string' || val instanceof String; }; var validator = function validator(val) { // either: String, Array of String, null / undefined return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString); }; exports.default = { mixins: [_emitter2.default, NewPopper], inject: { elForm: { default: '' }, elFormItem: { default: '' } }, props: { size: String, format: String, valueFormat: String, readonly: Boolean, placeholder: String, startPlaceholder: String, endPlaceholder: String, prefixIcon: String, clearIcon: { type: String, default: 'el-icon-circle-close' }, name: { default: '', validator: validator }, disabled: Boolean, clearable: { type: Boolean, default: true }, id: { default: '', validator: validator }, popperClass: String, editable: { type: Boolean, default: true }, align: { type: String, default: 'left' }, value: {}, defaultValue: {}, defaultTime: {}, rangeSeparator: { default: '-' }, pickerOptions: {}, unlinkPanels: Boolean }, components: { ElInput: _input2.default }, directives: { Clickoutside: _clickoutside2.default }, data: function data() { return { pickerVisible: false, showClose: false, userInput: null, valueOnOpen: null, // value when picker opens, used to determine whether to emit change unwatchPickerOptions: null }; }, watch: { pickerVisible: function pickerVisible(val) { if (this.readonly || this.pickerDisabled) return; if (val) { this.showPicker(); this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value; } else { this.hidePicker(); this.emitChange(this.value); this.userInput = null; this.dispatch('ElFormItem', 'el.form.blur'); this.$emit('blur', this); this.blur(); } }, parsedValue: { immediate: true, handler: function handler(val) { if (this.picker) { this.picker.value = val; this.picker.selectedDate = Array.isArray(val) ? val : []; } } }, defaultValue: function defaultValue(val) { // NOTE: should eventually move to jsx style picker + panel ? if (this.picker) { this.picker.defaultValue = val; } } }, computed: { ranged: function ranged() { return this.type.indexOf('range') > -1; }, reference: function reference() { var reference = this.$refs.reference; return reference.$el || reference; }, refInput: function refInput() { if (this.reference) { return [].slice.call(this.reference.querySelectorAll('input')); } return []; }, valueIsEmpty: function valueIsEmpty() { var val = this.value; if (Array.isArray(val)) { for (var i = 0, len = val.length; i < len; i++) { if (val[i]) { return false; } } } else { if (val) { return false; } } return true; }, triggerClass: function triggerClass() { return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date'); }, selectionMode: function selectionMode() { if (this.type === 'week') { return 'week'; } else if (this.type === 'month') { return 'month'; } else if (this.type === 'year') { return 'year'; } else if (this.type === 'dates') { return 'dates'; } return 'day'; }, haveTrigger: function haveTrigger() { if (typeof this.showTrigger !== 'undefined') { return this.showTrigger; } return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1; }, displayValue: function displayValue() { var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator); if (Array.isArray(this.userInput)) { return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || '']; } else if (this.userInput !== null) { return this.userInput; } else if (formattedValue) { return this.type === 'dates' ? formattedValue.join(', ') : formattedValue; } else { return ''; } }, parsedValue: function parsedValue() { if (!this.value) return this.value; // component value is not set if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version var valueIsDateObject = (0, _util.isDateObject)(this.value) || Array.isArray(this.value) && this.value.every(_util.isDateObject); if (valueIsDateObject) { return this.value; } if (this.valueFormat) { return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value; } // NOTE: deal with common but incorrect usage, should remove in next major version // user might provide string / timestamp without value-format, coerce them into date (or array of date) return Array.isArray(this.value) ? this.value.map(function (val) { return new Date(val); }) : new Date(this.value); }, _elFormItemSize: function _elFormItemSize() { return (this.elFormItem || {}).elFormItemSize; }, pickerSize: function pickerSize() { return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size; }, pickerDisabled: function pickerDisabled() { return this.disabled || (this.elForm || {}).disabled; }, firstInputId: function firstInputId() { var obj = {}; var id = void 0; if (this.ranged) { id = this.id && this.id[0]; } else { id = this.id; } if (id) obj.id = id; return obj; }, secondInputId: function secondInputId() { var obj = {}; var id = void 0; if (this.ranged) { id = this.id && this.id[1]; } if (id) obj.id = id; return obj; } }, created: function created() { // vue-popper this.popperOptions = { boundariesPadding: 0, gpuAcceleration: false }; this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left; this.$on('fieldReset', this.handleFieldReset); }, methods: { focus: function focus() { if (!this.ranged) { this.$refs.reference.focus(); } else { this.handleFocus(); } }, blur: function blur() { this.refInput.forEach(function (input) { return input.blur(); }); }, // {parse, formatTo} Value deals maps component value with internal Date parseValue: function parseValue(value) { var isParsed = (0, _util.isDateObject)(value) || Array.isArray(value) && value.every(_util.isDateObject); if (this.valueFormat && !isParsed) { return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value; } else { return value; } }, formatToValue: function formatToValue(date) { var isFormattable = (0, _util.isDateObject)(date) || Array.isArray(date) && date.every(_util.isDateObject); if (this.valueFormat && isFormattable) { return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator); } else { return date; } }, // {parse, formatTo} String deals with user input parseString: function parseString(value) { var type = Array.isArray(value) ? this.type : this.type.replace('range', ''); return parseAsFormatAndType(value, this.format, type); }, formatToString: function formatToString(value) { var type = Array.isArray(value) ? this.type : this.type.replace('range', ''); return formatAsFormatAndType(value, this.format, type); }, handleMouseEnter: function handleMouseEnter() { if (this.readonly || this.pickerDisabled) return; if (!this.valueIsEmpty && this.clearable) { this.showClose = true; } }, handleChange: function handleChange() { if (this.userInput) { var value = this.parseString(this.displayValue); if (value) { this.picker.value = value; if (this.isValidValue(value)) { this.emitInput(value); this.userInput = null; } } } if (this.userInput === '') { this.emitInput(null); this.emitChange(null); this.userInput = null; } }, handleStartInput: function handleStartInput(event) { if (this.userInput) { this.userInput = [event.target.value, this.userInput[1]]; } else { this.userInput = [event.target.value, null]; } }, handleEndInput: function handleEndInput(event) { if (this.userInput) { this.userInput = [this.userInput[0], event.target.value]; } else { this.userInput = [null, event.target.value]; } }, handleStartChange: function handleStartChange(event) { var value = this.parseString(this.userInput && this.userInput[0]); if (value) { this.userInput = [this.formatToString(value), this.displayValue[1]]; var newValue = [value, this.picker.value && this.picker.value[1]]; this.picker.value = newValue; if (this.isValidValue(newValue)) { this.emitInput(newValue); this.userInput = null; } } }, handleEndChange: function handleEndChange(event) { var value = this.parseString(this.userInput && this.userInput[1]); if (value) { this.userInput = [this.displayValue[0], this.formatToString(value)]; var newValue = [this.picker.value && this.picker.value[0], value]; this.picker.value = newValue; if (this.isValidValue(newValue)) { this.emitInput(newValue); this.userInput = null; } } }, handleClickIcon: function handleClickIcon(event) { if (this.readonly || this.pickerDisabled) return; if (this.showClose) { this.valueOnOpen = this.value; event.stopPropagation(); this.emitInput(null); this.emitChange(null); this.showClose = false; if (this.picker && typeof this.picker.handleClear === 'function') { this.picker.handleClear(); } } else { this.pickerVisible = !this.pickerVisible; } }, handleClose: function handleClose() { if (!this.pickerVisible) return; this.pickerVisible = false; var type = this.type, valueOnOpen = this.valueOnOpen, valueFormat = this.valueFormat, rangeSeparator = this.rangeSeparator; if (type === 'dates' && this.picker) { this.picker.selectedDate = parseAsFormatAndType(valueOnOpen, valueFormat, type, rangeSeparator) || valueOnOpen; this.emitInput(this.picker.selectedDate); } }, handleFieldReset: function handleFieldReset(initialValue) { this.userInput = initialValue; }, handleFocus: function handleFocus() { var type = this.type; if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) { this.pickerVisible = true; } this.$emit('focus', this); }, handleKeydown: function handleKeydown(event) { var _this = this; var keyCode = event.keyCode; // ESC if (keyCode === 27) { this.pickerVisible = false; event.stopPropagation(); return; } // Tab if (keyCode === 9) { if (!this.ranged) { this.handleChange(); this.pickerVisible = this.picker.visible = false; this.blur(); event.stopPropagation(); } else { // user may change focus between two input setTimeout(function () { if (_this.refInput.indexOf(document.activeElement) === -1) { _this.pickerVisible = false; _this.blur(); event.stopPropagation(); } }, 0); } return; } // Enter if (keyCode === 13) { if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) { this.handleChange(); this.pickerVisible = this.picker.visible = false; this.blur(); } event.stopPropagation(); return; } // if user is typing, do not let picker handle key input if (this.userInput) { event.stopPropagation(); return; } // delegate other keys to panel if (this.picker && this.picker.handleKeydown) { this.picker.handleKeydown(event); } }, handleRangeClick: function handleRangeClick() { var type = this.type; if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) { this.pickerVisible = true; } this.$emit('focus', this); }, hidePicker: function hidePicker() { if (this.picker) { this.picker.resetView && this.picker.resetView(); this.pickerVisible = this.picker.visible = false; this.destroyPopper(); } }, showPicker: function showPicker() { var _this2 = this; if (this.$isServer) return; if (!this.picker) { this.mountPicker(); } this.pickerVisible = this.picker.visible = true; this.updatePopper(); this.picker.value = this.parsedValue; this.picker.resetView && this.picker.resetView(); this.$nextTick(function () { _this2.picker.adjustSpinners && _this2.picker.adjustSpinners(); }); }, mountPicker: function mountPicker() { var _this3 = this; this.picker = new _vue2.default(this.panel).$mount(); this.picker.defaultValue = this.defaultValue; this.picker.defaultTime = this.defaultTime; this.picker.popperClass = this.popperClass; this.popperElm = this.picker.$el; this.picker.width = this.reference.getBoundingClientRect().width; this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange'; this.picker.selectionMode = this.selectionMode; this.picker.unlinkPanels = this.unlinkPanels; this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false; this.picker.selectedDate = Array.isArray(this.value) && this.value || []; this.$watch('format', function (format) { _this3.picker.format = format; }); var updateOptions = function updateOptions() { var options = _this3.pickerOptions; if (options && options.selectableRange) { (function () { var ranges = options.selectableRange; var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser; var format = DEFAULT_FORMATS.timerange; ranges = Array.isArray(ranges) ? ranges : [ranges]; _this3.picker.selectableRange = ranges.map(function (range) { return parser(range, format, _this3.rangeSeparator); }); })(); } for (var option in options) { if (options.hasOwnProperty(option) && // 忽略 time-picker 的该配置项 option !== 'selectableRange') { _this3.picker[option] = options[option]; } } // main format must prevail over undocumented pickerOptions.format if (_this3.format) { _this3.picker.format = _this3.format; } }; updateOptions(); this.unwatchPickerOptions = this.$watch('pickerOptions', function () { return updateOptions(); }, { deep: true }); this.$el.appendChild(this.picker.$el); this.picker.resetView && this.picker.resetView(); this.picker.$on('dodestroy', this.doDestroy); this.picker.$on('pick', function () { var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; _this3.userInput = null; _this3.pickerVisible = _this3.picker.visible = visible; _this3.emitInput(date); _this3.picker.resetView && _this3.picker.resetView(); }); this.picker.$on('select-range', function (start, end, pos) { if (_this3.refInput.length === 0) return; if (!pos || pos === 'min') { _this3.refInput[0].setSelectionRange(start, end); _this3.refInput[0].focus(); } else if (pos === 'max') { _this3.refInput[1].setSelectionRange(start, end); _this3.refInput[1].focus(); } }); }, unmountPicker: function unmountPicker() { if (this.picker) { this.picker.$destroy(); this.picker.$off(); if (typeof this.unwatchPickerOptions === 'function') { this.unwatchPickerOptions(); } this.picker.$el.parentNode.removeChild(this.picker.$el); } }, emitChange: function emitChange(val) { // determine user real change only if (!valueEquals(val, this.valueOnOpen)) { this.$emit('change', val); this.dispatch('ElFormItem', 'el.form.change', val); this.valueOnOpen = val; } }, emitInput: function emitInput(val) { var formatted = this.formatToValue(val); if (!valueEquals(this.value, formatted)) { this.$emit('input', formatted); } }, isValidValue: function isValidValue(value) { if (!this.picker) { this.mountPicker(); } if (this.picker.isValidValue) { return value && this.picker.isValidValue(value); } else { return true; } } } }; /***/ }), /***/ 29: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/date"); /***/ }), /***/ 30: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.ranged)?_c('el-input',_vm._b({directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleClose),expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor",class:'el-date-editor--' + _vm.type,attrs:{"readonly":!_vm.editable || _vm.readonly || _vm.type === 'dates',"disabled":_vm.pickerDisabled,"size":_vm.pickerSize,"name":_vm.name,"placeholder":_vm.placeholder,"value":_vm.displayValue,"validateEvent":false},on:{"focus":_vm.handleFocus,"input":function (value) { return _vm.userInput = value; },"change":_vm.handleChange},nativeOn:{"keydown":function($event){_vm.handleKeydown($event)},"mouseenter":function($event){_vm.handleMouseEnter($event)},"mouseleave":function($event){_vm.showClose = false}}},'el-input',_vm.firstInputId,false),[_c('i',{staticClass:"el-input__icon",class:_vm.triggerClass,attrs:{"slot":"prefix"},on:{"click":_vm.handleFocus},slot:"prefix"}),(_vm.haveTrigger)?_c('i',{staticClass:"el-input__icon",class:[_vm.showClose ? '' + _vm.clearIcon : ''],attrs:{"slot":"suffix"},on:{"click":_vm.handleClickIcon},slot:"suffix"}):_vm._e()]):_c('div',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleClose),expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor el-range-editor el-input__inner",class:[ 'el-date-editor--' + _vm.type, _vm.pickerSize ? ("el-range-editor--" + _vm.pickerSize) : '', _vm.pickerDisabled ? 'is-disabled' : '', _vm.pickerVisible ? 'is-active' : '' ],on:{"click":_vm.handleRangeClick,"mouseenter":_vm.handleMouseEnter,"mouseleave":function($event){_vm.showClose = false},"keydown":_vm.handleKeydown}},[_c('i',{class:['el-input__icon', 'el-range__icon', _vm.triggerClass]}),_c('input',_vm._b({staticClass:"el-range-input",attrs:{"placeholder":_vm.startPlaceholder,"disabled":_vm.pickerDisabled,"readonly":!_vm.editable || _vm.readonly,"name":_vm.name && _vm.name[0]},domProps:{"value":_vm.displayValue && _vm.displayValue[0]},on:{"input":_vm.handleStartInput,"change":_vm.handleStartChange,"focus":_vm.handleFocus}},'input',_vm.firstInputId,false)),_c('span',{staticClass:"el-range-separator"},[_vm._v(_vm._s(_vm.rangeSeparator))]),_c('input',_vm._b({staticClass:"el-range-input",attrs:{"placeholder":_vm.endPlaceholder,"disabled":_vm.pickerDisabled,"readonly":!_vm.editable || _vm.readonly,"name":_vm.name && _vm.name[1]},domProps:{"value":_vm.displayValue && _vm.displayValue[1]},on:{"input":_vm.handleEndInput,"change":_vm.handleEndChange,"focus":_vm.handleFocus}},'input',_vm.secondInputId,false)),(_vm.haveTrigger)?_c('i',{staticClass:"el-input__icon el-range__close-icon",class:[_vm.showClose ? '' + _vm.clearIcon : ''],on:{"click":_vm.handleClickIcon}}):_vm._e()])} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), /***/ 31: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4135ea9a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(44); var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4135ea9a_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 32: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__ = __webpack_require__(42); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_48e066fc_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__ = __webpack_require__(43); var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_48e066fc_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 4: /***/ (function(module, exports) { module.exports = require("vue"); /***/ }), /***/ 41: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _util = __webpack_require__(11); var _locale = __webpack_require__(5); var _locale2 = _interopRequireDefault(_locale); var _timeSpinner = __webpack_require__(32); var _timeSpinner2 = _interopRequireDefault(_timeSpinner); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { mixins: [_locale2.default], components: { TimeSpinner: _timeSpinner2.default }, props: { visible: Boolean, timeArrowControl: Boolean }, watch: { visible: function visible(val) { var _this = this; if (val) { this.oldValue = this.value; this.$nextTick(function () { return _this.$refs.spinner.emitSelectRange('hours'); }); } else { this.needInitAdjust = true; } }, value: function value(newVal) { var _this2 = this; var date = void 0; if (newVal instanceof Date) { date = (0, _util.limitTimeRange)(newVal, this.selectableRange, this.format); } else if (!newVal) { date = this.defaultValue ? new Date(this.defaultValue) : new Date(); } this.date = date; if (this.visible && this.needInitAdjust) { this.$nextTick(function (_) { return _this2.adjustSpinners(); }); this.needInitAdjust = false; } }, selectableRange: function selectableRange(val) { this.$refs.spinner.selectableRange = val; }, defaultValue: function defaultValue(val) { if (!(0, _util.isDate)(this.value)) { this.date = val ? new Date(val) : new Date(); } } }, data: function data() { return { popperClass: '', format: 'HH:mm:ss', value: '', defaultValue: null, date: new Date(), oldValue: new Date(), selectableRange: [], selectionRange: [0, 2], disabled: false, arrowControl: false, needInitAdjust: true }; }, computed: { showSeconds: function showSeconds() { return (this.format || '').indexOf('ss') !== -1; }, useArrow: function useArrow() { return this.arrowControl || this.timeArrowControl || false; }, amPmMode: function amPmMode() { if ((this.format || '').indexOf('A') !== -1) return 'A'; if ((this.format || '').indexOf('a') !== -1) return 'a'; return ''; } }, methods: { handleCancel: function handleCancel() { this.$emit('pick', this.oldValue, false); }, handleChange: function handleChange(date) { // this.visible avoids edge cases, when use scrolls during panel closing animation if (this.visible) { this.date = (0, _util.clearMilliseconds)(date); // if date is out of range, do not emit if (this.isValidValue(this.date)) { this.$emit('pick', this.date, true); } } }, setSelectionRange: function setSelectionRange(start, end) { this.$emit('select-range', start, end); this.selectionRange = [start, end]; }, handleConfirm: function handleConfirm() { var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var first = arguments[1]; if (first) return; var date = (0, _util.clearMilliseconds)((0, _util.limitTimeRange)(this.date, this.selectableRange, this.format)); this.$emit('pick', date, visible, first); }, handleKeydown: function handleKeydown(event) { var keyCode = event.keyCode; var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 }; // Left or Right if (keyCode === 37 || keyCode === 39) { var step = mapping[keyCode]; this.changeSelectionRange(step); event.preventDefault(); return; } // Up or Down if (keyCode === 38 || keyCode === 40) { var _step = mapping[keyCode]; this.$refs.spinner.scrollDown(_step); event.preventDefault(); return; } }, isValidValue: function isValidValue(date) { return (0, _util.timeWithinRange)(date, this.selectableRange, this.format); }, adjustSpinners: function adjustSpinners() { return this.$refs.spinner.adjustSpinners(); }, changeSelectionRange: function changeSelectionRange(step) { var list = [0, 3].concat(this.showSeconds ? [6] : []); var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []); var index = list.indexOf(this.selectionRange[0]); var next = (index + step + list.length) % list.length; this.$refs.spinner.emitSelectRange(mapping[next]); } }, mounted: function mounted() { var _this3 = this; this.$nextTick(function () { return _this3.handleConfirm(true, true); }); this.$emit('mounted'); } }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /***/ }), /***/ 42: /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _util = __webpack_require__(11); var _scrollbar = __webpack_require__(17); var _scrollbar2 = _interopRequireDefault(_scrollbar); var _repeatClick = __webpack_require__(24); var _repeatClick2 = _interopRequireDefault(_repeatClick); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { components: { ElScrollbar: _scrollbar2.default }, directives: { repeatClick: _repeatClick2.default }, props: { date: {}, defaultValue: {}, // reserved for future use showSeconds: { type: Boolean, default: true }, arrowControl: Boolean, amPmMode: { type: String, default: '' // 'a': am/pm; 'A': AM/PM } }, computed: { hours: function hours() { return this.date.getHours(); }, minutes: function minutes() { return this.date.getMinutes(); }, seconds: function seconds() { return this.date.getSeconds(); }, hoursList: function hoursList() { return (0, _util.getRangeHours)(this.selectableRange); }, arrowHourList: function arrowHourList() { var hours = this.hours; return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined]; }, arrowMinuteList: function arrowMinuteList() { var minutes = this.minutes; return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined]; }, arrowSecondList: function arrowSecondList() { var seconds = this.seconds; return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined]; } }, data: function data() { return { selectableRange: [], currentScrollbar: null }; }, mounted: function mounted() { var _this = this; this.$nextTick(function () { !_this.arrowControl && _this.bindScrollEvent(); }); }, methods: { increase: function increase() { this.scrollDown(1); }, decrease: function decrease() { this.scrollDown(-1); }, modifyDateField: function modifyDateField(type, value) { switch (type) { case 'hours': this.$emit('change', (0, _util.modifyTime)(this.date, value, this.minutes, this.seconds));break; case 'minutes': this.$emit('change', (0, _util.modifyTime)(this.date, this.hours, value, this.seconds));break; case 'seconds': this.$emit('change', (0, _util.modifyTime)(this.date, this.hours, this.minutes, value));break; } }, handleClick: function handleClick(type, _ref) { var value = _ref.value, disabled = _ref.disabled; if (!disabled) { this.modifyDateField(type, value); this.emitSelectRange(type); this.adjustSpinner(type, value); } }, emitSelectRange: function emitSelectRange(type) { if (type === 'hours') { this.$emit('select-range', 0, 2); } else if (type === 'minutes') { this.$emit('select-range', 3, 5); } else if (type === 'seconds') { this.$emit('select-range', 6, 8); } this.currentScrollbar = type; }, bindScrollEvent: function bindScrollEvent() { var _this2 = this; var bindFuntion = function bindFuntion(type) { _this2.$refs[type].wrap.onscroll = function (e) { // TODO: scroll is emitted when set scrollTop programatically // should find better solutions in the future! _this2.handleScroll(type, e); }; }; bindFuntion('hours'); bindFuntion('minutes'); bindFuntion('seconds'); }, handleScroll: function handleScroll(type) { var value = Math.min(Math.floor((this.$refs[type].wrap.scrollTop - 80) / 32 + 3), type === 'hours' ? 23 : 59); this.modifyDateField(type, value); }, // NOTE: used by datetime / date-range panel // renamed from adjustScrollTop // should try to refactory it adjustSpinners: function adjustSpinners() { this.adjustSpinner('hours', this.hours); this.adjustSpinner('minutes', this.minutes); this.adjustSpinner('seconds', this.seconds); }, adjustCurrentSpinner: function adjustCurrentSpinner(type) { this.adjustSpinner(type, this[type]); }, adjustSpinner: function adjustSpinner(type, value) { if (this.arrowControl) return; var el = this.$refs[type].wrap; if (el) { el.scrollTop = Math.max(0, (value - 2.5) * 32 + 80); } }, scrollDown: function scrollDown(step) { if (!this.currentScrollbar) { this.emitSelectRange('hours'); } var label = this.currentScrollbar; var hoursList = this.hoursList; var now = this[label]; if (this.currentScrollbar === 'hours') { var total = Math.abs(step); step = step > 0 ? 1 : -1; var length = hoursList.length; while (length-- && total) { now = (now + step + hoursList.length) % hoursList.length; if (hoursList[now]) { continue; } total--; } if (hoursList[now]) return; } else { now = (now + step + 60) % 60; } this.modifyDateField(label, now); this.adjustSpinner(label, now); }, amPm: function amPm(hour) { var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a'; if (!shouldShowAmPm) return ''; var isCapital = this.amPmMode === 'A'; var content = hour < 12 ? ' am' : ' pm'; if (isCapital) content = content.toUpperCase(); return content; } } }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /***/ }), /***/ 43: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-time-spinner",class:{ 'has-seconds': _vm.showSeconds }},[(!_vm.arrowControl)?[_c('el-scrollbar',{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('hours')},"mousemove":function($event){_vm.adjustCurrentSpinner('hours')}}},_vm._l((_vm.hoursList),function(disabled,hour){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': hour === _vm.hours, 'disabled': disabled },on:{"click":function($event){_vm.handleClick('hours', { value: hour, disabled: disabled })}}},[_vm._v(_vm._s(('0' + (_vm.amPmMode ? (hour % 12 || 12) : hour )).slice(-2))+_vm._s(_vm.amPm(hour)))])})),_c('el-scrollbar',{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('minutes')},"mousemove":function($event){_vm.adjustCurrentSpinner('minutes')}}},_vm._l((60),function(minute,key){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': key === _vm.minutes },on:{"click":function($event){_vm.handleClick('minutes', { value: key, disabled: false })}}},[_vm._v(_vm._s(('0' + key).slice(-2)))])})),_c('el-scrollbar',{directives:[{name:"show",rawName:"v-show",value:(_vm.showSeconds),expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('seconds')},"mousemove":function($event){_vm.adjustCurrentSpinner('seconds')}}},_vm._l((60),function(second,key){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': key === _vm.seconds },on:{"click":function($event){_vm.handleClick('seconds', { value: key, disabled: false })}}},[_vm._v(_vm._s(('0' + key).slice(-2)))])}))]:_vm._e(),(_vm.arrowControl)?[_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('hours')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"hours",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowHourList),function(hour){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': hour === _vm.hours, 'disabled': _vm.hoursList[hour] }},[_vm._v(_vm._s(hour === undefined ? '' : ('0' + (_vm.amPmMode ? (hour % 12 || 12) : hour )).slice(-2) + _vm.amPm(hour)))])}))]),_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('minutes')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"minutes",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowMinuteList),function(minute){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': minute === _vm.minutes }},[_vm._v("\n "+_vm._s(minute === undefined ? '' : ('0' + minute).slice(-2))+"\n ")])}))]),(_vm.showSeconds)?_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('seconds')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"seconds",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowSecondList),function(second){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': second === _vm.seconds }},[_vm._v("\n "+_vm._s(second === undefined ? '' : ('0' + second).slice(-2))+"\n ")])}))]):_vm._e()]:_vm._e()],2)} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), /***/ 44: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"},on:{"after-leave":function($event){_vm.$emit('dodestroy')}}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-time-panel el-popper",class:_vm.popperClass},[_c('div',{staticClass:"el-time-panel__content",class:{ 'has-seconds': _vm.showSeconds }},[_c('time-spinner',{ref:"spinner",attrs:{"arrow-control":_vm.useArrow,"show-seconds":_vm.showSeconds,"am-pm-mode":_vm.amPmMode,"date":_vm.date},on:{"change":_vm.handleChange,"select-range":_vm.setSelectionRange}})],1),_c('div',{staticClass:"el-time-panel__footer"},[_c('button',{staticClass:"el-time-panel__btn cancel",attrs:{"type":"button"},on:{"click":_vm.handleCancel}},[_vm._v(_vm._s(_vm.t('el.datepicker.cancel')))]),_c('button',{staticClass:"el-time-panel__btn",class:{confirm: !_vm.disabled},attrs:{"type":"button"},on:{"click":function($event){_vm.handleConfirm()}}},[_vm._v(_vm._s(_vm.t('el.datepicker.confirm')))])])])])} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), /***/ 5: /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/locale"); /***/ }), /***/ 6: /***/ (function(module, exports) { module.exports = require("element-ui/lib/input"); /***/ }), /***/ 7: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/vue-popper"); /***/ }), /***/ 9: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/merge"); /***/ }) /******/ });
"use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**! * is * the definitive JavaScript type testing library * * @copyright 2013 Enrico Marino * @license MIT */ var objProto = Object.prototype; var owns = objProto.hasOwnProperty; var toString = objProto.toString; var isActualNaN = function isActualNaN(value) { return value !== value; }; var NON_HOST_TYPES = { "boolean": 1, "number": 1, "string": 1, "undefined": 1 }; /** * Expose `is` */ var is = module.exports = {}; /** * Test general. */ /** * is.type * Test if `value` is a type of `type`. * * @param {Mixed} value value to test * @param {String} type type * @return {Boolean} true if `value` is a type of `type`, false otherwise * @api public */ is.a = is.type = function (value, type) { return (typeof value === "undefined" ? "undefined" : _typeof(value)) === type; }; /** * is.defined * Test if `value` is defined. * * @param {Mixed} value value to test * @return {Boolean} true if 'value' is defined, false otherwise * @api public */ is.defined = function (value) { return value !== undefined; }; /** * is.empty * Test if `value` is empty. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is empty, false otherwise * @api public */ is.empty = function (value) { var type = toString.call(value); var key; if ('[object Array]' === type || '[object Arguments]' === type) { return value.length === 0; } if ('[object Object]' === type) { for (key in value) { if (owns.call(value, key)) return false; }return true; } if ('[object String]' === type) { return '' === value; } return false; }; /** * is.equal * Test if `value` is equal to `other`. * * @param {Mixed} value value to test * @param {Mixed} other value to compare with * @return {Boolean} true if `value` is equal to `other`, false otherwise */ is.equal = function (value, other) { var type = toString.call(value); var key; if (type !== toString.call(other)) { return false; } if ('[object Object]' === type) { for (key in value) { if (!is.equal(value[key], other[key])) { return false; } } return true; } if ('[object Array]' === type) { key = value.length; if (key !== other.length) { return false; } while (--key) { if (!is.equal(value[key], other[key])) { return false; } } return true; } if ('[object Function]' === type) { return value.prototype === other.prototype; } if ('[object Date]' === type) { return value.getTime() === other.getTime(); } return value === other; }; /** * is.hosted * Test if `value` is hosted by `host`. * * @param {Mixed} value to test * @param {Mixed} host host to test with * @return {Boolean} true if `value` is hosted by `host`, false otherwise * @api public */ is.hosted = function (value, host) { var type = _typeof(host[value]); return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; }; /** * is.instance * Test if `value` is an instance of `constructor`. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an instance of `constructor` * @api public */ is.instance = is['instanceof'] = function (value, constructor) { return value instanceof constructor; }; /** * is.null * Test if `value` is null. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is null, false otherwise * @api public */ is['null'] = function (value) { return value === null; }; /** * is.undefined * Test if `value` is undefined. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is undefined, false otherwise * @api public */ is.undefined = function (value) { return value === undefined; }; /** * Test arguments. */ /** * is.arguments * Test if `value` is an arguments object. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an arguments object, false otherwise * @api public */ is.arguments = function (value) { var isStandardArguments = '[object Arguments]' === toString.call(value); var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee); return isStandardArguments || isOldArguments; }; /** * Test array. */ /** * is.array * Test if 'value' is an array. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an array, false otherwise * @api public */ is.array = function (value) { return '[object Array]' === toString.call(value); }; /** * is.arguments.empty * Test if `value` is an empty arguments object. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an empty arguments object, false otherwise * @api public */ is.arguments.empty = function (value) { return is.arguments(value) && value.length === 0; }; /** * is.array.empty * Test if `value` is an empty array. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an empty array, false otherwise * @api public */ is.array.empty = function (value) { return is.array(value) && value.length === 0; }; /** * is.arraylike * Test if `value` is an arraylike object. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an arguments object, false otherwise * @api public */ is.arraylike = function (value) { return !!value && !is.boolean(value) && owns.call(value, 'length') && isFinite(value.length) && is.number(value.length) && value.length >= 0; }; /** * Test boolean. */ /** * is.boolean * Test if `value` is a boolean. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a boolean, false otherwise * @api public */ is.boolean = function (value) { return '[object Boolean]' === toString.call(value); }; /** * is.false * Test if `value` is false. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is false, false otherwise * @api public */ is['false'] = function (value) { return is.boolean(value) && (value === false || value.valueOf() === false); }; /** * is.true * Test if `value` is true. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is true, false otherwise * @api public */ is['true'] = function (value) { return is.boolean(value) && (value === true || value.valueOf() === true); }; /** * Test date. */ /** * is.date * Test if `value` is a date. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a date, false otherwise * @api public */ is.date = function (value) { return '[object Date]' === toString.call(value); }; /** * Test element. */ /** * is.element * Test if `value` is an html element. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an HTML Element, false otherwise * @api public */ is.element = function (value) { return value !== undefined && typeof HTMLElement !== 'undefined' && value instanceof HTMLElement && value.nodeType === 1; }; /** * Test error. */ /** * is.error * Test if `value` is an error object. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an error object, false otherwise * @api public */ is.error = function (value) { return '[object Error]' === toString.call(value); }; /** * Test function. */ /** * is.fn / is.function (deprecated) * Test if `value` is a function. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a function, false otherwise * @api public */ is.fn = is['function'] = function (value) { var isAlert = typeof window !== 'undefined' && value === window.alert; return isAlert || '[object Function]' === toString.call(value); }; /** * Test number. */ /** * is.number * Test if `value` is a number. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a number, false otherwise * @api public */ is.number = function (value) { return '[object Number]' === toString.call(value); }; /** * is.infinite * Test if `value` is positive or negative infinity. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise * @api public */ is.infinite = function (value) { return value === Infinity || value === -Infinity; }; /** * is.decimal * Test if `value` is a decimal number. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a decimal number, false otherwise * @api public */ is.decimal = function (value) { return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0; }; /** * is.divisibleBy * Test if `value` is divisible by `n`. * * @param {Number} value value to test * @param {Number} n dividend * @return {Boolean} true if `value` is divisible by `n`, false otherwise * @api public */ is.divisibleBy = function (value, n) { var isDividendInfinite = is.infinite(value); var isDivisorInfinite = is.infinite(n); var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0; return isDividendInfinite || isDivisorInfinite || isNonZeroNumber && value % n === 0; }; /** * is.int * Test if `value` is an integer. * * @param value to test * @return {Boolean} true if `value` is an integer, false otherwise * @api public */ is.int = function (value) { return is.number(value) && !isActualNaN(value) && value % 1 === 0; }; /** * is.maximum * Test if `value` is greater than 'others' values. * * @param {Number} value value to test * @param {Array} others values to compare with * @return {Boolean} true if `value` is greater than `others` values * @api public */ is.maximum = function (value, others) { if (isActualNaN(value)) { throw new TypeError('NaN is not a valid value'); } else if (!is.arraylike(others)) { throw new TypeError('second argument must be array-like'); } var len = others.length; while (--len >= 0) { if (value < others[len]) { return false; } } return true; }; /** * is.minimum * Test if `value` is less than `others` values. * * @param {Number} value value to test * @param {Array} others values to compare with * @return {Boolean} true if `value` is less than `others` values * @api public */ is.minimum = function (value, others) { if (isActualNaN(value)) { throw new TypeError('NaN is not a valid value'); } else if (!is.arraylike(others)) { throw new TypeError('second argument must be array-like'); } var len = others.length; while (--len >= 0) { if (value > others[len]) { return false; } } return true; }; /** * is.nan * Test if `value` is not a number. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is not a number, false otherwise * @api public */ is.nan = function (value) { return !is.number(value) || value !== value; }; /** * is.even * Test if `value` is an even number. * * @param {Number} value value to test * @return {Boolean} true if `value` is an even number, false otherwise * @api public */ is.even = function (value) { return is.infinite(value) || is.number(value) && value === value && value % 2 === 0; }; /** * is.odd * Test if `value` is an odd number. * * @param {Number} value value to test * @return {Boolean} true if `value` is an odd number, false otherwise * @api public */ is.odd = function (value) { return is.infinite(value) || is.number(value) && value === value && value % 2 !== 0; }; /** * is.ge * Test if `value` is greater than or equal to `other`. * * @param {Number} value value to test * @param {Number} other value to compare with * @return {Boolean} * @api public */ is.ge = function (value, other) { if (isActualNaN(value) || isActualNaN(other)) { throw new TypeError('NaN is not a valid value'); } return !is.infinite(value) && !is.infinite(other) && value >= other; }; /** * is.gt * Test if `value` is greater than `other`. * * @param {Number} value value to test * @param {Number} other value to compare with * @return {Boolean} * @api public */ is.gt = function (value, other) { if (isActualNaN(value) || isActualNaN(other)) { throw new TypeError('NaN is not a valid value'); } return !is.infinite(value) && !is.infinite(other) && value > other; }; /** * is.le * Test if `value` is less than or equal to `other`. * * @param {Number} value value to test * @param {Number} other value to compare with * @return {Boolean} if 'value' is less than or equal to 'other' * @api public */ is.le = function (value, other) { if (isActualNaN(value) || isActualNaN(other)) { throw new TypeError('NaN is not a valid value'); } return !is.infinite(value) && !is.infinite(other) && value <= other; }; /** * is.lt * Test if `value` is less than `other`. * * @param {Number} value value to test * @param {Number} other value to compare with * @return {Boolean} if `value` is less than `other` * @api public */ is.lt = function (value, other) { if (isActualNaN(value) || isActualNaN(other)) { throw new TypeError('NaN is not a valid value'); } return !is.infinite(value) && !is.infinite(other) && value < other; }; /** * is.within * Test if `value` is within `start` and `finish`. * * @param {Number} value value to test * @param {Number} start lower bound * @param {Number} finish upper bound * @return {Boolean} true if 'value' is is within 'start' and 'finish' * @api public */ is.within = function (value, start, finish) { if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) { throw new TypeError('NaN is not a valid value'); } else if (!is.number(value) || !is.number(start) || !is.number(finish)) { throw new TypeError('all arguments must be numbers'); } var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish); return isAnyInfinite || value >= start && value <= finish; }; /** * Test object. */ /** * is.object * Test if `value` is an object. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is an object, false otherwise * @api public */ is.object = function (value) { return value && '[object Object]' === toString.call(value); }; /** * is.hash * Test if `value` is a hash - a plain object literal. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a hash, false otherwise * @api public */ is.hash = function (value) { return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval; }; /** * Test regexp. */ /** * is.regexp * Test if `value` is a regular expression. * * @param {Mixed} value value to test * @return {Boolean} true if `value` is a regexp, false otherwise * @api public */ is.regexp = function (value) { return '[object RegExp]' === toString.call(value); }; /** * Test string. */ /** * is.string * Test if `value` is a string. * * @param {Mixed} value value to test * @return {Boolean} true if 'value' is a string, false otherwise * @api public */ is.string = function (value) { return '[object String]' === toString.call(value); };
////////////////////////////////////////////////////////////////////////////////// // // ////////////////////////////////////////////////////////////////////////////////// var triangles = 1; var vertexIdxArray = new Int16Array(triangles * 3); var i = 0; vertexIdxArray[i+0] = 0; vertexIdxArray[i+1] = 1; vertexIdxArray[i+2] = 2; i += 3; var vertexPosArray = new Float32Array(triangles * 3 * 3); var i = 0; vertexPosArray[i+0] = 0; vertexPosArray[i+1] = 0; vertexPosArray[i+2] = 0; i += 3; vertexPosArray[i+0] = 1; vertexPosArray[i+1] = 0; vertexPosArray[i+2] = 0; i += 3; vertexPosArray[i+0] = 0; vertexPosArray[i+1] = 1; vertexPosArray[i+2] = 0; i += 3; var uvArray = new Float32Array(triangles * 3 * 2); var i = 0; uvArray[i+0] = 0; uvArray[i+1] = 0; i += 2; uvArray[i+0] = 1; uvArray[i+1] = 0; i += 2; uvArray[i+0] = 0; uvArray[i+1] = 1; i += 2; // var vertexIdxArray = new Int16Array(53185 * 3); // var vertexPosArray = new Float32Array(100876 * 3); // var uvArray = new Float32Array(53185 * 2); ////////////////////////////////////////////////////////////////////////////////// // // ////////////////////////////////////////////////////////////////////////////////// var buffer = saveToBuffer(vertexIdxArray, vertexPosArray, uvArray); require('fs').writeFileSync('modelgeneric.bin', buffer, 'binary') return; function saveToBuffer(vertexIdxArray, vertexPosArray, uvArray){ var types = { padding : 0, vertexIdx : 1, vertexPos : 2, vertexUv : 3, }; // compute the buffer length var bufferLen = 0; bufferLen += chunkLength(bufferLen, vertexIdxArray); bufferLen += chunkLength(bufferLen, vertexPosArray); bufferLen += chunkLength(bufferLen, uvArray); console.log('bufferLen', bufferLen); var buffer = new Buffer(bufferLen) var offset = 0; offset = chunkSave(buffer, offset, types.vertexIdx, vertexIdxArray); offset = chunkSave(buffer, offset, types.vertexPos, vertexPosArray); offset = chunkSave(buffer, offset, types.vertexUv , uvArray); return buffer; /** * TODO * * improve padding tech * * type of chunck as 8bit * * if type === 0, then skip. in reader * * offset % 4 != 2, then add padding * * how to estimate the size of the output ? */ function chunkLength(offset, arr){ var length = 0; // length of the padding var padLength = [3, 2, 1, 0][offset % 4]; length += padLength; // length of type length += 1; // length of nElements length += 4; // length of the array itself length += arr.byteLength; return length; } function chunkSave(buffer, offset, chunkType, arr){ // write the padding if needed var padLength = [3, 2, 1, 0][offset % 4]; for(var i = 0; i < padLength; i++){ buffer.writeUInt8(types.padding, offset); offset += 1; } // write the chunk header buffer.writeUInt8(chunkType, offset); offset += 1; // write the array buffer.writeUInt32LE(arr.length, offset); offset += 4; if( arr.byteLength / arr.length === 4 ){ for(var i = 0; i < arr.length; i++){ buffer.writeFloatLE(arr[i], offset); offset += 4; } }else if( arr.byteLength / arr.length === 2 ){ for(var i = 0; i < arr.length; i++){ buffer.writeUInt16LE(arr[i], offset); offset += 2; } }else console.assert(false); // return the new offset return offset; } }
from .predictor import BasePredictor, SegPredictor, ImSpecPredictor, Locator from .epredictor import EnsemblePredictor, ensemble_locate __all__ = ["BasePredictor", "SegPredictor", "ImSpecPredictor", "EnsemblePredictor", "ensemble_locate", "Locator"]
import Markdown from '@/components/Markdown' export default class WhiteSpace extends Markdown { markdown = (lang) => { /* eslint import/no-dynamic-require: 0 */ return require(`@/docs/${lang}/white-space.md`) } }
/** * Filter by a configurable Ext.picker.DatePicker menu * * Example Usage: * * var grid = Ext.create('Ext.grid.Panel', { * ... * columns: [{ * // required configs * text: 'Date Added', * dataIndex: 'dateAdded', * * filter: { * type: 'date', * * // optional configs * dateFormat: 'm/d/Y', // default * pickerDefaults: { * // any DatePicker configs * }, * * active: true // default is false * } * }], * ... * }); */ Ext.define('Ext.grid.filters.filter.Date', { extend: 'Ext.grid.filters.filter.TriFilter', alias: 'grid.filter.date', uses: ['Ext.picker.Date', 'Ext.menu.Menu'], type: 'date', config: { /** * @cfg {Object} [fields] * Configures field items individually. These properties override those defined * by `{@link #itemDefaults}`. * * Example usage: * fields: { * gt: { // override fieldCfg options * width: 200 * } * }, */ fields: { lt: {text: 'Before'}, gt: {text: 'After'}, eq: {text: 'On'} }, /** * @cfg {Object} pickerDefaults * Configuration options for the date picker associated with each field. */ pickerDefaults: { xtype: 'datepicker', border: 0 } }, itemDefaults: { xtype: 'menucheckitem', selectOnFocus: true, width: 125, menu: { layout: 'auto', plain: true } }, /** * @cfg {String} dateFormat * The date format to return when using getValue. * Defaults to {@link Ext.Date.defaultFormat}. */ dateFormat: null, /** * @cfg {Date} maxDate * Allowable date as passed to the Ext.DatePicker * Defaults to undefined. */ /** * @cfg {Date} minDate * Allowable date as passed to the Ext.DatePicker * Defaults to undefined. */ /** * @private * Will convert a timestamp to a Date object or vice-versa. * @param {Date/Number} value * @param {Boolean} [convertToDate] * @return {Date/Number} */ convertValue: function (value, convertToDate) { if (convertToDate && !Ext.isDate(value)) { value = Ext.isDate(value); } else if (!convertToDate && Ext.isDate(value)) { value = (+value); } return value; }, /** * @private * Template method that is to initialize the filter and install required menu items. */ createMenu: function (config) { var me = this, listeners = { scope: me, checkchange: me.onCheckChange }, fields, itemDefaults, pickerCfg, i, len, key, item, cfg, field; me.callParent(arguments); itemDefaults = me.getItemDefaults(); fields = me.getFields(); if (!me.dateFormat) { me.dateFormat = Ext.Date.defaultFormat; } pickerCfg = Ext.apply({ minDate: me.minDate, maxDate: me.maxDate, format: me.dateFormat, listeners: { scope: me, select: me.onMenuSelect } }, me.getPickerDefaults()); me.fields = {}; for (i = 0, len = me.menuItems.length; i < len; i++) { key = me.menuItems[i]; if (key !== '-') { cfg = { menu: { items: [ Ext.apply({ itemId: key }, pickerCfg) ] } }; if (itemDefaults) { Ext.merge(cfg, itemDefaults); } if (fields) { Ext.merge(cfg, fields[key]); } item = me.menu.add(cfg); // Date filter types need the field to be the datepicker in TriFilter.setValue(). field = me.fields[key] = item.down('datepicker'); field.filter = me.filter[key]; field.filterKey = key; item.on(listeners); } } }, /** * Gets the menu picker associated with the passed field * @param {String} item The field identifier ('lt', 'gt', 'eq') * @return {Object} The menu picker */ getPicker: function (item){ return this.fields[item]; }, /** * @private * Remove the filter from the store but don't update its value or the field UI. */ onCheckChange: function (field, checked) { // Only do something if unchecked. If checked, it doesn't mean anything at this point since the column's store filter won't have // any value (i.e., if a user checked this from an unchecked state, the corresponding field won't have a value for its filter). var filter = field.down('datepicker').filter, v; // Only proceed if unchecked AND there's a filter value (i.e., there's something to do!). if (!checked && filter.getValue()) { // Normally we just want to remove the filter from the store, not also to null out the filter value. But, we want to call setValue() // which will take care of unchecking the top-level menu item if it's been determined that Date* doesn't have any filters. v = {}; v[filter.getOperator()] = null; this.setValue(v); } }, onFilterRemove: function (operator) { var v = {}; v[operator] = null; this.setValue(v); this.fields[operator].up('menuitem').setChecked(false, /*suppressEvents*/ true); }, /** * Handler for when the DatePicker for a field fires the 'select' event * @param {Ext.picker.Date} picker * @param {Object} date */ onMenuSelect: function (picker, date) { var fields = this.fields, field = fields[picker.itemId], gt = fields.gt, lt = fields.lt, eq = fields.eq, v = {}; field.up('menuitem').setChecked(true, /*suppressEvents*/ true); if (field === eq) { lt.up('menuitem').setChecked(false, true); gt.up('menuitem').setChecked(false, true); } else { eq.up('menuitem').setChecked(false, true); if (field === gt && (+lt.value < +date)) { lt.up('menuitem').setChecked(false, true); } else if (field === lt && (+gt.value > +date)) { gt.up('menuitem').setChecked(false, true); } } v[field.filterKey] = date; this.setValue(v); picker.up('menu').hide(); } });
let U8 = (...a) => new Uint8Array(...a); class APU extends AudioWorkletProcessor { constructor() { super(); this.sampleIndex = 0; this.currentTime = 0; this.isFirstMessage = true; this.pendingUpdates = []; this.port.onmessage = (ev) => { if(this.memory) { if(this.isFirstMessage) { this.currentTime += (ev.data.t - this.currentTime) / 8; this.isFirstMessage = false; } this.pendingUpdates.push(ev.data); } else { this.load(ev.data[0], ev.data[1]); } }; } async load(platform_data, data) { let memory = new WebAssembly.Memory({ initial: 4, maximum: 4 }); let importObject = { env: { memory }, }; for (let n of ['acos', 'asin', 'atan', 'atan2', 'cos', 'exp', 'log', 'sin', 'tan', 'pow']) { importObject.env[n] = Math[n]; } for (let i = 9; i < 64; ++i) { importObject.env['reserved' + i] = () => { }; } let logLine = ''; importObject.env['logChar'] = (c) => { if(c == 10) { console.log(logLine); logLine = ''; } else { logLine += String.fromCharCode(c); } }; for (let i = 0; i < 16; ++i) { importObject.env['g_reserved' + i] = 0; } let instantiate = async (data) => (await WebAssembly.instantiate(data, importObject)).instance; let platform_instance = await instantiate(platform_data); for (let name in platform_instance.exports) { importObject.env[name] = platform_instance.exports[name] } let instance = await instantiate(data); this.memory = memory; this.snd = instance.exports.snd || platform_instance.exports.gesSnd; this.port.postMessage(2); } process(inputs, outputs, parameters) { this.isFirstMessage = true; if(this.snd) { while(this.pendingUpdates.length > 0 && this.pendingUpdates[0].t <= this.currentTime) { U8(this.memory.buffer, 80, 32).set(U8(this.pendingUpdates.shift().r)); } let u32Mem = new Uint32Array(this.memory.buffer); u32Mem[16] = this.currentTime; let channels = outputs[0]; let index = this.sampleIndex; let numSamples = channels[0].length; for(let i = 0; i < numSamples; ++i) { channels[0][i] = this.snd(index++); channels[1][i] = this.snd(index++); } this.sampleIndex = index & 0xffffffff; this.currentTime += numSamples / 44.1; } return true; } } registerProcessor('apu', APU);
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import json from itertools import chain from ansible.module_utils._text import to_bytes, to_text from ansible.module_utils.network.common.utils import to_list from ansible.plugins.cliconf import CliconfBase, enable_mode class Cliconf(CliconfBase): def get_device_info(self): device_info = {} device_info['network_os'] = 'asa' reply = self.get(b'show version') data = to_text(reply, errors='surrogate_or_strict').strip() match = re.search(r'Version (\S+),', data) if match: device_info['network_os_version'] = match.group(1) match = re.search(r'^Model Id:\s+(.+) \(revision', data, re.M) if match: device_info['network_os_model'] = match.group(1) match = re.search(r'^(.+) up', data, re.M) if match: device_info['network_os_hostname'] = match.group(1) return device_info @enable_mode def get_config(self, source='running', format='text'): if source not in ('running', 'startup'): return self.invalid_params("fetching configuration from %s is not supported" % source) if source == 'running': cmd = b'show running-config all' else: cmd = b'show startup-config' return self.send_command(cmd) @enable_mode def edit_config(self, command): for cmd in chain([b'configure terminal'], to_list(command), [b'end']): self.send_command(cmd) def get(self, command, prompt=None, answer=None, sendonly=False): return self.send_command(command, prompt=prompt, answer=answer, sendonly=sendonly) def get_capabilities(self): result = {} result['rpc'] = self.get_base_rpc() result['network_api'] = 'cliconf' result['device_info'] = self.get_device_info() return json.dumps(result)
var lastUpdate = 0; function enableButtons() { //var button = document.getElementById("main"); //button.value = "Update"; //button.onclick = setInterval( function(){ gapi.client.sudoku.getUpdates({ "from": lastUpdate }).execute(updateTable); }, 100); //}; var select = document.getElementsByTagName("select"); for(var i = 0; i<select.length; i++){ select[i].onchange = function(){ var value = this.value; var id = this.getAttribute("id"); gapi.client.sudoku.setCell_c({ "coords" : id, "value" : value }).execute(null); }; } } function authCallback(){ // Nothing } function getId(key){ return key.substr(key.length-2); } function updateCell(resp){ document.getElementById(getId(resp.id)).value = resp.value; } function updateTable(resp){ var cells = resp.items; if(cells){ for(var i = 0; i<cells.length; i++){ gapi.client.sudoku.getCell_c({"coords": cells[i]}).execute(updateCell); } lastUpdate = (new Date()).getTime(); console.log(lastUpdate); } } function doCallBack(response){ console.log(response.items); }
import _ from 'lodash'; import { Control } from './control'; import { RangeFilterManager } from './filter_manager/range_filter_manager'; const minMaxAgg = (field) => { const aggBody = {}; if (field.scripted) { aggBody.script = { inline: field.script, lang: field.lang }; } else { aggBody.field = field.name; } return { maxAgg: { max: aggBody }, minAgg: { min: aggBody } }; }; class RangeControl extends Control { constructor(controlParams, filterManager, min, max) { super(controlParams, filterManager); this.min = min; this.max = max; } } export async function rangeControlFactory(controlParams, kbnApi) { const indexPattern = await kbnApi.indexPatterns.get(controlParams.indexPattern); const searchSource = new kbnApi.SearchSource(); searchSource.inherits(false); //Do not filter by time so can not inherit from rootSearchSource searchSource.size(0); searchSource.index(indexPattern); searchSource.aggs(minMaxAgg(indexPattern.fields.byName[controlParams.fieldName])); const resp = await searchSource.fetch(); const min = _.get(resp, 'aggregations.minAgg.value'); const max = _.get(resp, 'aggregations.maxAgg.value'); const emptyValue = { min: min, max: min }; return new RangeControl( controlParams, new RangeFilterManager(controlParams.fieldName, indexPattern, kbnApi.queryFilter, emptyValue), min, max ); }
module.exports = function highlight (query, text, opts) { opts = opts || { tag: 'strong' } if (query.length === 0) { return text } var offset = text.toLowerCase().indexOf(query[0].toLowerCase()) if (offset === -1) return null var last = 0 for (var i = 1; i < query.length; i++) { if (text[offset + i] !== query[i]) { break } last = i } var before = text.slice(0, offset) var match = '<' + opts.tag + '>' + text.slice(offset, offset + last + 1) + '</' + opts.tag + '>' var after = highlight(query.slice(last + 1), text.slice(offset + last + 1), opts) return after === null ? null : before + match + after }
// (c) ammap.com | SVG (in JSON format) map of Gabon - Low // areas: {id:"GA-7"},{id:"GA-2"},{id:"GA-8"},{id:"GA-5"},{id:"GA-4"},{id:"GA-3"},{id:"GA-9"},{id:"GA-6"},{id:"GA-1"} AmCharts.maps.gabonLow={ "svg": { "defs": { "amcharts:ammap": { "projection":"mercator", "leftLongitude":"8.6990528", "topLatitude":"2.318109", "rightLongitude":"14.5269234", "bottomLatitude":"-3.9608057" } }, "g":{ "path":[ { "id":"GA-7", "title":"Ogooué-Lolo", "d":"M566.25,285.25L539.29,279.21L518.45,372.25L395.22,420.6L393.4,470.08L421.65,463.4L459.05,509.3L459.35,541.75L517.41,578.41L535.75,568.38L557.48,577.22L580.69,519.36L616.14,490.24L614.9,470.56L629.6,476.11L669.89,422.82L627.74,344.59L631.88,311.25L599.86,286.21L566.25,285.25z" }, { "id":"GA-2", "title":"Haut-Ogooué", "d":"M657.73,312.3L631.88,311.25L627.74,344.59L669.89,422.82L629.6,476.11L614.9,470.56L616.14,490.24L580.69,519.36L557.48,577.22L594.27,630.38L588.87,643.6L656.33,653.06L695.47,605.66L717.91,641.86L711.85,658.56L743.22,660.99L763.1,641.19L751.21,623.26L792.62,549.06L781.06,538.84L797.98,510.93L784.81,455.78L799.54,403.72L780.21,380.37L752.82,379.52L743.96,354.94L713.95,352.72L715.42,329.53L657.73,312.3z" }, { "id":"GA-8", "title":"Ogooué-Maritime", "d":"M45.27,420.89L43.02,398.48L35.43,407.96L45.27,420.89zM120.89,396.44L84.53,354.25L43.96,437.28L32.61,411.48L20.96,427.04L0.46,397.62L20.3,443.87L22.68,442.97L25.51,450.93L33.53,449.52L29.68,455.73L24.13,451.38L37.79,468.93L41.58,484.9L42,475.92L46.93,481.19L47.58,484.39L44.9,486.34L45.31,493.45L57.13,502.25L62.55,500.31L64.13,508.97L67.95,511.09L88.57,493.57L81.85,532.51L105.24,519.34L119.43,538.23L80.97,547.52L78.82,528.28L64.3,519.01L53.71,501.86L49.85,499.29L47.72,499.5L45.05,496.52L40.12,486.34L44.67,498.05L61.91,522.17L72.68,534.4L77.55,569.58L113.67,582.15L117.18,602.05L106.72,581.6L79.73,575.29L124.58,640.82L202.42,669.5L176.95,678.92L158.05,655.22L139.24,653.34L174.8,695.01L224.91,681.14L239.29,648.81L263.67,634.98L243.3,587.36L176.9,568.11L162.69,548.6L189.23,489.73L167.72,476.81L169.53,446.17L135.54,432.76L120.89,396.44z" }, { "id":"GA-5", "title":"Nyanga", "d":"M333.46,859.34L347.02,826.28L384.21,800.35L409.45,825.47L441.36,821.98L431.74,805.69L447.79,771.92L412.43,753.69L424.94,730.89L391.5,703.22L326.8,628.61L263.67,634.98L239.29,648.81L224.91,681.14L174.8,695.01L267.56,773.36L269.08,792.43L333.46,859.34z" }, { "id":"GA-4", "title":"Ngounié", "d":"M395.22,420.6L339.69,396.07L271,402.98L229.27,476.71L207.01,474.17L189.23,489.73L162.69,548.6L176.9,568.11L243.3,587.36L263.67,634.98L326.8,628.61L391.5,703.22L403.73,679.48L395.72,637.72L421.86,649.48L518.69,637.75L517.41,578.41L459.35,541.75L459.05,509.3L421.65,463.4L393.4,470.08L395.22,420.6z" }, { "id":"GA-3", "title":"Moyen-Ogooué", "d":"M291.19,284.94L272.13,287.92L255.55,323.61L195.23,368.63L180.28,374.03L166.69,358.47L120.5,374.22L120.89,396.44L135.54,432.76L169.53,446.17L167.72,476.81L189.23,489.73L207.01,474.17L229.27,476.71L271,402.98L339.69,396.07L395.22,420.6L356.33,326.68L398.01,285.17L291.19,284.94z" }, { "id":"GA-9", "title":"Wouleu-Ntem", "d":"M366.18,0L364.07,179.27L237.22,178.85L235.72,228.77L312.42,204.18L291.19,284.94L398.01,285.17L383.47,268.36L483.65,200.06L504.31,146.83L618.6,148.5L626.11,120.21L610.99,97.56L630.27,6.18L423.53,2.81L366.18,0z" }, { "id":"GA-6", "title":"Ogooué-Ivindo", "d":"M740.56,127.49L702.57,119.32L618.6,148.5L504.31,146.83L483.65,200.06L383.47,268.36L398.01,285.17L356.33,326.68L395.22,420.6L518.45,372.25L539.29,279.21L566.25,285.25L599.86,286.21L631.88,311.25L657.73,312.3L715.42,329.53L723.29,268.6L741.29,242.57L776.1,231.32L795.28,191.1L765.55,133.59L740.56,127.49z" }, { "id":"GA-1", "title":"Estuaire", "d":"M95.27,205.37L94.26,205.32L94.65,205.74L95.27,205.37zM150.2,180.52L136.94,170.72L120.37,181.48L126.09,252.25L121.31,234.39L106.28,234.39L116.61,223.02L85.88,230.63L84.47,241.91L110.96,276.79L183.6,290.97L146.83,299.56L154.21,313.61L111.81,290.97L109.58,303.31L91.98,291.92L89.94,267.86L84.53,354.25L120.89,396.44L120.5,374.22L166.69,358.47L180.28,374.03L195.23,368.63L255.55,323.61L272.13,287.92L291.19,284.94L312.42,204.18L235.72,228.77L237.22,178.85L177.42,179.54L172.37,189.5L150.2,180.52z" } ] } } };
'use strict'; var FieldOverrider = require('./utils/FieldOverrider'); var TimerRepository = require('./TimerRepository'); var TypeChecks = require('./utils/TypeChecks'); function Callback(f, args) { this.f = f; this.args = args; } Callback.prototype.call = function() { this.f.apply(undefined, this.args); }; function TimerInterceptor(timeServer, timerType) { this.timeServer = timeServer; this.timerType = timerType; } TimerInterceptor.prototype.intercept = function(config, uidGenerator) { this.config = config; this.timerRepository = new TimerRepository(this.config, uidGenerator); this.setTimers = new FieldOverrider( this.timerType.context, this.timerType.setName, this.addTimer.bind(this, this.timerType.type) ); this.clearTimers = new FieldOverrider( this.timerType.context, this.timerType.clearName, this.clearTimer.bind(this) ); if (this.config.fakeNodeDedicatedTimers) { var nodeTimers = require('timers'); this._nodeSetterOverrider = new FieldOverrider( nodeTimers, this.timerType.setName, this.addTimer.bind(this, this.timerType.type) ); this._nodeClearerOverrider = new FieldOverrider( nodeTimers, this.timerType.clearName, this.clearTimer.bind(this) ); } }; TimerInterceptor.prototype.release = function() { this.setTimers.restore(); this.clearTimers.restore(); if (this.config.fakeNodeDedicatedTimers) { this._nodeSetterOverrider.restore(); this._nodeClearerOverrider.restore(); } return this.timerRepository.releaseAll(); }; TimerInterceptor.prototype.nextTimers = function() { return this.timerRepository.nextTimers(); }; TimerInterceptor.prototype.lastTimer = function() { return this.timerRepository.lastTimer(); }; TimerInterceptor.prototype.createCallback = function(callback, args) { if (TypeChecks.isFunction(callback)) { return new Callback(callback, args); } if (this.config.acceptEvalTimers) { return new Callback(function() { /*jshint -W061 */ return eval(callback); }, []); } throw new Error( 'Node.js does not accept strings to be evaluated in timers. If you wish, you can configure Zurvan to use them, but beware.' ); }; var MINIMUM_CALL_DELAY = 1; var MAX_CALL_DELAY = Math.pow(2, 31) - 1; // int32 boundary function timerCreateErrorMessage(mustBe, given) { return ( 'Call delay in timer call must be ' + mustBe + ' given: << ' + given + ' >>' ); } TimerInterceptor.prototype.createCallDelay = function(requestedCallDelay) { if (!TypeChecks.isNumber(requestedCallDelay)) { if (this.config.denyImplicitTimer) { throw new Error( timerCreateErrorMessage('a numeric value', requestedCallDelay) ); } return MINIMUM_CALL_DELAY; } if (requestedCallDelay < MINIMUM_CALL_DELAY) { if (this.config.denyTimersShorterThan1Ms) { throw new Error( timerCreateErrorMessage('>= ' + MINIMUM_CALL_DELAY, requestedCallDelay) ); } return MINIMUM_CALL_DELAY; } if (requestedCallDelay > MAX_CALL_DELAY) { if (this.config.denyTimersLongerThanInt32) { throw new Error( timerCreateErrorMessage('<= ' + MAX_CALL_DELAY, requestedCallDelay) ); } return MINIMUM_CALL_DELAY; } return requestedCallDelay; }; TimerInterceptor.prototype.addTimer = function( TimerType, requestedCallback, requestedCallDelay ) { var callback = this.createCallback( requestedCallback, [].splice.call(arguments, 3) ); var callDelay = this.createCallDelay(requestedCallDelay); var timer = new TimerType( callback, this.timerRepository, this.timeServer.currentTime, callDelay ); return this.timerRepository.insertTimer(timer); }; TimerInterceptor.prototype.clearTimer = function(uid) { return this.timerRepository.clearTimer(uid); }; module.exports = TimerInterceptor;
var data = { "body": "<path d=\"M16 6v6c0 1.1.9 2 2 2h1v7c0 .55.45 1 1 1s1-.45 1-1V3.13c0-.65-.61-1.13-1.24-.98C17.6 2.68 16 4.51 16 6zm-5 3H9V3c0-.55-.45-1-1-1s-1 .45-1 1v6H5V3c0-.55-.45-1-1-1s-1 .45-1 1v6c0 2.21 1.79 4 4 4v8c0 .55.45 1 1 1s1-.45 1-1v-8c2.21 0 4-1.79 4-4V3c0-.55-.45-1-1-1s-1 .45-1 1v6z\" fill=\"currentColor\"/>", "width": 24, "height": 24 }; exports.__esModule = true; exports.default = data;
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. // Check that the test harness actually works "success"
import * as React from "react"; function IconReportAnalytics({ size = 24, color = "currentColor", stroke = 2, ...props }) { return <svg className="icon icon-tabler icon-tabler-report-analytics" width={size} height={size} viewBox="0 0 24 24" strokeWidth={stroke} stroke={color} fill="none" strokeLinecap="round" strokeLinejoin="round" {...props}><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><rect x={9} y={3} width={6} height={4} rx={2} /><path d="M9 17v-5" /><path d="M12 17v-1" /><path d="M15 17v-3" /></svg>; } export default IconReportAnalytics;
import numpy as np import pygame import sys import math BLUE = (0,0,255) BLACK = (0,0,0) RED = (255,0,0) YELLOW = (255,255,0) ROW_COUNT = 6 COLUMN_COUNT = 7 def create_board(): board = np.zeros((ROW_COUNT,COLUMN_COUNT)) return board def drop_piece(board, row, col, piece): board[row][col] = piece def is_valid_location(board, col): return board[ROW_COUNT-1][col] == 0 def get_next_open_row(board, col): for r in range(ROW_COUNT): if board[r][col] == 0: return r def print_board(board): print(np.flip(board, 0)) def winning_move(board, piece): # Check horizontal locations for win for c in range(COLUMN_COUNT-3): for r in range(ROW_COUNT): if board[r][c] == piece and board[r][c+1] == piece and board[r][c+2] == piece and board[r][c+3] == piece: return True for c in range(COLUMN_COUNT): for r in range(ROW_COUNT-3): if board[r][c] == piece and board[r+1][c] == piece and board[r+2][c] == piece and board[r+3][c] == piece: return True for c in range(COLUMN_COUNT-3): for r in range(ROW_COUNT-3): if board[r][c] == piece and board[r+1][c+1] == piece and board[r+2][c+2] == piece and board[r+3][c+3] == piece: return True for c in range(COLUMN_COUNT-3): for r in range(3, ROW_COUNT): if board[r][c] == piece and board[r-1][c+1] == piece and board[r-2][c+2] == piece and board[r-3][c+3] == piece: return True def draw_board(board): for c in range(COLUMN_COUNT): for r in range(ROW_COUNT): pygame.draw.rect(screen, BLUE, (c*SQUARESIZE, r*SQUARESIZE+SQUARESIZE, SQUARESIZE, SQUARESIZE)) pygame.draw.circle(screen, BLACK, (int(c*SQUARESIZE+SQUARESIZE/2), int(r*SQUARESIZE+SQUARESIZE+SQUARESIZE/2)), RADIUS) for c in range(COLUMN_COUNT): for r in range(ROW_COUNT): if board[r][c] == 1: pygame.draw.circle(screen, RED, (int(c*SQUARESIZE+SQUARESIZE/2), height-int(r*SQUARESIZE+SQUARESIZE/2)), RADIUS) elif board[r][c] == 2: pygame.draw.circle(screen, YELLOW, (int(c*SQUARESIZE+SQUARESIZE/2), height-int(r*SQUARESIZE+SQUARESIZE/2)), RADIUS) pygame.display.update() board = create_board() print_board(board) game_over = False turn = 0 pygame.init() SQUARESIZE = 100 width = COLUMN_COUNT * SQUARESIZE height = (ROW_COUNT+1) * SQUARESIZE size = (width, height) RADIUS = int(SQUARESIZE/2 - 5) screen = pygame.display.set_mode(size) draw_board(board) pygame.display.update() myfont = pygame.font.SysFont("monospace", 75) while not game_over: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() if event.type == pygame.MOUSEMOTION: pygame.draw.rect(screen, BLACK, (0,0, width, SQUARESIZE)) posx = event.pos[0] if turn == 0: pygame.draw.circle(screen, RED, (posx, int(SQUARESIZE/2)), RADIUS) else: pygame.draw.circle(screen, YELLOW, (posx, int(SQUARESIZE/2)), RADIUS) pygame.display.update() if event.type == pygame.MOUSEBUTTONDOWN: pygame.draw.rect(screen, BLACK, (0,0, width, SQUARESIZE)) if turn == 0: posx = event.pos[0] col = int(math.floor(posx/SQUARESIZE)) if is_valid_location(board, col): row = get_next_open_row(board, col) drop_piece(board, row, col, 1) if winning_move(board, 1): label = myfont.render("Player 1 wins!!", 1, RED) screen.blit(label, (40,10)) game_over = True else: posx = event.pos[0] col = int(math.floor(posx/SQUARESIZE)) if is_valid_location(board, col): row = get_next_open_row(board, col) drop_piece(board, row, col, 2) if winning_move(board, 2): label = myfont.render("Player 2 wins!!", 1, YELLOW) screen.blit(label, (40,10)) game_over = True print_board(board) draw_board(board) turn += 1 turn = turn % 2 if game_over: pygame.time.wait(3000)
/** * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow */ export default function parseDate(iso8601: string): ?Date { const regexp = new RegExp( '^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})' + 'T' + '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})' + '(.([0-9]+))?' + 'Z$'); const match = regexp.exec(iso8601); if (!match) { return null; } const year = parseInt(match[1]) || 0; const month = (parseInt(match[2]) || 1) - 1; const day = parseInt(match[3]) || 0; const hour = parseInt(match[4]) || 0; const minute = parseInt(match[5]) || 0; const second = parseInt(match[6]) || 0; const milli = parseInt(match[8]) || 0; return new Date(Date.UTC(year, month, day, hour, minute, second, milli)); }
module.exports = { prefix: 'fal', iconName: 'stopwatch', icon: [448, 512, [], "f2f2", "M393.3 141.3l17.5-17.5c4.7-4.7 4.7-12.3 0-17l-5.7-5.7c-4.7-4.7-12.3-4.7-17 0l-17.5 17.5c-35.8-31-81.5-50.9-131.7-54.2V32h25c6.6 0 12-5.4 12-12v-8c0-6.6-5.4-12-12-12h-80c-6.6 0-12 5.4-12 12v8c0 6.6 5.4 12 12 12h23v32.6C91.2 73.3 0 170 0 288c0 123.7 100.3 224 224 224s224-100.3 224-224c0-56.1-20.6-107.4-54.7-146.7zM224 480c-106.1 0-192-85.9-192-192S117.9 96 224 96s192 85.9 192 192-85.9 192-192 192zm4-128h-8c-6.6 0-12-5.4-12-12V172c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v168c0 6.6-5.4 12-12 12z"] };
var data = { "body": "<path d=\"M16.75 22.16l-2.75-3L15.16 18l1.59 1.59L20.34 16l1.16 1.41l-4.75 4.75M18 2c1.1 0 2 .9 2 2v9.34c-.63-.22-1.3-.34-2-.34V4h-5v8l-2.5-2.25L8 12V4H6v16h6.08c.12.72.37 1.39.72 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h12z\" fill=\"currentColor\"/>", "width": 24, "height": 24 }; exports.__esModule = true; exports.default = data;
from datetime import timedelta import matplotlib.dates as mdates import matplotlib.pyplot as plt import pandas as pd from measurement.models import Tick def get_last_15min_info_df(input_df): tmp_interval = timedelta(minutes=5) tmp_df = input_df[input_df.created_at > input_df.created_at.iloc[-1] - tmp_interval] tmp_df.index = tmp_df.created_at tmp_df = tmp_df.resample(rule="s").mean() return tmp_df.interpolate(method="linear") def get_last_10hour_info_df(input_df): tmp_interval = timedelta(hours=10) tmp_df = input_df[input_df.created_at > input_df.created_at.iloc[-1] - tmp_interval] tmp_df.index = tmp_df.created_at tmp_df = tmp_df.resample(rule="s").mean() return tmp_df.interpolate(method="linear") def get_last_1week_info_df(input_df): tmp_interval = timedelta(weeks=1) tmp_df = input_df[input_df.created_at > input_df.created_at.iloc[-1] - tmp_interval] tmp_df.index = tmp_df.created_at tmp_df = tmp_df.resample(rule="s").mean() return tmp_df.interpolate(method="linear") def draw_temperature_plot(input_df, input_ax): tmp_avg = input_df.temperature_inside.mean() input_ax.set_ylim(tmp_avg // 1 - 6, tmp_avg // 1 + 6) input_ax.set_ylabel('[°C]') input_ax.plot(input_df.index, input_df.temperature_inside, input_df.index, input_df.temperature_outside) def draw_pressure_plot(input_df, input_ax): tmp_avg = input_df.pressure_inside.mean() input_ax.set_ylim(tmp_avg // 1 - 5, tmp_avg // 1 + 5) input_ax.set_ylabel('[hPa]') input_ax.plot(input_df.index, 1006.7/1006.3 * input_df.pressure_inside, input_df.index, input_df.pressure_outside) def draw_humidity_plot(input_df, input_ax): tmp_avg = input_df.humidity_inside.mean() input_ax.set_ylim(tmp_avg // 1 - 10, tmp_avg // 1 + 10) input_ax.set_ylabel('[%]') input_ax.plot(input_df.index, 47/49.5 * input_df.humidity_inside, input_df.index, input_df.humidity_outside) def draw_plot_for_temperature(input_df, tmp_15min_df, tmp_10hour_df, tmp_1week_df): fig3 = plt.figure(constrained_layout=True, figsize=(16, 8)) gs = fig3.add_gridspec(3, 3) f3_ax1 = fig3.add_subplot(gs[0, :]) draw_temperature_plot(tmp_15min_df, f3_ax1) f3_ax1.set_title('Temperature for last 5 minutes') f3_ax1.xaxis.set_major_locator(mdates.MinuteLocator(interval=2)) f3_ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M')) f3_ax2 = fig3.add_subplot(gs[1, :]) draw_temperature_plot(tmp_10hour_df, f3_ax2) f3_ax2.set_title('Temperature for last 10 hours') f3_ax2.xaxis.set_major_locator(mdates.HourLocator(interval=2)) f3_ax2.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d-%H')) # f3_ax3 = fig3.add_subplot(gs[2, :]) # f3_ax3.set_title('Temperature for last 1 week') # f3_ax3.xaxis.set_major_locator(mdates.DayLocator(interval=2)) # f3_ax3.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d')) # draw_temperature_plot(tmp_1week_df, f3_ax3) fig3.savefig("/run/media/hoosiki/WareHouse2/hoosiki/JUPYTER/gitrepository/Django/iot2/iot2/static/images/temperature.png") def draw_plot_for_pressure(input_df, tmp_15min_df, tmp_10hour_df, tmp_1week_df): fig3 = plt.figure(constrained_layout=True, figsize=(16, 8)) gs = fig3.add_gridspec(3, 3) f3_ax1 = fig3.add_subplot(gs[0, :]) draw_pressure_plot(tmp_15min_df, f3_ax1) f3_ax1.set_title('Pressure for last 5 minutes') f3_ax1.xaxis.set_major_locator(mdates.MinuteLocator(interval=2)) f3_ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M')) tmp_10hour_df = get_last_10hour_info_df(input_df) f3_ax2 = fig3.add_subplot(gs[1, :]) draw_pressure_plot(tmp_10hour_df, f3_ax2) f3_ax2.set_title('Pressure for last 10 hours') f3_ax2.xaxis.set_major_locator(mdates.HourLocator(interval=2)) f3_ax2.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d-%H')) # f3_ax3 = fig3.add_subplot(gs[2, :]) # f3_ax3.set_title('Pressure for last 1 week') # f3_ax3.xaxis.set_major_locator(mdates.DayLocator(interval=2)) # f3_ax3.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d')) # draw_pressure_plot(tmp_1week_df, f3_ax3) fig3.savefig("/run/media/hoosiki/WareHouse2/hoosiki/JUPYTER/gitrepository/Django/iot2/iot2/static/images/pressure.png") def draw_plot_for_humidity(input_df, tmp_15min_df, tmp_10hour_df, tmp_1week_df): fig3 = plt.figure(constrained_layout=True, figsize=(16, 8)) gs = fig3.add_gridspec(3, 3) f3_ax1 = fig3.add_subplot(gs[0, :]) draw_humidity_plot(tmp_15min_df, f3_ax1) f3_ax1.set_title('Humidity for last 5 minutes') f3_ax1.xaxis.set_major_locator(mdates.MinuteLocator(interval=2)) f3_ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M')) f3_ax2 = fig3.add_subplot(gs[1, :]) f3_ax2.set_title('Humidity for last 10 hours') f3_ax2.xaxis.set_major_locator(mdates.HourLocator(interval=2)) f3_ax2.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d-%H')) draw_humidity_plot(tmp_10hour_df, f3_ax2) # f3_ax3 = fig3.add_subplot(gs[2, :]) # f3_ax3.set_title('Humidity for last 1 week') # f3_ax3.xaxis.set_major_locator(mdates.DayLocator(interval=2)) # f3_ax3.xaxis.set_major_formatter(mdates.DateFormatter('%m-%d')) # draw_humidity_plot(tmp_1week_df, f3_ax3) fig3.savefig("/run/media/hoosiki/WareHouse2/hoosiki/JUPYTER/gitrepository/Django/iot2/iot2/static/images/humidity.png")
/** * Square Connect API * Client library for accessing the Square Connect APIs * * OpenAPI spec version: 2.0 * Contact: developers@squareup.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.3.0-SNAPSHOT * */ var ApiClient = require('../ApiClient'); var Error = require('./Error'); /** * The BatchDeleteCatalogObjectsResponse model module. * @module model/BatchDeleteCatalogObjectsResponse */ /** * Constructs a new <code>BatchDeleteCatalogObjectsResponse</code>. * * @alias module:model/BatchDeleteCatalogObjectsResponse * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>BatchDeleteCatalogObjectsResponse</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {module:model/BatchDeleteCatalogObjectsResponse} obj Optional instance to populate. * @return {module:model/BatchDeleteCatalogObjectsResponse} The populated <code>BatchDeleteCatalogObjectsResponse</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('errors')) { obj['errors'] = ApiClient.convertToType(data['errors'], [Error]); } if (data.hasOwnProperty('deleted_object_ids')) { obj['deleted_object_ids'] = ApiClient.convertToType(data['deleted_object_ids'], ['String']); } if (data.hasOwnProperty('deleted_at')) { obj['deleted_at'] = ApiClient.convertToType(data['deleted_at'], 'String'); } } return obj; } /** * The set of Errors encountered. * @member {Array.<module:model/Error>} errors */ exports.prototype['errors'] = undefined; /** * The IDs of all CatalogObjects deleted by this request. * @member {Array.<String>} deleted_object_ids */ exports.prototype['deleted_object_ids'] = undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". * @member {String} deleted_at */ exports.prototype['deleted_at'] = undefined; module.exports = exports;
import React, { Component, PropTypes } from 'react'; import { Editor, createEditorState, ImageSideButton, Block, addNewBlock, getCurrentBlock, BLOCK_BUTTONS } from 'medium-draft'; import mediumDraftExporter from 'medium-draft/lib/exporter'; const ExtraButtons = [{ label: 'H1', style: 'header-one', icon: 'header', description: 'Heading 1' },{ label: 'H2', style: 'header-two', icon: 'header', description: 'Heading 2' }]; BLOCK_BUTTONS.splice(0, 0, ...ExtraButtons); class CustomImageSideButton extends ImageSideButton { onChange(e) { const file = e.target.files[0]; if (file.type.indexOf('image/') === 0) { // This is a post request to server endpoint with image as `image` const formData = new FormData(); formData.append('image', file); formData.append('name', 'test'); fetch('/upload', { method: 'POST', body: formData, }).then((response) => { console.log(response); if (response.status === 200) { // Assuming server responds with // `{ "url": "http://example-cdn.com/image.jpg"}` return response.json().then(data => { if (data.url) { this.props.setEditorState(addNewBlock( this.props.getEditorState(), Block.IMAGE, { src: '/uploads/' + data.url, } )); } }); } }); } this.props.close(); } } const headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest', }; export default class News extends Component { constructor(props) { super(props); this.state = { artical: { editorState: createEditorState(), title: null, slug_url: null, seo_title: '', seo_description: '', }, }; this.sideButtons = [{ title: 'Image', component: CustomImageSideButton, }]; } onChange(editorState) { this.setState({ editorState }); }; changeFieldValue(field, value) { const { artical } = this.state; artical[field] = value; this.setState({ artical }); } componentDidMount() { this.refs.editor.focus(); } getUrlSlug(title) { const slugUrl = title.toLowerCase() .replace(/ /g,'-') .replace(/[^\w-]+/g,'') ; return slugUrl; } saveArtical() { const artical = Object.assign({}, this.state.artical); artical.slugUrl = this.getUrlSlug(artical.title || ''); artical.content = mediumDraftExporter(artical.editorState.getCurrentContent()) artical.slug_url = artical.slugUrl; delete artical.editorState; delete artical.slugUrl; const url = `${this.props.baseUrl}/rest/news`; console.log(artical); fetch(url, { method: 'POST', headers, body: JSON.stringify({ "data": artical, }) }).then(res => { res.json().then(result => { if (result.affectedRows > 0) { alert("Post Inserted"); } }) }) } render() { const { news_url, data } = this.props; const { artical = {} } = this.state; const newsList = data ? data.newsList : []; console.log(newsList); return ( <div style={{ marginLeft: 25}}> { newsList.map((news, i) => ( <div className="news-list-item" style={{ display: 'flex', }}> <div className="image-container"> <img src="./uploads/download.jpeg" style={{ width: 150, height: 150}} /> </div> <div className="content-container"> <h3 style={{ fontSize: '14pt'}}> <a className="content-link" href={this.props.baseUrl + '/news/' + news.slug_url } > {news.title} </a> </h3> <p className="time-author"> Admin | 10-Jan-2018 </p> <p>{news.seo_description}</p> </div> </div> )) } </div> ); } }
# Copyright (c) OpenMMLab. All rights reserved. from typing import List, Optional, Union import mmcv import torch from mmcv.utils import Registry from torch.utils.data import DataLoader, Dataset from mmdeploy.codebase.base import CODEBASE, BaseTask, MMCodebase from mmdeploy.utils import Codebase, get_task_type def __build_mmcls_task(model_cfg: mmcv.Config, deploy_cfg: mmcv.Config, device: str, registry: Registry) -> BaseTask: task = get_task_type(deploy_cfg) return registry.module_dict[task.value](model_cfg, deploy_cfg, device) MMCLS_TASK = Registry('mmcls_tasks', build_func=__build_mmcls_task) @CODEBASE.register_module(Codebase.MMCLS.value) class MMClassification(MMCodebase): """mmclassification codebase class.""" task_registry = MMCLS_TASK def __init__(self): super(MMClassification, self).__init__() @staticmethod def build_task_processor(model_cfg: mmcv.Config, deploy_cfg: mmcv.Config, device: str) -> BaseTask: """The interface to build the task processors of mmseg. Args: model_cfg (mmcv.Config): Model config file. deploy_cfg (mmcv.Config): Deployment config file. device (str): A string specifying device type. Returns: BaseTask: A task processor. """ return MMCLS_TASK.build(model_cfg, deploy_cfg, device) @staticmethod def build_dataset(dataset_cfg: Union[str, mmcv.Config], dataset_type: str = 'val', **kwargs) -> Dataset: """Build dataset for classification. Args: dataset_cfg (str | mmcv.Config): The input dataset config. dataset_type (str): A string represents dataset type, e.g.: 'train' , 'test', 'val'. Default: 'val'. Returns: Dataset: A PyTorch dataset. """ from mmcls.datasets import build_dataset as build_dataset_mmcls from mmdeploy.utils import load_config dataset_cfg = load_config(dataset_cfg)[0] data = dataset_cfg.data assert dataset_type in data dataset = build_dataset_mmcls(data[dataset_type]) return dataset @staticmethod def build_dataloader(dataset: Dataset, samples_per_gpu: int, workers_per_gpu: int, num_gpus: int = 1, dist: bool = False, shuffle: bool = False, round_up: bool = True, seed: Optional[int] = None, pin_memory: bool = True, persistent_workers: bool = True, **kwargs) -> DataLoader: """Build dataloader for classifier. Args: dataset (Dataset): Input dataset. samples_per_gpu (int): Number of training samples on each GPU, i.e., batch size of each GPU. workers_per_gpu (int): How many subprocesses to use for data loading for each GPU. num_gpus (int): Number of GPUs. Only used in non-distributed training. dist (bool): Distributed training/test or not. Default: False. shuffle (bool): Whether to shuffle the data at every epoch. Default: False. round_up (bool): Whether to round up the length of dataset by adding extra samples to make it evenly divisible. Default: True. seed (int): An integer set to be seed. Default: None. pin_memory (bool): Whether to use pin_memory in DataLoader. Default: True. persistent_workers (bool): If `True`, the data loader will not shutdown the worker processes after a dataset has been consumed once. This allows to maintain the workers Dataset instances alive. The argument also has effect in PyTorch>=1.7.0. Default: True. kwargs: Any other keyword argument to be used to initialize DataLoader. Returns: DataLoader: A PyTorch dataloader. """ from mmcls.datasets import build_dataloader as build_dataloader_mmcls return build_dataloader_mmcls(dataset, samples_per_gpu, workers_per_gpu, num_gpus, dist, shuffle, round_up, seed, pin_memory, persistent_workers, **kwargs) @staticmethod def single_gpu_test(model: torch.nn.Module, data_loader: DataLoader, show: bool = False, out_dir: Optional[str] = None, win_name: str = '', **kwargs) -> List: """Run test with single gpu. Args: model (torch.nn.Module): Input model from nn.Module. data_loader (DataLoader): PyTorch data loader. show (bool): Specifying whether to show plotted results. Default: False. out_dir (str): A directory to save results, Default: None. win_name (str): The name of windows, Default: ''. Returns: list: The prediction results. """ from mmcls.apis import single_gpu_test outputs = single_gpu_test( model, data_loader, show, out_dir, win_name=win_name, **kwargs) return outputs
import React, { useContext } from 'react'; import { UserContext } from '../Store/UserContext'; const UserContainer = () => { const [user] = useContext(UserContext); const { nickName, birthday, gender, interests } = user; console.log(user); return ( <div className="user-container"> <h1>{`Hey ${nickName}!`}</h1> <div id="temp"> <p>profile-pic</p> </div> <div className="actions"></div> <h2>Profile:</h2> <p>{gender}</p> <p>{`birthday: ${birthday.month}/${birthday.day}/${birthday.year}`}</p> <p>{interests}</p> </div> ); }; export default UserContainer;
from datetime import datetime from unittest import TestCase from fjord.analytics.utils import counts_to_options, zero_fill from fjord.base.tests import eq_ from fjord.base.utils import epoch_milliseconds class TestCountsHelper(TestCase): def setUp(self): self.counts = [('apples', 5), ('bananas', 10), ('oranges', 6)] def test_basic(self): """Correct options should be set and values should be sorted. """ options = counts_to_options(self.counts, 'fruit', 'Fruit') eq_(options['name'], 'fruit') eq_(options['display'], 'Fruit') eq_(options['options'][0], { 'name': 'bananas', 'display': 'bananas', 'value': 'bananas', 'count': 10, 'checked': False, }) eq_(options['options'][1], { 'name': 'oranges', 'display': 'oranges', 'value': 'oranges', 'count': 6, 'checked': False, }) eq_(options['options'][2], { 'name': 'apples', 'display': 'apples', 'value': 'apples', 'count': 5, 'checked': False, }) def test_map_dict(self): options = counts_to_options(self.counts, 'fruit', display_map={ 'apples': 'Apples', 'bananas': 'Bananas', 'oranges': 'Oranges', }) # Note that options get sorted by count. eq_(options['options'][0]['display'], 'Bananas') eq_(options['options'][1]['display'], 'Oranges') eq_(options['options'][2]['display'], 'Apples') def test_map_func(self): options = counts_to_options(self.counts, 'fruit', value_map=lambda s: s.upper()) # Note that options get sorted by count. eq_(options['options'][0]['value'], 'BANANAS') eq_(options['options'][1]['value'], 'ORANGES') eq_(options['options'][2]['value'], 'APPLES') def test_checked(self): options = counts_to_options(self.counts, 'fruit', checked='apples') # Note that options get sorted by count. assert not options['options'][0]['checked'] assert not options['options'][1]['checked'] assert options['options'][2]['checked'] class TestZeroFillHelper(TestCase): def test_zerofill(self): start = datetime(2012, 1, 1) end = datetime(2012, 1, 7) data1 = { epoch_milliseconds(datetime(2012, 1, 3)): 1, epoch_milliseconds(datetime(2012, 1, 5)): 1, } data2 = { epoch_milliseconds(datetime(2012, 1, 2)): 1, epoch_milliseconds(datetime(2012, 1, 5)): 1, epoch_milliseconds(datetime(2012, 1, 10)): 1, } zero_fill(start, end, [data1, data2]) for day in range(1, 7): millis = epoch_milliseconds(datetime(2012, 1, day)) assert millis in data1, 'Day %s was not zero filled.' % day assert millis in data2, 'Day %s was not zero filled.' % day
"use strict"; const VersionManager = require("../VersionManager"), NodeTemplateModule = require("../Templates/Modules/NodeJS/NodeTemplateModule"); // Run Templates VersionManager .VersionTemplates .addTemplate(NodeTemplateModule.standard(require("path").join(__dirname, '..'))) .runTemplate((new VersionManager.VersionProgram(__filename+'on')).getUpdated());
/*! Zoom v1.7.13 - 2014-04-29 Enlarge images on click or mouseover. (c) 2014 Jack Moore - http://www.jacklmoore.com/zoom license: http://www.opensource.org/licenses/mit-license.php */ (function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,a,m,l,r,s,f=o(t).css("position"),h=o(n);return t.style.position=/(absolute|fixed)/.test(f)?f:"relative",t.style.overflow="hidden",e.style.width=e.style.height="",o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){c=o(t).outerWidth(),u=o(t).outerHeight(),n===t?(m=c,a=u):(m=h.outerWidth(),a=h.outerHeight()),l=(e.width-c)/m,r=(e.height-u)/a,s=h.offset()},move:function(o){var t=o.pageX-s.left,n=o.pageY-s.top;n=Math.max(Math.min(n,a),0),t=Math.max(Math.min(t,m),0),e.style.left=t*-l+"px",e.style.top=n*-r+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e,i=o.extend({},t,n||{}),u=i.target||this,c=this,a=o(c),m=document.createElement("img"),l=o(m),r="mousemove.zoom",s=!1,f=!1;(i.url||(e=a.find("img"),e[0]&&(i.url=e.data("src")||e.attr("src")),i.url))&&(function(){var o=u.style.position,t=u.style.overflow;a.one("zoom.destroy",function(){a.off(".zoom"),u.style.position=o,u.style.overflow=t,l.remove()})}(),m.onload=function(){function t(t){e.init(),e.move(t),l.stop().fadeTo(o.support.opacity?i.duration:0,1,o.isFunction(i.onZoomIn)?i.onZoomIn.call(m):!1)}function n(){l.stop().fadeTo(i.duration,0,o.isFunction(i.onZoomOut)?i.onZoomOut.call(m):!1)}var e=o.zoom(u,c,m,i.magnify);"grab"===i.on?a.on("mousedown.zoom",function(i){1===i.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(r,e.move)}),t(i),o(document).on(r,e.move),i.preventDefault())}):"click"===i.on?a.on("click.zoom",function(i){return s?void 0:(s=!0,t(i),o(document).on(r,e.move),o(document).one("click.zoom",function(){n(),s=!1,o(document).off(r,e.move)}),!1)}):"toggle"===i.on?a.on("click.zoom",function(o){s?n():t(o),s=!s}):"mouseover"===i.on&&(e.init(),a.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(r,e.move)),i.touch&&a.on("touchstart.zoom",function(o){o.preventDefault(),f?(f=!1,n()):(f=!0,t(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),e.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}),o.isFunction(i.callback)&&i.callback.call(m)},m.src=i.url)})},o.fn.zoom.defaults=t})(window.jQuery);
import { assign } from "../../utils"; import getIdentityOptionsValidator from "./getIdentity/getIdentityOptionsValidator"; export default (({ addEcidQueryToPayload, ensureSingleIdentity, setLegacyEcid, handleResponseForIdSyncs, getEcidFromResponse, getIdentity, consent }) => { let ecid; let edge = {}; return { lifecycle: { onBeforeRequest({ request, onResponse, onRequestFailure }) { // Querying the ECID on every request to be able to set the legacy cookie, and make it // available for the `getIdentity` command. addEcidQueryToPayload(request.getPayload()); return ensureSingleIdentity({ request, onResponse, onRequestFailure }); }, onResponse({ response }) { if (!ecid) { ecid = getEcidFromResponse(response); // Only data collection calls will have an ECID in the response. // https://jira.corp.adobe.com/browse/EXEG-1234 if (ecid) { setLegacyEcid(ecid); } } // For sendBeacon requests, getEdge() will return {}, so we are using assign here // so that sendBeacon requests don't override the edge info from before. edge = assign(edge, response.getEdge()); return handleResponseForIdSyncs(response); } }, commands: { getIdentity: { optionsValidator: getIdentityOptionsValidator, run: options => { return consent.awaitConsent().then(() => { return ecid ? undefined : getIdentity(options.namespaces); }).then(() => { return { identity: { ECID: ecid }, edge }; }); } } } }; });
// import media from '../styles/media' import styled from "styled-components" import { Link } from "gatsby" import React, { Component } from "react" import typographies from "../styles/typography_styles" import media from "../styles/media" // import { library } from "@fortawesome/fontawesome-svg-core" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faGithub, faLinkedin } from "@fortawesome/free-brands-svg-icons" const { colors } = typographies const NavStyle = styled(Link)` float: right; padding: 1rem; font-size: 2rem; ${media.tab_land` font-size: 2rem; `} display: inline-block; font-weight: 300; border-radius: 1rem; border: 1px solid rgba(99, 71, 151, 0); transition: all 0.2s; &:hover { border: 1px solid rgba(99, 71, 151, 0.1); color: ${colors.main}; } margin-top: 0.3rem; margin-right: 0; &:not(:first-child) { margin-right: 1rem; } ` const NavLink = ({ children, ...props }) => { return <NavStyle to={props.to}>{children}</NavStyle> } const headerStyles = { NavLink } export default headerStyles
var BaseError = require('./baseError'); function VariantAlsoNegotiates() { BaseError.apply(this, arguments); Error.captureStackTrace(this, VariantAlsoNegotiates); } VariantAlsoNegotiates.prototype = Object.create(BaseError.prototype); VariantAlsoNegotiates.prototype.constructor = VariantAlsoNegotiates; VariantAlsoNegotiates.prototype.code = 506; module.exports = VariantAlsoNegotiates;
//REACT import React, { useEffect, useState } from "react"; //REDUX import { connect } from "react-redux"; import { bindActionCreators } from "redux"; import * as actions from "../../../store/actions"; //CoreUI //Componets import PlaylistVideos from "../components/playlistVideos"; //Style //API const Playlist = ({ user, history }) => { const [state, setState] = useState({ fetched: false, }); useEffect(() => { if (!state.fetched) { if (!user) { alert( "Houve um problema", "Você não está logado para realizar essa ação por favor realize o login.", [ { label: "Cancelar", onClick: () => { history.push("/home"); }, }, { label: "Login", onClick: () => { history.push("/login"); }, }, ] ); } setState({ ...state, fetched: true }); } }, [history, state, user]); return ( <div> <PlaylistVideos/> </div> ); }; const mapStateToProps = (state) => ({ user: state.user }); const mapDispatchToProps = (dispatch) => bindActionCreators(actions, dispatch); export default connect(mapStateToProps, mapDispatchToProps)(Playlist);
module.exports={A:{A:{"2":"J E F G A B kB"},B:{"1":"P Q T U V W X Y Z a b c R d H e","2":"C K L D M N O"},C:{"2":"lB dB I f J E F G A B C K L D M nB oB","4":"N O g h","194":"0 1 2 3 4 5 6 7 8 9 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB eB KB fB LB MB S NB OB PB QB RB SB TB UB VB WB XB YB ZB aB P Q T mB U V W X Y Z a b c R d H e"},D:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB P Q T U V W X Y Z a b c R d H e pB qB rB","2":"0 1 2 3 4 5 6 7 8 9 I f J E F G A B C K L D M N O g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB","66":"HB IB JB eB KB fB LB MB S NB"},E:{"2":"I f J E F G A B C K L D sB gB tB uB vB wB hB bB cB xB yB zB"},F:{"1":"EB FB GB HB IB JB KB LB MB S NB OB PB QB RB SB TB UB VB WB XB YB ZB aB P Q","2":"0 1 2 3 G B C D M N O g h i j k l m n o p q r s t u v w x y z 0B 1B 2B 3B bB iB 4B cB","66":"4 5 6 7 8 9 AB BB CB DB"},G:{"1":"D HC IC JC KC LC MC NC","2":"F gB 5B jB 6B 7B 8B 9B AC BC CC DC EC FC GC"},H:{"2":"OC"},I:{"1":"H","2":"dB I PC QC RC SC jB TC UC"},J:{"2":"E A"},K:{"1":"S","2":"A B C bB iB cB"},L:{"1":"H"},M:{"1":"R"},N:{"2":"A B"},O:{"2":"VC"},P:{"1":"aC hB bC cC dC eC fC","2":"I WC XC YC ZC"},Q:{"1":"gC"},R:{"2":"hC"},S:{"194":"iC"}},B:1,C:"inputmode attribute"};
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){/** * @file Detect whether or not an object is an ArrayBuffer. * @version 1.7.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-array-buffer-x */ "use strict";var toStringTag,aBufTag,attempt=_dereq_("attempt-x"),isObjectLike=_dereq_("is-object-like-x"),hasABuf="function"==typeof ArrayBuffer,bLength=!1;if(hasABuf){if(_dereq_("has-to-string-tag-x")){var descriptor=_dereq_("object-get-own-property-descriptor-x")(ArrayBuffer.prototype,"byteLength");if(descriptor&&"function"==typeof descriptor.get){var res=attempt(function(){return new ArrayBuffer(4)});!1===res.threw&&isObjectLike(res.value)&&(res=attempt.call(res.value,descriptor.get),bLength=!1===res.threw&&"number"==typeof res.value&&descriptor.get)}}!1===bLength&&(toStringTag=_dereq_("to-string-tag-x"),aBufTag="[object ArrayBuffer]")}module.exports=function isArrayBuffer(object){if(!1===hasABuf||!1===isObjectLike(object))return!1;if(!1===bLength)return toStringTag(object)===aBufTag;var result=attempt.call(object,bLength);return!1===result.threw&&"number"==typeof result.value}},{"attempt-x":3,"has-to-string-tag-x":7,"is-object-like-x":15,"object-get-own-property-descriptor-x":24,"to-string-tag-x":36}],2:[function(_dereq_,module,exports){/** * @file Cross-browser array-like slicer. * @version 1.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module array-like-slice-x */ "use strict";var toObject=_dereq_("to-object-x"),toInteger=_dereq_("to-integer-x"),toLength=_dereq_("to-length-x"),isUndefined=_dereq_("validate.io-undefined"),splitIfBoxedBug=_dereq_("split-if-boxed-bug-x"),setRelative=function _setRelative(value,length){return value<0?Math.max(length+value,0):Math.min(value,length)};module.exports=function slice(arrayLike,start,end){var iterable=splitIfBoxedBug(toObject(arrayLike)),length=toLength(iterable.length),k=setRelative(toInteger(start),length),relativeEnd=isUndefined(end)?length:toInteger(end),finalEnd=setRelative(relativeEnd,length),val=[];val.length=Math.max(finalEnd-k,0);for(var next=0;k<finalEnd;)k in iterable&&(val[next]=iterable[k]),next+=1,k+=1;return val}},{"split-if-boxed-bug-x":29,"to-integer-x":30,"to-length-x":31,"to-object-x":33,"validate.io-undefined":41}],3:[function(_dereq_,module,exports){/** * @file Invokes function, returning an object of the results. * @version 1.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module attempt-x */ "use strict";var arrayLikeSlice=_dereq_("array-like-slice-x");module.exports=function attempt(fn){try{return{threw:!1,value:fn.apply(this,arrayLikeSlice(arguments,1))}}catch(e){return{threw:!0,value:e}}}},{"array-like-slice-x":2}],4:[function(_dereq_,module,exports){/** * @file Check support of by-index access of string characters. * @version 1.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module has-boxed-string-x */ "use strict";var boxedString=Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{}],5:[function(_dereq_,module,exports){/** * @file Used to determine whether an object has an own property with the specified property key. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-hasownproperty|7.3.11 HasOwnProperty (O, P)} * @version 3.1.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module has-own-property-x */ "use strict";var toObject=_dereq_("to-object-x"),toPropertyKey=_dereq_("to-property-key-x"),hop=Object.prototype.hasOwnProperty;module.exports=function hasOwnProperty(object,property){return hop.call(toObject(object),toPropertyKey(property))}},{"to-object-x":33,"to-property-key-x":35}],6:[function(_dereq_,module,exports){/** * @file Tests if ES6 Symbol is supported. * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module has-symbol-support-x */ "use strict";module.exports="function"==typeof Symbol&&"symbol"==typeof Symbol("")},{}],7:[function(_dereq_,module,exports){/** * @file Tests if ES6 @@toStringTag is supported. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag} * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module has-to-string-tag-x */ "use strict";module.exports=_dereq_("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag},{"has-symbol-support-x":6}],8:[function(_dereq_,module,exports){"use strict";var getDay=Date.prototype.getDay,tryDateObject=function tryDateObject(value){try{return getDay.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isDateObject(value){return"object"==typeof value&&null!==value&&(hasToStringTag?tryDateObject(value):"[object Date]"===toStr.call(value))}},{}],9:[function(_dereq_,module,exports){/** * @file Test if a given value is falsey. * @version 1.0.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-falsey-x */ "use strict";module.exports=function isFalsey(value){return!1===Boolean(value)}},{}],10:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for Number.isFinite. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-number.isfinite|20.1.2.2 Number.isFinite ( number )} * @version 3.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-finite-x */ "use strict";var numberIsNaN=_dereq_("is-nan-x");module.exports=function isFinite(number){return"number"==typeof number&&!1===numberIsNaN(number)&&number!==1/0&&number!==-1/0}},{"is-nan-x":13}],11:[function(_dereq_,module,exports){/** * @file Determine whether a given value is a function object. * @version 3.1.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-function-x */ "use strict";var fToString=Function.prototype.toString,toStringTag=_dereq_("to-string-tag-x"),hasToStringTag=_dereq_("has-to-string-tag-x"),isPrimitive=_dereq_("is-primitive"),normalise=_dereq_("normalize-space-x"),deComment=_dereq_("replace-comments-x"),hasNativeClass=!0;try{Function('"use strict"; return class My {};')()}catch(ignore){hasNativeClass=!1}var ctrRx=/^class /,isES6ClassFn=function isES6ClassFunc(value){try{return ctrRx.test(normalise(deComment(fToString.call(value)," ")))}catch(ignore){}return!1},tryFuncToString=function funcToString(value,allowClass){try{return(!hasNativeClass||!1!==allowClass||!isES6ClassFn(value))&&(fToString.call(value),!0)}catch(ignore){}return!1};module.exports=function isFunction(value){if(isPrimitive(value))return!1;var allowClass=arguments.length>0&&Boolean(arguments[1]);if(hasToStringTag)return tryFuncToString(value,allowClass);if(hasNativeClass&&!1===allowClass&&isES6ClassFn(value))return!1;var strTag=toStringTag(value);return"[object Function]"===strTag||"[object GeneratorFunction]"===strTag||"[object AsyncFunction]"===strTag}},{"has-to-string-tag-x":7,"is-primitive":16,"normalize-space-x":23,"replace-comments-x":26,"to-string-tag-x":36}],12:[function(_dereq_,module,exports){/** * @file Determine whether the passed value is a zero based index. * @version 1.0.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-index-x */ "use strict";var safeToString=_dereq_("safe-to-string-x"),toInteger=_dereq_("to-integer-x"),toNumber=_dereq_("to-number-x"),mathClamp=_dereq_("math-clamp-x"),MAX_SAFE_INTEGER=_dereq_("max-safe-integer"),reIsUint=/^(?:0|[1-9]\d*)$/,rxTest=reIsUint.test;module.exports=function isIndex(value){var string=safeToString(value);if(!1===rxTest.call(reIsUint,string))return!1;var number=toNumber(string);return arguments.length>1?number<mathClamp(toInteger(arguments[1]),MAX_SAFE_INTEGER):number<MAX_SAFE_INTEGER}},{"math-clamp-x":20,"max-safe-integer":22,"safe-to-string-x":28,"to-integer-x":30,"to-number-x":32}],13:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for Number.isNaN - the global isNaN returns false positives. * @version 1.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-nan-x */ "use strict";module.exports=function isNaN(value){return value!==value}},{}],14:[function(_dereq_,module,exports){/** * @file Checks if `value` is `null` or `undefined`. * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-nil-x */ "use strict";var isUndefined=_dereq_("validate.io-undefined"),isNull=_dereq_("lodash.isnull");module.exports=function isNil(value){return isNull(value)||isUndefined(value)}},{"lodash.isnull":19,"validate.io-undefined":41}],15:[function(_dereq_,module,exports){/** * @file Determine if a value is object like. * @version 1.5.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module is-object-like-x */ "use strict";var isFunction=_dereq_("is-function-x"),isPrimitive=_dereq_("is-primitive");module.exports=function isObjectLike(value){return!1===isPrimitive(value)&&!1===isFunction(value,!0)}},{"is-function-x":11,"is-primitive":16}],16:[function(_dereq_,module,exports){"use strict";module.exports=function isPrimitive(value){return null==value||"function"!=typeof value&&"object"!=typeof value}},{}],17:[function(_dereq_,module,exports){"use strict";var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):"[object String]"===toStr.call(value))}},{}],18:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function isSymbolObject(value){return"symbol"==typeof value.valueOf()&&symStringRegex.test(symToStr.call(value))};module.exports=function isSymbol(value){if("symbol"==typeof value)return!0;if("[object Symbol]"!==toStr.call(value))return!1;try{return isSymbolObject(value)}catch(e){return!1}}}else module.exports=function isSymbol(value){return!1}},{}],19:[function(_dereq_,module,exports){module.exports=function isNull(value){return null===value}},{}],20:[function(_dereq_,module,exports){/** * @file Clamp a number to limits. * @version 1.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module math-clamp-x */ "use strict";var toNumber=_dereq_("to-number-x");module.exports=function clamp(value){var number=toNumber(value),argsLength=arguments.length;if(argsLength<2)return number;var max,min=toNumber(arguments[1]);if(argsLength<3?(max=min,min=0):max=toNumber(arguments[2]),min>max)throw new RangeError('"min" must be less than "max"');return number<min?min:number>max?max:number}},{"to-number-x":32}],21:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for Math.sign. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)} * @version 2.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module math-sign-x */ "use strict";var toNumber=_dereq_("to-number-x"),numberIsNaN=_dereq_("is-nan-x");module.exports=function sign(x){var n=toNumber(x);return 0===n||numberIsNaN(n)?n:n>0?1:-1}},{"is-nan-x":13,"to-number-x":32}],22:[function(_dereq_,module,exports){"use strict";module.exports=9007199254740991},{}],23:[function(_dereq_,module,exports){/** * @file Trims and replaces sequences of whitespace characters by a single space. * @version 1.3.3 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module normalize-space-x */ "use strict";var trim=_dereq_("trim-x"),reNormalize=new RegExp("["+_dereq_("white-space-x").string+"]+","g");module.exports=function normalizeSpace(string){return trim(string).replace(reNormalize," ")}},{"trim-x":40,"white-space-x":42}],24:[function(_dereq_,module,exports){/** * @file Sham for ES6 Object.getOwnPropertyDescriptor * @version 3.2.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module object-get-own-property-descriptor-x */ "use strict";var getOPDFallback1,getOPDFallback2,$getOwnPropertyDescriptor,toObject=_dereq_("to-object-x"),toPropertyKey=_dereq_("to-property-key-x"),isFalsey=_dereq_("is-falsey-x"),attempt=_dereq_("attempt-x"),nativeGOPD="function"==typeof Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor,doesGOPDWork=function(object,prop){object[toPropertyKey(prop)]=0;var testResult=attempt(nativeGOPD,object,prop);return!1===testResult.threw&&0===testResult.value.value};if(nativeGOPD){var doc="undefined"!=typeof document&&document;if(!doc||doesGOPDWork(doc.createElement("div"),"sentinel")){var res=attempt(nativeGOPD,Object("abc"),1);if(!1===res.threw&&res.value&&"b"===res.value.value)if(doesGOPDWork({},"sentinel")){var worksWithPrim=!1===attempt(nativeGOPD,42,"name").threw;$getOwnPropertyDescriptor=_dereq_("has-symbol-support-x")&&doesGOPDWork({},Object(Symbol("")))?worksWithPrim?nativeGOPD:function getOwnPropertyDescriptor(object,property){return nativeGOPD(toObject(object),property)}:worksWithPrim?function getOwnPropertyDescriptor(object,property){return nativeGOPD(object,toPropertyKey(property))}:function getOwnPropertyDescriptor(object,property){return nativeGOPD(toObject(object),toPropertyKey(property))}}else getOPDFallback1=nativeGOPD;else getOPDFallback2=nativeGOPD}}if(isFalsey($getOwnPropertyDescriptor)||getOPDFallback1||getOPDFallback2){var lookupGetter,lookupSetter,owns=_dereq_("has-own-property-x"),isPrimitive=_dereq_("is-primitive"),isString=_dereq_("is-string"),isIndex=_dereq_("is-index-x"),propertyIsEnumerable=_dereq_("property-is-enumerable-x"),prototypeOfObject=Object.prototype,supportsAccessors=owns(prototypeOfObject,"__defineGetter__");if(supportsAccessors){var lg=prototypeOfObject.__lookupGetter__,ls=prototypeOfObject.__lookupSetter__;lookupGetter=function(object,property){return lg.call(object,property)},lookupSetter=function(object,property){return ls.call(object,property)}}$getOwnPropertyDescriptor=function getOwnPropertyDescriptor(object,property){var result,obj=toObject(object),propKey=toPropertyKey(property);if(getOPDFallback1&&!1===(result=attempt.call(Object,getOPDFallback1,obj,propKey)).threw)return result.value;var isStringIndex=isString(obj)&&isIndex(propKey,obj.length);if(getOPDFallback2&&!1===isStringIndex&&!1===(result=attempt.call(Object,getOPDFallback2,obj,propKey)).threw)return result.value;var descriptor;if(!1===isStringIndex&&!1===owns(obj,propKey))return descriptor;if(descriptor={configurable:!1===isPrimitive(object)&&!1===isStringIndex,enumerable:propertyIsEnumerable(obj,propKey)},supportsAccessors){var prototype=obj.__proto__,notPrototypeOfObject=obj!==prototypeOfObject;notPrototypeOfObject&&(obj.__proto__=prototypeOfObject);var getter=lookupGetter(obj,propKey),setter=lookupSetter(obj,propKey);if(notPrototypeOfObject&&(obj.__proto__=prototype),getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return isStringIndex?(descriptor.value=obj.charAt(propKey),descriptor.writable=!1):(descriptor.value=obj[propKey],descriptor.writable=!0),descriptor}}module.exports=$getOwnPropertyDescriptor},{"attempt-x":3,"has-own-property-x":5,"has-symbol-support-x":6,"is-falsey-x":9,"is-index-x":12,"is-primitive":16,"is-string":17,"property-is-enumerable-x":25,"to-object-x":33,"to-property-key-x":35}],25:[function(_dereq_,module,exports){/** * @file Indicates whether the specified property is enumerable. * @version 1.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module property-is-enumerable-x */ "use strict";var toPropertyKey=_dereq_("to-property-key-x"),toObject=_dereq_("to-object-x"),propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function propertyIsEnumerable(object,property){return propIsEnumerable.call(toObject(object),toPropertyKey(property))}},{"to-object-x":33,"to-property-key-x":35}],26:[function(_dereq_,module,exports){/** * @file Replace the comments in a string. * @version 1.0.3 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module replace-comments-x */ "use strict";var isString=_dereq_("is-string"),STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;module.exports=function replaceComments(string){var replacement=arguments.length>1&&isString(arguments[1])?arguments[1]:"";return isString(string)?string.replace(STRIP_COMMENTS,replacement):""}},{"is-string":17}],27:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for RequireObjectCoercible. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible|7.2.1 RequireObjectCoercible ( argument )} * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module require-object-coercible-x */ "use strict";var isNil=_dereq_("is-nil-x");module.exports=function RequireObjectCoercible(value){if(isNil(value))throw new TypeError("Cannot call method on "+value);return value}},{"is-nil-x":14}],28:[function(_dereq_,module,exports){/** * @file Like ES6 ToString but handles Symbols too. * @see {@link https://github.com/Xotic750/to-string-x|to-string-x} * @version 2.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module safe-to-string-x */ "use strict";var isSymbol=_dereq_("is-symbol"),toStr=_dereq_("to-string-x"),hasSymbols=_dereq_("has-symbol-support-x"),pToString=hasSymbols&&Symbol.prototype.toString;module.exports=function safeToString(value){return hasSymbols&&isSymbol(value)?pToString.call(value):toStr(value)}},{"has-symbol-support-x":6,"is-symbol":18,"to-string-x":37}],29:[function(_dereq_,module,exports){/** * @file Tests if a value is a string with the boxed bug; splits to an array. * @version 1.0.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module split-if-boxed-bug-x */ "use strict";var strSplit,isString,splitString=!1===_dereq_("has-boxed-string-x");splitString&&(strSplit=String.prototype.split,isString=_dereq_("is-string")),module.exports=function splitIfBoxedBug(value){return splitString&&isString(value)?strSplit.call(value,""):value}},{"has-boxed-string-x":4,"is-string":17}],30:[function(_dereq_,module,exports){/** * @file ToInteger converts 'argument' to an integral numeric value. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )} * @version 2.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-integer-x */ "use strict";var toNumber=_dereq_("to-number-x"),numberIsNaN=_dereq_("is-nan-x"),numberIsFinite=_dereq_("is-finite-x"),mathSign=_dereq_("math-sign-x");module.exports=function toInteger(value){var number=toNumber(value);return numberIsNaN(number)?0:0===number||!1===numberIsFinite(number)?number:mathSign(number)*Math.floor(Math.abs(number))}},{"is-finite-x":10,"is-nan-x":13,"math-sign-x":21,"to-number-x":32}],31:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for ToLength. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )} * @version 2.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-length-x */ "use strict";var toInteger=_dereq_("to-integer-x"),MAX_SAFE_INTEGER=_dereq_("max-safe-integer");module.exports=function toLength(value){var len=toInteger(value);return len<=0?0:len>MAX_SAFE_INTEGER?MAX_SAFE_INTEGER:len}},{"max-safe-integer":22,"to-integer-x":30}],32:[function(_dereq_,module,exports){/** * @file Converts argument to a value of type Number. * @version 1.1.0 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-number-x */ "use strict";var toPrimitive=_dereq_("to-primitive-x"),trim=_dereq_("trim-x"),pStrSlice=String.prototype.slice,binaryRegex=/^0b[01]+$/i,test=binaryRegex.test,isBinary=function _isBinary(value){return test.call(binaryRegex,value)},octalRegex=/^0o[0-7]+$/i,isOctal=function _isOctal(value){return test.call(octalRegex,value)},nonWS=["\x85","\u200b","\ufffe"].join(""),nonWSregex=new RegExp("["+nonWS+"]","g"),hasNonWS=function _hasNonWS(value){return test.call(nonWSregex,value)},invalidHexLiteral=/^[-+]0x[0-9a-f]+$/i,isInvalidHexLiteral=function _isInvalidHexLiteral(value){return test.call(invalidHexLiteral,value)},$toNumber=function toNumber(argument){var value=toPrimitive(argument,Number);if("symbol"==typeof value)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof value){if(isBinary(value))return $toNumber(parseInt(pStrSlice.call(value,2),2));if(isOctal(value))return $toNumber(parseInt(pStrSlice.call(value,2),8));if(hasNonWS(value)||isInvalidHexLiteral(value))return NaN;var trimmed=trim(value);if(trimmed!==value)return $toNumber(trimmed)}return Number(value)};module.exports=$toNumber},{"to-primitive-x":34,"trim-x":40}],33:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for ToObject. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-toobject|7.1.13 ToObject ( argument )} * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-object-x */ "use strict";var requireObjectCoercible=_dereq_("require-object-coercible-x");module.exports=function toObject(value){return Object(requireObjectCoercible(value))}},{"require-object-coercible-x":27}],34:[function(_dereq_,module,exports){/** * @file Converts a JavaScript object to a primitive value. * @version 1.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-primitive-x */ "use strict";var hasSymbols=_dereq_("has-symbol-support-x"),isPrimitive=_dereq_("is-primitive"),isDate=_dereq_("is-date-object"),isSymbol=_dereq_("is-symbol"),isFunction=_dereq_("is-function-x"),requireObjectCoercible=_dereq_("require-object-coercible-x"),isNil=_dereq_("is-nil-x"),isUndefined=_dereq_("validate.io-undefined"),symToPrimitive=hasSymbols&&Symbol.toPrimitive,symValueOf=hasSymbols&&Symbol.prototype.valueOf,toStringOrder=["toString","valueOf"],toNumberOrder=["valueOf","toString"],ordinaryToPrimitive=function _ordinaryToPrimitive(O,hint){if(requireObjectCoercible(O),"string"!=typeof hint||"number"!==hint&&"string"!==hint)throw new TypeError('hint must be "string" or "number"');for(var method,result,methodNames="string"===hint?toStringOrder:toNumberOrder,i=0;i<2;i+=1)if(method=O[methodNames[i]],isFunction(method)&&(result=method.call(O),isPrimitive(result)))return result;throw new TypeError("No default value")},getMethod=function _getMethod(O,P){var func=O[P];if(!1===isNil(func)){if(!1===isFunction(func))throw new TypeError(func+" returned for property "+P+" of object "+O+" is not a function");return func}};module.exports=function toPrimitive(input,preferredType){if(isPrimitive(input))return input;var hint="default";arguments.length>1&&(preferredType===String?hint="string":preferredType===Number&&(hint="number"));var exoticToPrim;if(hasSymbols&&(symToPrimitive?exoticToPrim=getMethod(input,symToPrimitive):isSymbol(input)&&(exoticToPrim=symValueOf)),!1===isUndefined(exoticToPrim)){var result=exoticToPrim.call(input,hint);if(isPrimitive(result))return result;throw new TypeError("unable to convert exotic object to primitive")}return"default"===hint&&(isDate(input)||isSymbol(input))&&(hint="string"),ordinaryToPrimitive(input,"default"===hint?"number":hint)}},{"has-symbol-support-x":6,"is-date-object":8,"is-function-x":11,"is-nil-x":14,"is-primitive":16,"is-symbol":18,"require-object-coercible-x":27,"validate.io-undefined":41}],35:[function(_dereq_,module,exports){/** * @file Converts argument to a value that can be used as a property key. * @version 2.0.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-property-key-x */ "use strict";var hasSymbols=_dereq_("has-symbol-support-x"),toPrimitive=_dereq_("to-primitive-x"),toStr=_dereq_("to-string-x");module.exports=function toPropertyKey(argument){var key=toPrimitive(argument,String);return hasSymbols&&"symbol"==typeof key?key:toStr(key)}},{"has-symbol-support-x":6,"to-primitive-x":34,"to-string-x":37}],36:[function(_dereq_,module,exports){/** * @file Get an object's ES6 @@toStringTag. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring|19.1.3.6 Object.prototype.toString ( )} * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-string-tag-x */ "use strict";var isNull=_dereq_("lodash.isnull"),isUndefined=_dereq_("validate.io-undefined"),toStr=Object.prototype.toString;module.exports=function toStringTag(value){return isNull(value)?"[object Null]":isUndefined(value)?"[object Undefined]":toStr.call(value)}},{"lodash.isnull":19,"validate.io-undefined":41}],37:[function(_dereq_,module,exports){/** * @file ES6-compliant shim for ToString. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )} * @version 1.4.1 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module to-string-x */ "use strict";var isSymbol=_dereq_("is-symbol");module.exports=function ToString(value){if(isSymbol(value))throw new TypeError("Cannot convert a Symbol value to a string");return String(value)}},{"is-symbol":18}],38:[function(_dereq_,module,exports){/** * @file This method removes whitespace from the left end of a string. * @version 1.3.5 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module trim-left-x */ "use strict";var $toString=_dereq_("to-string-x"),reLeft=new RegExp("^["+_dereq_("white-space-x").string+"]+");module.exports=function trimLeft(string){return $toString(string).replace(reLeft,"")}},{"to-string-x":37,"white-space-x":42}],39:[function(_dereq_,module,exports){/** * @file This method removes whitespace from the right end of a string. * @version 1.3.3 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module trim-right-x */ "use strict";var $toString=_dereq_("to-string-x"),reRight=new RegExp("["+_dereq_("white-space-x").string+"]+$");module.exports=function trimRight(string){return $toString(string).replace(reRight,"")}},{"to-string-x":37,"white-space-x":42}],40:[function(_dereq_,module,exports){/** * @file This method removes whitespace from the left and right end of a string. * @version 1.0.3 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module trim-x */ "use strict";var trimLeft=_dereq_("trim-left-x"),trimRight=_dereq_("trim-right-x");module.exports=function trim(string){return trimLeft(trimRight(string))}},{"trim-left-x":38,"trim-right-x":39}],41:[function(_dereq_,module,exports){"use strict";module.exports=function isUndefined(value){return void 0===value}},{}],42:[function(_dereq_,module,exports){/** * @file List of ECMAScript5 white space characters. * @version 2.0.3 * @author Xotic750 <Xotic750@gmail.com> * @copyright Xotic750 * @license {@link <https://opensource.org/licenses/MIT> MIT} * @module white-space-x */ "use strict";for(var list=[{code:9,description:"Tab",string:"\t"},{code:10,description:"Line Feed",string:"\n"},{code:11,description:"Vertical Tab",string:"\x0B"},{code:12,description:"Form Feed",string:"\f"},{code:13,description:"Carriage Return",string:"\r"},{code:32,description:"Space",string:" "},{code:160,description:"No-break space",string:"\xa0"},{code:5760,description:"Ogham space mark",string:"\u1680"},{code:6158,description:"Mongolian vowel separator",string:"\u180e"},{code:8192,description:"En quad",string:"\u2000"},{code:8193,description:"Em quad",string:"\u2001"},{code:8194,description:"En space",string:"\u2002"},{code:8195,description:"Em space",string:"\u2003"},{code:8196,description:"Three-per-em space",string:"\u2004"},{code:8197,description:"Four-per-em space",string:"\u2005"},{code:8198,description:"Six-per-em space",string:"\u2006"},{code:8199,description:"Figure space",string:"\u2007"},{code:8200,description:"Punctuation space",string:"\u2008"},{code:8201,description:"Thin space",string:"\u2009"},{code:8202,description:"Hair space",string:"\u200a"},{code:8232,description:"Line separator",string:"\u2028"},{code:8233,description:"Paragraph separator",string:"\u2029"},{code:8239,description:"Narrow no-break space",string:"\u202f"},{code:8287,description:"Medium mathematical space",string:"\u205f"},{code:12288,description:"Ideographic space",string:"\u3000"},{code:65279,description:"Byte Order Mark",string:"\ufeff"}],string="",length=list.length,i=0;i<length;i+=1)string+=list[i].string;module.exports={list:list,string:string}},{}]},{},[1])(1)});
module.exports = { pathPrefix: '/x86reference', siteMetadata: { title: 'x86reference', description: 'Quickly search x86 assembly documentation.', author: 'superhawk610', siteUrl: 'https://superhawk610.github.io/x86reference', }, plugins: [ 'gatsby-plugin-react-helmet', { resolve: 'gatsby-plugin-postcss', options: { postCssPlugins: [ require('postcss-preset-env')({ stage: false, features: { 'nesting-rules': true }, }), ], }, }, { resolve: 'gatsby-plugin-react-svg', options: { rule: { include: /assets\/.*\.svg$/, }, }, }, ], };
'use strict'; const _ = require('lodash'); const EventEmitter = require('events'); const middleware = require('./message-middleware'); class MessageProcessor extends EventEmitter { constructor() { super(); this._stack = []; } use() { let args = _.flatten(Array.from(arguments)); if (!args.length) throw Error('Expects one or more arguments.'); /** * call by: * * .use('intent', (msg, cli, srv, next) => { ... }) * * add middleware to process message with specific intent */ if (typeof args[0] === 'string') { let intent = args[0]; let rest = middleware(args.slice(1)); let mw = function(m, c, s, next) { return (m.intent === intent) ? rest(m, c, s, next) : next(); }; this._stack.push(mw); return this; } /** * call by: * * .use((msg, cli, srv, next) => { ... }) * * add middleware to process all message */ else { let mw = middleware(args); this._stack.push(mw); return this; } } process(message, client, server, callback) { middleware (this._stack) (message, client, server, (err) => { if (err && typeof callback === 'function') { callback(err); } else if (err) { this.emit('error', err); } else if (typeof callback === 'function') { callback(); } }); } } module.exports = MessageProcessor;
import App from './App' import forget from './page/forget' export default [{ path: '/userlogin', component: App, meta: { keepAlive: true // 需要被缓存 } }, { path: '/forget', component: forget, meta: { keepAlive: true // 需要被缓存 } } ]
import * as actions from "./actions" import * as actionTypes from "./actionTypes" import { combineEpics } from "redux-observable" import { map } from 'rxjs/operator/map' import { mergeMap } from 'rxjs/operator/mergeMap' import { filter } from "rxjs/operator/filter" import { delay } from "rxjs/operator/delay" import { Observable } from "rxjs/Observable" import { parseXML } from "./../../utils/parseXML" import { parseNews } from "./utils/parseNews" const fetchRTHKNews = (action$, _, { http }) => action$.ofType(actionTypes.FETCH_RTHK_NEWS) .switchMap(action => http.get(`http://rthk9.rthk.hk/apps/news/c_traffic_news.xml`) .map(response => response.xhr._response) .switchMap(xml => parseXML(xml) .catch(err => Observable.empty()) ) .map(jObject => parseNews(jObject[1])) .map(payload => actions.fetchNewsFulfilled(payload)) .takeUntil(action$.ofType(actionTypes.FETCH_RTHK_NEWS_CANCELLED)) .catch(err => Observable.of(actions.fetchNewsError(err))) ); export default combineEpics( fetchRTHKNews, )
require('es6-promise').polyfill(); var memoize = require('../../src'); var chai = require('chai'), expect = chai.expect; function asyncWork(num) { return new Promise(function(res, rej) { window.setTimeout(function() { if (num % 2 == 0) { res(num); } else { rej(num); } }, 100); }); }; var mAsyncWork = memoize(asyncWork); describe('Memoization', function() { it('should get a new promise every time without memoization', function() { var p1 = asyncWork(0); var p2 = asyncWork(0); expect(p1).to.not.equal(p2); // .eql for == }); it('should return the same promise if called twice with the same arguments', function() { var p1 = mAsyncWork(0); var p2 = mAsyncWork(0); expect(p1).to.equal(p2); // .equal for === }); it('should return a new promise for each input it is given', function() { var p1 = mAsyncWork(0); var p2 = mAsyncWork(2); expect(p1).to.not.equal(p2); }); it('should clear the promise after it is resolved', function(done) { var p1 = mAsyncWork(0); p1.then(function() { window.setTimeout(function() { var p2 = mAsyncWork(0); expect(p1).to.not.equal(p2); done(); }, 0); }); }); it('should clear the promise if it is rejected', function(done) { var p1 = mAsyncWork(1); p1.catch(function() { window.setTimeout(function() { var p2 = mAsyncWork(1); expect(p1).to.not.equal(p2); done(); }, 0); }); }); });
module.exports = { parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true, modules: true }, sourceType: "module" }, parser: "babel-eslint", env: { browser: true, es6: true, node: true }, globals: { angular: false, define: false, describe: false, document: false, expect: false, it: false, require: false }, rules: { "indent": ["warn", 2, { "SwitchCase": 1 }], "object-curly-spacing": ["error", "always"], "max-len": ["warn", { "code": 120, "ignoreComments": true, "ignoreTrailingComments": false }], "no-console": ["warn"], "no-mixed-operators": ["warn", { "groups": [ ["==", "!=", "===", "!==", ">", ">=", "<", "<="], ["&&", "||"], ["in", "instanceof"] ], "allowSamePrecedence": true }], "no-multi-spaces": ["error"], "no-cond-assign": ["warn"], "no-fallthrough": ["warn"], "no-undef": ["warn"], "no-unused-vars": ["warn", { "args": "none" }], "no-use-before-define": ["warn", { "functions": false, "classes": false, "variables": false }], "no-useless-escape": ["warn"], "no-useless-return": ["warn"], "no-underscore-dangle": ["warn", { "allow": ["_id"] }], "no-redeclare": ["warn"], "no-restricted-syntax": ["warn"], "operator-linebreak": ["warn", "before"], "prefer-promise-reject-errors": ["warn"], "padded-blocks": ["warn", { "blocks": "never", "switches": "never", "classes": "never" }], "semi": ["error", "always"], "valid-typeof": ["warn"], "no-eval": ["error"], "no-implied-eval": ["error"], "no-debugger": ["warn"], "no-mixed-spaces-and-tabs": ["warn"], }, extends: [ "eslint:recommended" ] }
/** * Copyright (c) 2011-2017 by Andrew Mustun. All rights reserved. * * This file is part of the QCAD project. * * QCAD is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * QCAD 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with QCAD. */ /** * \defgroup ecma_draw_image Image Drawing Tool * \ingroup ecma_draw * * \brief This module contains the ECMAScript implementation of the image * drawing tool. */ include("../Draw.js"); /** * \class Image * \brief Inserts an image (bitmap) into the drawing. * \ingroup ecma_draw_image */ function Image(guiAction) { Draw.call(this, guiAction); this.fileName = undefined; this.image = undefined; this.width = undefined; this.height = undefined; this.angle = undefined; this.setUiOptions("scripts/Draw/Image/Image.ui"); } Image.State = { SettingPosition : 0 }; Image.prototype = new Draw(); Image.includeBasePath = includeBasePath; Image.prototype.beginEvent = function() { Draw.prototype.beginEvent.call(this); if (isNull(this.fileName)) { this.fileName = this.getFileName(); } if (isNull(this.fileName)) { this.terminate(); return; } this.image = new RImageEntity( this.getDocument(), new RImageData(this.fileName, new RVector(0,0), new RVector(1,0), new RVector(0,1), 50, 50, 0) ); // initial size is image size in pixels (i.e. one pixel -> one unit): this.width = this.image.getPixelWidth(); this.height = this.image.getPixelHeight(); var optionsToolBar = EAction.getOptionsToolBar(); var widthEdit = optionsToolBar.findChild("Width"); var heightEdit = optionsToolBar.findChild("Height"); widthEdit.setValue(this.width); heightEdit.setValue(this.height); this.setState(Image.State.SettingPosition); }; Image.prototype.finishEvent = function() { Draw.prototype.finishEvent.call(this); if (!isNull(this.image)) { this.image.destroy(); } }; Image.prototype.getFileName = function() { var lastOpenFileDir = RSettings.getStringValue( "Image/Path", RSettings.getDocumentsLocation()); var formats = QImageReader.supportedImageFormats(); var filters = []; var filterAllImages = ""; for (var i=0; i<formats.length; ++i) { var format = formats[i]; var formatAlt = ""; // ignore format aliases: if (format=="jpg" || format=="tif") { continue; } // ignore unsupported formats: if (format=="ico" || format=="mng" || format=="pbm" || format=="pgm" || format=="ppm" || format=="svg" || format=="svgz" || format=="xbm" || format=="xpm") { continue; } if (format=="jpeg") { formatAlt = "jpg"; } else if (format=="tiff") { formatAlt = "tif"; } // if (filters.length!==0) { // filters += ";;"; // } var filter = format.toUpper() + " " + qsTr("Files") + " ("; filter += "*." + format; if (filterAllImages.length!==0) { filterAllImages += " "; } filterAllImages += "*." + format; if (formatAlt.length!==0) { filter += " *." + formatAlt; filterAllImages += " *." + formatAlt; } filter += ")"; filters.push(filter); } // default filter (first) is for all image files: var allFilter = qsTr("All Image Files (%1)").arg(filterAllImages); filters.push(allFilter); filters.push(qsTr("All Files") + " (*)"); // Shorter, but crashes under XUbuntu: //var fileName = QFileDialog.getOpenFileName(this, qsTr("Import Bitmap"), // initialPath, filters); var appWin = EAction.getMainWindow(); var fileDialog = new QFileDialog(appWin, qsTr("Import Bitmap"), lastOpenFileDir, ""); fileDialog.setNameFilters(filters); fileDialog.selectNameFilter(allFilter); fileDialog.setOption(QFileDialog.DontUseNativeDialog, getDontUseNativeDialog()); if (!isNull(QFileDialog.DontUseCustomDirectoryIcons)) { fileDialog.setOption(QFileDialog.DontUseCustomDirectoryIcons, true); } fileDialog.fileMode = QFileDialog.ExistingFiles; fileDialog.setLabelText(QFileDialog.FileType, qsTr("Format:")); if (!fileDialog.exec()) { fileDialog.destroy(); return undefined; } var files = fileDialog.selectedFiles(); if (files.length===0) { fileDialog.destroy(); return undefined; } RSettings.setValue("Image/Path", fileDialog.directory().absolutePath()); return files[0]; }; Image.prototype.setState = function(state) { Draw.prototype.setState.call(this, state); this.setCrosshairCursor(); this.getDocumentInterface().setClickMode(RAction.PickCoordinate); var appWin = RMainWindowQt.getMainWindow(); this.setLeftMouseTip(qsTr("Position")); this.setRightMouseTip(EAction.trCancel); EAction.showSnapTools(); }; Image.prototype.pickCoordinate = function(event, preview) { if (isNull(this.width) || isNull(this.height) || isNull(this.angle)) { return; } var pos = event.getModelPosition(); this.getDocumentInterface().setRelativeZero(pos); this.image.setInsertionPoint(pos); this.image.setWidth(this.width); this.image.setHeight(this.height); this.image.setAngle(this.angle); var op = new RAddObjectOperation(this.image.clone(), this.getToolTitle()); if (preview) { this.getDocumentInterface().previewOperation(op); } else { this.getDocumentInterface().applyOperation(op); } }; Image.prototype.slotKeepProportionsChanged = function(value) { var optionsToolBar = EAction.getOptionsToolBar(); var widthEdit = optionsToolBar.findChild("Width"); var heightEdit = optionsToolBar.findChild("Height"); //var heightLabel = optionsToolBar.findChild("HeightLabel"); var keepProportionsSwitch = optionsToolBar.findChild("KeepProportions"); if (value===true) { //heightEdit.enabled = false; //heightLabel.enabled = false; keepProportionsSwitch.icon = new QIcon(Image.includeBasePath + "/KeepProportionsOn.svg"); // adjust height to width: var w = this.image.getPixelWidth(); var f = widthEdit.getValue() / w; var h = this.image.getPixelHeight(); heightEdit.setValue(h * f); } else { //heightEdit.enabled = true; //heightLabel.enabled = true; keepProportionsSwitch.icon = new QIcon(Image.includeBasePath + "/KeepProportionsOff.svg"); } } Image.prototype.slotWidthChanged = function(value) { if (isNaN(value)) { return; } var optionsToolBar = EAction.getOptionsToolBar(); var heightEdit = optionsToolBar.findChild("Height"); var keepProportionsSwitch = optionsToolBar.findChild("KeepProportions"); var keepProportions = keepProportionsSwitch.checked; this.width = value; if (!isNull(this.image)) { this.image.setWidth(value, keepProportions); this.height = this.image.getHeight(); //qDebug("kp: ", keepProportions); //qDebug("height: ", this.height); heightEdit.blockSignals(true); heightEdit.setValue(this.height); heightEdit.blockSignals(false); } }; Image.prototype.slotHeightChanged = function(value) { if (isNaN(value)) { return; } var optionsToolBar = EAction.getOptionsToolBar(); var widthEdit = optionsToolBar.findChild("Width"); var keepProportionsSwitch = optionsToolBar.findChild("KeepProportions"); var keepProportions = keepProportionsSwitch.checked; this.height = value; if (!isNull(this.image)) { this.image.setHeight(value, keepProportions); this.width = this.image.getWidth(); widthEdit.blockSignals(true); widthEdit.setValue(this.width); widthEdit.blockSignals(false); } }; Image.prototype.slotAngleChanged = function(value) { this.angle = value; if (!isNull(this.image)) { this.image.setAngle(value); } };
(function (window, document, $, undefined) { 'use strict'; var NEWS = { i: function (e) { NEWS.s(); NEWS.methods(); }, s: function (e) { this._window = $(window), this._document = $(document), this._body = $('body'), this._html = $('html'), this.sideNav = $('.side-nav'), this.zoomGallery = $('.zoom-gallery'), this.niceScrollContainer = $('.nicescroll-container'), this.yScrollContainer = $('.y-scroll-container'), this._bannerSidebarMediaWrapper = $(".axil-banner-sidebar-media-wrapper"), this._navbarSearch = $(".navbar-search"), this._subscribePopUp = $('.subscribe-popup'), this.videoPopup = $('.video-popup'); }, methods: function (e) { NEWS.w(); NEWS._clickDoc(); NEWS._click(); NEWS.menuItemAnim(); NEWS.owl(); NEWS.counterUp(); NEWS.magnificPopup(); NEWS.niceScrollInit(); NEWS.yScrollInit(); NEWS.slickSync(); NEWS.isIE(); NEWS.initContactForm(); }, w: function (e) { this._window.on('load', NEWS.l).on('scroll', NEWS.scrl).on('resize', NEWS.res) }, l: function (e) { NEWS.perfectSquare(); NEWS.shapeLoaded(); NEWS.animPostBannerContent(); NEWS._masonryInit(); NEWS._isotopInit(); NEWS.loadSubscribePopup(); }, scrl: function () { }, res: function () { NEWS.perfectSquare(); }, loadSubscribePopup: function () { setTimeout(function () { NEWS._subscribePopUp.addClass('show-popup'); }, 3000); }, _clickDoc: function (e) { var smoothScroll, openMainNav, openSubmenu, closeSubmenu, closeSideNav, openSideNav, inputFocus, inputblur, toggleShares, scrollPostUp, scrollPostDown, navSearchShow, navSearchHide, sideNavHover, removeHoverEffect, subscribePopupHide; //SMOOTHSCROLL smoothScroll = function (e) { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); var $f = target.offset().top, $g = $f - 40, $y; if (target.length) { $('#section-featured_work').is(target) ? $y = $g : $y = $f; $('html, body').animate({ scrollTop: $y }, 1000, 'easeInOutExpo'); return !1; } } }; openMainNav = function () { if (NEWS._html.hasClass('main-menu-opened')) { NEWS._html.removeClass('main-menu-opened'); $(this).removeClass('expanded'); $('.main-navigation').children('li').removeAttr('style'); } else { $(this).addClass('expanded'); setTimeout(function () { NEWS._html.addClass('main-menu-opened'); $('.main-menu-opened .main-navigation').children('li').each(function (index) { $(this).delay(80 * index) .animate({ opacity: "1", top: '0' }, 300); }); }, 800); } }; openSubmenu = function (e) { if (NEWS._window.width() < 992) { $(this).siblings('.submenu').slideToggle(500, "easeInOutQuint").parent('li').toggleClass('active'); $(this).parents('li').siblings().removeClass('active').find('.submenu').slideUp(500, "easeInOutQuint"); } else { $(this).siblings('.submenu').toggleClass('opened').parent('li').toggleClass('active'); $(this).parents('li').siblings('.has-dropdown').removeClass('active').find('.submenu').removeClass('opened'); } }; closeSubmenu = function (e) { if (!$('.main-navigation li, .main-navigation li a').is(e.target)) { $('.submenu').removeClass('opened').parent('li').removeClass('active'); } }; openSideNav = function () { NEWS.sideNav.addClass('opened'); NEWS._html.addClass('side-nav-opened'); setTimeout(function () { $('.side-nav-opened .side-navigation').children('li').each(function (index) { $(this).delay(100 * index) .animate({ opacity: "1", left: '0' }, 100); }); }, 500); }; closeSideNav = function (e) { if (!$('.side-nav, .side-nav *:not(".close-sidenav")').is(e.target) && !$('.side-nav-toggler, .side-nav-toggler *').is(e.target)) { NEWS.sideNav.removeClass('opened'); NEWS._html.removeClass('side-nav-opened'); $('.side-navigation').children('li').removeAttr('style'); } }; inputFocus = function (e) { $(this).parents(".form-group").addClass('focused'); }; inputblur = function (e) { if (!$(this).val()) { $(this).parent(".form-group").removeClass('focused'); } }; toggleShares = function () { $(this).siblings('.social-share-wrapper').toggleClass('show-shares'); }; scrollPostDown = function (e) { e.preventDefault(); NEWS._bannerSidebarMediaWrapper.animate({ scrollTop: '+=200' }, 800, "easeInOutExpo"); }; scrollPostUp = function (e) { e.preventDefault(); NEWS._bannerSidebarMediaWrapper.animate({ scrollTop: '-=200' }, 800, "easeInOutExpo"); }; navSearchShow = function (e) { e.preventDefault(); NEWS._navbarSearch.addClass('show-nav-search'); }; navSearchHide = function (e) { e.preventDefault(); NEWS._navbarSearch.removeClass('show-nav-search'); }; sideNavHover = function (e) { e.preventDefault(); $(this).removeClass('hover-removed').addClass('hovered').siblings('li').addClass('hover-removed').removeClass('hovered'); }; removeHoverEffect = function (e) { e.preventDefault(); $(this).find('li').removeClass('hover-removed hovered'); }; subscribePopupHide = function (e) { if (!$('.subscribe-popup-inner, .subscribe-popup-inner *:not(.close-popup,.close-popup i)').is(e.target)) { NEWS._subscribePopUp.fadeOut("300"); } }; NEWS._document .on('click', '.page-scroll', smoothScroll) .on('click', '.main-navigation .has-dropdown > a', openSubmenu) .on('click', closeSubmenu) .on('click', '#close-sidenav', closeSideNav) .on('click', closeSideNav) .on('click', '.close-popup', subscribePopupHide) .on('click', subscribePopupHide) .on('click', '#side-nav-toggler', openSideNav) .on('focus', 'input:not([type="radio"]),input:not([type="checkbox"]),textarea,select', inputFocus) .on('blur', 'input,textarea,select', inputblur) .on('click', '.toggle-shares', toggleShares) .on('click', '.axil-post-scroll-down', scrollPostDown) .on('click', '.axil-post-scroll-up', scrollPostUp) .on('click', '.nav-search-field-toggler', navSearchShow) .on('click', '.navbar-search-close', navSearchHide) .on('mouseenter', '.side-navigation li', sideNavHover) .on('mouseout', '.side-navigation', removeHoverEffect) .on('click', '#main-nav-toggler', openMainNav); }, _click: function (e) { NEWS.b(); NEWS.c(); }, b: function (e) {}, c: function (e) {}, isIE: function () { var ua = navigator.userAgent; var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1; return is_ie; }, menuItemAnim: function (e) { $('.rotate-txt li').each(function () { var txt = $(this).find('> a').text(); $(this).find(">a").attr('data-txt', txt); }); }, owl: function () { var _owlContainer = $('.owl-carousel:not(.owl-synced)'), _owlCatContainer = $('.category-carousel .owl-carousel'), _customPrevBtn = '.custom-owl-prev', _customNextBtn = '.custom-owl-next'; if (_owlContainer.length) { _owlContainer.each(function () { var _defaults = { loop: true, margin: 10, responsiveClass: true, items: 1, autoplay: true, nav: false, dots: false, animateIn: false, animateOut: false } //vars var _loop = $(this)[0].hasAttribute("data-owl-loop") ? $(this).data('owl-loop') : _defaults.loop, _items = $(this)[0].hasAttribute("data-owl-items") ? $(this).data('owl-items') : _defaults.items, _dots = $(this)[0].hasAttribute("data-owl-dots") ? $(this).data('owl-dots') : _defaults.dots, _nav = $(this)[0].hasAttribute("data-owl-nav") ? $(this).data('owl-nav') : _defaults.nav, _margin = $(this)[0].hasAttribute("data-owl-margin") ? $(this).data('owl-margin') : _defaults.margin, _animateIn = $(this)[0].hasAttribute("data-owl-animate-in") ? $(this).data('owl-animate-in') : _defaults.animateIn, _animateOut = $(this)[0].hasAttribute("data-owl-animate-out") ? $(this).data('owl-animate-out') : _defaults.animateOut, _autoplay = $(this)[0].hasAttribute("data-owl-autoplay") ? $(this).data('owl-autoplay') : _defaults.autoplay; if (NEWS.isIE()) { _animateIn = false; _animateOut = false; } //init _owlContainer.owlCarousel({ loop: _loop, margin: _margin, responsiveClass: true, items: _items, autoplay: _autoplay, nav: _nav, dots: _dots, animateIn: _animateIn, animateOut: _animateOut, navText: ['<i class="feather icon-chevron-left"></i>', '<i class="feather icon-chevron-right"></i>'] }); // Trigger counter when slide changes if (_owlCatContainer.length) { // Go to the previous item NEWS._document.on('click', _customPrevBtn, function () { _owlCatContainer.trigger('prev.owl.carousel', [300]); }); // Go to the next item NEWS._document.on('click', _customNextBtn, function () { _owlCatContainer.trigger('next.owl.carousel', [300]); }); } }); } }, slickSync: function () { var _slickCont = $('.slick-slider'), _slickFor = $('.slick-slider-nav'); if (_slickCont.length) { var _prevArrow = '<button type="button" class="slick-prev"><i class="feather icon-chevron-left"></i></button>', _nextArrow = '<button type="button" class="slick-next"><i class="feather icon-chevron-right"></i></button>'; var _defaults = { items: 1, dots: false, arrows: false, infinite: true, centerMode: false, variableWidth: false } //vars var _items = _slickFor[0].hasAttribute("data-slick-items") ? _slickFor.data('slick-items') : _defaults.items, _dots = _slickFor[0].hasAttribute("data-slick-dots") ? _slickFor.data('slick-dots') : _defaults.dots, _loop = _slickFor[0].hasAttribute("data-slick-loop") ? _slickFor.data('slick-loop') : _defaults.infinite, _center = _slickFor[0].hasAttribute("data-slick-center") ? _slickFor.data('slick-center') : _defaults.centerMode, _autoWidth = _slickFor[0].hasAttribute("data-slick-autowidth") ? _slickFor.data('slick-autowidth') : _defaults.variableWidth, _arrows = _slickFor[0].hasAttribute("data-slick-arrows") ? _slickFor.data('slick-arrows') : _defaults.arrows; $('.slick-slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: false, dots: true, asNavFor: '.slick-slider-nav,.banner-share-slider', adaptiveHeight: true, autoplaySpeed: 2000 }); $('.slick-slider-nav').slick({ slidesToShow: _items, slidesToScroll: 1, asNavFor: '.slick-slider-for,.banner-share-slider', prevArrow: _prevArrow, nextArrow: _nextArrow, arrows: true, dots: false, infinite: _loop, centerMode: _center, centerPadding: "0", autoplaySpeed: 2000, responsive: [{ breakpoint: 1024, settings: { slidesToShow: _items } }, { breakpoint: 991, settings: { slidesToShow: 1, centerMode: false } }, { breakpoint: 767, settings: { slidesToShow: 1, centerMode: false } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); $('.banner-share-slider').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: false, vertical: true, autoplaySpeed: 2000 }); } }, counterUp: function () { var _counter = $('.counter'); if (_counter.length) { _counter.counterUp({ delay: 10, time: 1000, triggerOnce: true }); } }, perfectSquare: function () { var _square = $('.perfect-square'); _square.each(function () { var squareWidth = $(this).width(); $(this).height(squareWidth); }); }, _masonryInit: function () { var _masonryGrid = $('.masonry-grid'); if (_masonryGrid.length) { _masonryGrid.isotope({ itemSelector: '.grid-item', percentPosition: true, masonry: { columnWidth: '.grid-item' } }); } }, //isotope initialization _isotopInit: function () { var _axilIsoGrid = $('.axil-iso-grid'), _filterBtnGrp = $('.axil-filter-button-group'); if (_axilIsoGrid.length) { _axilIsoGrid.each(function () {}); var $grid = _axilIsoGrid.isotope({ // options itemSelector: '.iso-grid-item', layoutMode: 'masonry' }); } // filter items on button click _filterBtnGrp.each(function () { $(this).on('click', '.filter-btn', function () { var filterValue = $(this).attr('data-filter'); $grid.isotope({ filter: filterValue }); }); }); _filterBtnGrp.each(function (i, buttonGroup) { var $buttonGroup = $(buttonGroup); $buttonGroup.on('click', '.filter-btn', function () { $buttonGroup.find('.is-checked').removeClass('is-checked'); $(this).addClass('is-checked'); }); }); }, magnificPopup: function () { if (NEWS.videoPopup.length) { NEWS.videoPopup.magnificPopup({ type: 'iframe', mainClass: 'mfp-fade', iframe: { markup: '<div class="mfp-iframe-scaler">' + '<div class="mfp-close"></div>' + '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' + '</div>', patterns: { youtube: { index: 'youtube.com/', id: 'v=', src: '//www.youtube.com/embed/%id%?autoplay=1' } }, srcAction: 'iframe_src' }, gallery: { enabled: true }, zoom: { enabled: true, duration: 300, // don't foget to change the duration also in CSS opener: function (element) { return element.find('img'); } } }); } if (NEWS.zoomGallery.length) { NEWS.zoomGallery.magnificPopup({ delegate: 'a', type: 'image', closeOnContentClick: false, closeBtnInside: false, mainClass: 'mfp-with-zoom mfp-img-mobile', image: { verticalFit: true }, gallery: { enabled: true }, zoom: { enabled: true, duration: 300, // don't foget to change the duration also in CSS opener: function (element) { return element.find('img'); } } }); } }, shapeLoaded: function () { var _shape1 = $('.axil-shape-circle'), _shape2 = $('.axil-shape-circle__two'); if (_shape1.length && _shape2.length) { _shape1.addClass('shape-loaded'); _shape2.addClass('shape-loaded'); } }, niceScrollInit: function () { NEWS.niceScrollContainer.niceScroll({ cursorcolor: "#D3D7DA", cursorborderradius: "0" }); }, yScrollInit: function () { if (NEWS._window.width() > 991) { NEWS.yScrollContainer.niceScroll({ cursorcolor: "#D3D7DA", cursorborderradius: "0", horizrailenabled: false }); } }, animPostBannerContent: function () { var _loadAnimWrapper = $('.load-anim-wrapper'); _loadAnimWrapper.each(function () { $(this).find('.load-anim').each(function (index) { $(this).delay(200 * index) .animate({ opacity: "1", top: '0' }, 800); }); }); }, initContactForm: function () { $('.axil-contact-form').on('submit', function (e) { e.preventDefault(); var _self = $(this); var __selector = _self.closest('input,textarea'); _self.closest('div').find('input,textarea').removeAttr('style'); _self.find('.error-msg').remove(); _self.closest('div').find('button[type="submit"]').attr('disabled', 'disabled'); var data = $(this).serialize(); $.ajax({ url: 'assets/scripts/email.php', type: "post", dataType: 'json', data: data, success: function (data) { _self.closest('div').find('button[type="submit"]').removeAttr('disabled'); if (data.code == false) { _self.closest('div').find('[name="' + data.field + '"]'); _self.find('.btn-primary').after('<div class="error-msg"><p>*' + data.err + '</p></div>'); } else { $('.error-msg').hide(); $('.form-group').removeClass('focused'); _self.find('.btn-primary').after('<div class="success-msg"><p>' + data.success + '</p></div>'); _self.closest('div').find('input,textarea').val(''); setTimeout(function () { $('.success-msg').fadeOut('slow'); }, 5000); } } }); }); } }; NEWS.i(); })(window, document, jQuery);
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z" /> , 'FormatListNumberedSharp');
const express = require("express"); const { users } = require("../data"); const router = express.Router(); // const data = require('../data'); // const usersData = require('../data/users'); const data = require("../data"); const multer = require("multer"); const xss = require("xss"); const fs = require("fs"); const storage = multer.diskStorage({ destination: function (req, file, cb) { const path = "uploads/"; fs.mkdirSync(path, { recursive: true }); cb(null, path); }, filename: function (req, file, cb) { cb(null, new Date().toISOString() + file.originalname); }, }); const upload = multer({ storage: storage }); // const usersData = require('../data/users'); const moviesData = data.movies; const reviewData = data.reviews; const usersData = data.users; const validation = require("../data/validation"); router.get("/all", async (req, res) => { try { const listMovies = await moviesData.getAllMovies(); let rev = await usersData.getUser(req.session.user.username); res.render("movies/allMovies", { movieList: listMovies, title: "All Movies", user: rev, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, }); } }); router.get("/allMovies", async (req, res) => { try { const listMovies = await moviesData.getAllMovies(); res.json(listMovies); } catch (e) {} }); //CHANGE: xss added with error router.post("/all/:value", async (req, res) => { try { let sortVal = xss(req.params.value); if (!sortVal || typeof sortVal !== "string") { throw "invalid value field"; } const sorted = await moviesData.getSort(sortVal); res.json(sorted); } catch (e) { res.status(404).json({ error: e }); } }); router.get("/addMovie", async (req, res) => { if (req.session.user) { try { res.render("movies/newMovie", { title: "Add Movies", authenticated: req.session.user ? true : false, username: req.session.user.username, new: true, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.user.username, }); } } else { res.redirect("/"); } }); //CHANGE: error check with id and throw error string router.get("/:id", async (req, res) => { //console.log(req.params.id); //console.log(req.session); if (req.session.user) { try { if (!req.params.id || typeof req.params.id !== "string") throw "invalid id passed"; const movie = await moviesData.getMovie(req.params.id); const reviews = await reviewData.getReviewsByMovieId(req.params.id); //console.log(movie); // res.render('movies/individualMovie',{movie:movie, reviews:reviews, user:req.session.user, title:'Characters Found'}); // } catch (e) { // res.status(400).render('pages/error',{error:e, title:'Search Error'}); // } // }); let rev = await usersData.getUser(req.session.user.username); let view = ""; if ( movie.watched_list && movie.watched_list.includes(req.session.user.username) ) { view = "disabled"; } if ( movie.favourite_list && movie.favourite_list.includes(req.session.user.username) ) { fav = "UnFavorite"; } else { fav = "Favorite"; } if ( movie.toWatch_list && movie.toWatch_list.includes(req.session.user.username) ) { watch = "Watched"; } else { watch = "Want to Watch"; } if (reviews.length > 0) { for (let i = 0; i < reviews.length; i++) { if (reviews[i].reported.includes(req.session.user.username)) { reviews.splice(i, 1); i--; } } } res.render("movies/individualMovie", { movie: movie, view: view, watch: watch, fav: fav, title: movie.movie_name, reviews: reviews, user: rev, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.user.username, }); } } else { res.status(403).render("pages/error", { authenticated: req.session.user ? true : false, }); } }); router.get("/", async (req, res) => { try { const listMovies = await moviesData.getTrending(); res.status(200).render("movies/allMovies", { movieList: listMovies, title: "Trending Movies", authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, }); } }); // //TESTS ALPHABETICAL SORT // router.get('/alpha', async (req, res) => { // try { // const listRest = await moviesData.sortAlphabetically(); // res.status(200).json(listRest); // } catch (e) { // res.status(500).send(); // } // }); // //TESTS GENRE FILTER // router.get('/genre', async (req, res) => { // try { // const listRest = await moviesData.getByGenre("comedy"); // res.status(200).json(listRest); // } catch (e) { // res.status(500).send(); // } // }); //CHANGE: added xss in create try/catch router.post("/addMovie", upload.single("movie_img"), async (req, res) => { let username = req.session.user != undefined || req.session.user != null ? req.session.user.username : "temp"; const moviesDataList = req.body; if (req && req.file && req.file.fieldname === "movie_img" && moviesDataList) { moviesDataList.movie_img = "/" + req.file.path; } else { moviesDataList.movie_img = "public/images/logo.jpeg"; } if ( moviesDataList && moviesDataList.stream_service && moviesDataList.stream_service_url ) { moviesDataList.streaming_services = { name: xss(moviesDataList.stream_service), link: xss(moviesDataList.stream_service_url), }; } if (!moviesDataList.movie_name) { res.status(400).json({ error: "You must provide Name of the Movie" }); return; } if (!moviesDataList.director) { res .status(400) .json({ error: "You must provide the director name of the Movie" }); return; } if (!moviesDataList.release_year) { res .status(400) .json({ error: "You must provide release year of the Movie" }); return; } if (!moviesDataList.cast) { res.status(400).json({ error: "You must provide cast of the Movie" }); return; } if (!moviesDataList.genre) { res.status(400).json({ error: "You must provide genre of the Movie" }); return; } if (!moviesDataList.streaming_services) { res .status(400) .json({ error: "You must provide streaming services of the Movie" }); return; } if (!moviesDataList.movie_img) { res .status(400) .json({ error: "You must provide poster/image of the Movie" }); return; } if (moviesDataList && moviesDataList.cast) { moviesDataList.cast = moviesDataList.cast.split("\r\n"); } if (moviesDataList && moviesDataList.genre) { moviesDataList.genre = moviesDataList.genre.split(); } moviesDataList.release_year = parseInt(moviesDataList.release_year); try { let { movie_name, director, release_year, cast, streaming_services, genre, movie_img, } = moviesDataList; let newMovie = await moviesData.createMovie( xss(username), xss(movie_name), xss(director), parseInt(xss(release_year)), xss(cast).split("\r\n"), streaming_services, xss(genre), xss(movie_img) ); // res.status(200).json(newMovie); // res.status(200).redirect('/movies/all') res.status(200).render("movies/newMovie", { added: "Movie Added Successfullly", new: false, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(500).json({ error: e }); } }); //CHANGE: error check for id and throw string router.get("/edit/:id", async (req, res) => { if (req.session.user) { try { if (!req.params.id || typeof req.params.id !== "string") throw "invalid id passed"; const movie = await moviesData.getMovie(req.params.id); let rev = await usersData.getUser(req.session.user.username); let cast = movie.cast; cast = cast.toString(); movie.cast = cast; res.render("movies/updateMovie", { movie: movie, title: "Edit Movies", }); } catch (e) { res .status(400) .render("pages/error", { error: e, title: "Update Error" }); } } else { res.status(403).render("pages/error"); } }); //CHANGE: xss added router.put("/edit/:id", async (req, res) => { if (!req.params.id || typeof req.params.id !== "string") throw "invalid id passed"; const updatedData = req.body; if ( !updatedData.movie_name || !updatedData.director || !updatedData.release_year || !updatedData.cast || !updatedData.genre || !updatedData.streaming_services ) { res.status(400).json({ error: "You must Supply All fields" }); return; } try { await moviesData.getMovie(req.params.id); } catch (e) { res.status(404).json({ error: "Movie/TV Show not found" }); return; } try { const { movie_name, director, release_year, cast, streaming_services, genre, movie_img, } = updatedData; const updatedMovie = await moviesData.updatingMovie( req.params.id, xss(movie_name), xss(director), xss(release_year), xss(cast), xss(streaming_services), xss(genre), xss(movie_img) ); res.status(200).json(updatedMovie); } catch (e) { res.status(500).json({ error: e }); } }); //CHANGE: xss added router.post("/report", async function (req, res) { let data = req.body; const { movieId, username } = data; const reported = await moviesData.updateMovieReport( xss(movieId), xss(username) ); res.json(reported); }); //CHANGE: xss added //ADDING MOVIE TO USER'S FAVE LIST router.post("/favorite/:id", async (req, res) => { const movie = req.body; try { const { username, movie_name } = movie; //const movie = await moviesData.getMovie(req.params.id); let userFav = await usersData.addToFave(xss(username), xss(movie_name)); res.status(200).json(userFav); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Error" }); } }); //REMOVING MOVIE FROM USER'S FAVE LIST // router.post("/unfavorite/:id", async (req, res) => { // const movie = req.body; // try { // const{username,movie_name} = movie; // //const movie = await moviesData.getMovie(req.params.id); // const user = await usersData.removeFromFave(username,movie_name); // res.status(200).json(user); // } catch (e) { // res.status(400).render("pages/error", { error: e, title: "Search Error" }); // } // }); //CHANGE: xss added //ADDING MOVIE TO USER'S WATCHLIST router.post("/watchlist/:id", async (req, res) => { const movie = req.body; try { const { username, movie_name } = movie; //const movie = await moviesData.getMovie(req.params.id); let userWatch = await usersData.addToWatch(xss(username), xss(movie_name)); res.status(200).json(userWatch); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Error" }); } }); //REMOVING MOVIE FROM USER'S WATCHLIST // router.get("/unwatchlist/:id", async (req, res) => { // try { // const movie = await moviesData.getMovie(req.params.id); // const user = await usersData.removeFromWatch("royroy", movie["movie_name"]); // res.status(200).json(user); // } catch (e) { // res.status(400).render("pages/error", { error: e, title: "Search Error" }); // } // }); //CHANGE: xss added //MARKING MOVIE AS WATCHED router.post("/watched/:id", async (req, res) => { const movie = req.body; try { const { username, movie_name } = movie; //const movie = await moviesData.getMovie(req.params.id); const watchMovie = await moviesData.movieWatched( xss(username), xss(movie_name) ); res.status(200).json(watchMovie); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.username, }); } }); //CHANGE: input check for term and throw string //SEARCH BAR WHEN GIVEN MOVIE NAME router.get("/search/movie/:term", async (req, res) => { try { if (!req.params.term || typeof req.params.term !== "string") throw "invalid term passed"; const movie = await moviesData.searchByMovie(req.params.term); res.render("movies/allMovies", { movieList: movie, title: "All Movies", user: req.session.user.username, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.username, }); } }); //CHANGE: input check for term and throw string //SEARCH BAR WHEN GIVEN DIRECTOR router.get("/search/director/:term", async (req, res) => { try { if (!req.params.term || typeof req.params.term !== "string") throw "invalid term passed"; const movie = await moviesData.searchByDirector(req.params.term); res.render("movies/allMovies", { movieList: movie, title: "All Movies", user: req.session.user.username, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.username, }); } }); //CHANGE: input check for term and routes //SEARCH BAR WHEN GIVEN CAST NAME router.get("/search/cast/:term", async (req, res) => { try { if (!req.params.term || typeof req.params.term !== "string") throw "invalid term passed"; const movie = await moviesData.searchByCast(req.params.term); res.render("movies/allMovies", { movieList: movie, title: "All Movies", user: req.session.user.username, authenticated: req.session.user ? true : false, username: req.session.user.username, }); } catch (e) { res.status(400).render("pages/error", { error: e, title: "Search Error", authenticated: req.session.user ? true : false, username: req.session.username, }); } }); // router.post('/addMovie', async (req, res) => { // const moviesDataList = req.body; // if (!moviesDataList.movie_name) { // res.status(400).json({ error: 'You must provide Name of the Movie' }); // return; // } // if (!moviesDataList.director) { // res.status(400).json({ error: 'You must provide the director name of the Movie' }); // return; // } // if (!moviesDataList.release_year) { // res.status(400).json({ error: 'You must provide release year of the Movie' }); // return; // } // if (!moviesDataList.cast) { // res.status(400).json({ error: 'You must provide cast of the Movie' }); // return; // } // if (!moviesDataList.genre) { // res.status(400).json({ error: 'You must provide genre of the Movie' }); // return; // } // if (!moviesDataList.streaming_services) { // res.status(400).json({ error: 'You must provide streaming services of the Movie' }); // return; // } // if (!moviesDataList.movie_img) { // res.status(400).json({ error: 'You must provide poster/image of the Movie' }); // return; // } // try { // const { movie_name, director, release_year, cast, streaming_services, genre, movie_img } = moviesDataList; // const newMovie = await moviesData.createMovie(movie_name, director, release_year, cast, streaming_services,genre, movie_img); // res.status(200).json(newMovie); // } catch (e) { // res.status(500).json({ error: e }); // } // }); // router.put("/edit/:id", async (req, res) => { // const updatedData = req.body; // if ( // !updatedData.movie_name || // !updatedData.director || // !updatedData.release_year || // !updatedData.cast || // !updatedData.genre || // !updatedData.streaming_services // ) { // res.status(400).json({ error: "You must Supply All fields" }); // return; // } // try { // await moviesData.getMovie(req.params.id); // } catch (e) { // res.status(404).json({ error: "Movie/TV Show not found" }); // return; // } // try { // const { // movie_name, // director, // release_year, // cast, // streaming_services, // genre, // movie_img, // } = updatedData; // const updatedMovie = await moviesData.updatingMovie( // req.params.id, // movie_name, // director, // release_year, // cast, // streaming_services, // genre, // movie_img // ); // res.status(200).json(updatedMovie); // } catch (e) { // res.status(500).json({ error: e }); // } // }); // router.delete('/:id', async (req, res) => { // if (!req.params.id) { // res.status(400).json({ error: 'You must Supply an ID to delete' }); // return; // } // try { // await moviesData.get(req.params.id); // } catch (e) { // res.status(404).json({ error: 'Movie not found' }); // return; // } // try { // const delmovie = await moviesData.remove(req.params.id); // res.status(200).json(delmovie); // } catch (e) { // res.status(500).json({ error: e }); // } // }); module.exports = router;
import React from 'react' import './TitleTemplate.css' const TitleTemplate = () => { return ( <div className="titleTemplate"> <h1>Ahvena Balcony Blog</h1> <h3>- From the Balconies of Hervanta</h3> </div> ) } export default TitleTemplate
import pymongo import urllib from dotenv import load_dotenv import os load_dotenv() MONGO_PW = os.getenv("MONGO_PW") pw = urllib.parse.quote_plus(MONGO_PW) mongo_url = "mongodb+srv://alexmjn:" + pw + "@cluster0-semjk.mongodb.net/test?retryWrites=true&w=majority" client = pymongo.MongoClient(mongo_url, connect = False) print("client:", type(client)) #print(dir(client)) #class mongo client db = client.test #this creates new "test" database on the fly - # not a "test" method." built in to pymongo. print("db", type(db)) #print(dir(db)) #class pymongo.database.Database result = db.test.insert_one({'stringy key': [2, 'thing', 3]}) #class pymongo.results.InsertOneResult print("result", type(result)) print(result.inserted_id) print(db.test.find_one({'stringy key': [2, 'thing', 3]}))
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: hapi/release/hook.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='hapi/release/hook.proto', package='hapi.release', syntax='proto3', serialized_pb=_b('\n\x17hapi/release/hook.proto\x12\x0chapi.release\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x03\n\x04Hook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\x10\n\x08manifest\x18\x04 \x01(\t\x12(\n\x06\x65vents\x18\x05 \x03(\x0e\x32\x18.hapi.release.Hook.Event\x12,\n\x08last_run\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06weight\x18\x07 \x01(\x05\x12\x38\n\x0f\x64\x65lete_policies\x18\x08 \x03(\x0e\x32\x1f.hapi.release.Hook.DeletePolicy\"\xd4\x01\n\x05\x45vent\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0f\n\x0bPRE_INSTALL\x10\x01\x12\x10\n\x0cPOST_INSTALL\x10\x02\x12\x0e\n\nPRE_DELETE\x10\x03\x12\x0f\n\x0bPOST_DELETE\x10\x04\x12\x0f\n\x0bPRE_UPGRADE\x10\x05\x12\x10\n\x0cPOST_UPGRADE\x10\x06\x12\x10\n\x0cPRE_ROLLBACK\x10\x07\x12\x11\n\rPOST_ROLLBACK\x10\x08\x12\x18\n\x14RELEASE_TEST_SUCCESS\x10\t\x12\x18\n\x14RELEASE_TEST_FAILURE\x10\n\")\n\x0c\x44\x65letePolicy\x12\r\n\tSUCCEEDED\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x42\tZ\x07releaseb\x06proto3') , dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _HOOK_EVENT = _descriptor.EnumDescriptor( name='Event', full_name='hapi.release.Hook.Event', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='PRE_INSTALL', index=1, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( name='POST_INSTALL', index=2, number=2, options=None, type=None), _descriptor.EnumValueDescriptor( name='PRE_DELETE', index=3, number=3, options=None, type=None), _descriptor.EnumValueDescriptor( name='POST_DELETE', index=4, number=4, options=None, type=None), _descriptor.EnumValueDescriptor( name='PRE_UPGRADE', index=5, number=5, options=None, type=None), _descriptor.EnumValueDescriptor( name='POST_UPGRADE', index=6, number=6, options=None, type=None), _descriptor.EnumValueDescriptor( name='PRE_ROLLBACK', index=7, number=7, options=None, type=None), _descriptor.EnumValueDescriptor( name='POST_ROLLBACK', index=8, number=8, options=None, type=None), _descriptor.EnumValueDescriptor( name='RELEASE_TEST_SUCCESS', index=9, number=9, options=None, type=None), _descriptor.EnumValueDescriptor( name='RELEASE_TEST_FAILURE', index=10, number=10, options=None, type=None), ], containing_type=None, options=None, serialized_start=306, serialized_end=518, ) _sym_db.RegisterEnumDescriptor(_HOOK_EVENT) _HOOK_DELETEPOLICY = _descriptor.EnumDescriptor( name='DeletePolicy', full_name='hapi.release.Hook.DeletePolicy', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='SUCCEEDED', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='FAILED', index=1, number=1, options=None, type=None), ], containing_type=None, options=None, serialized_start=520, serialized_end=561, ) _sym_db.RegisterEnumDescriptor(_HOOK_DELETEPOLICY) _HOOK = _descriptor.Descriptor( name='Hook', full_name='hapi.release.Hook', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='name', full_name='hapi.release.Hook.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='kind', full_name='hapi.release.Hook.kind', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='path', full_name='hapi.release.Hook.path', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='manifest', full_name='hapi.release.Hook.manifest', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='events', full_name='hapi.release.Hook.events', index=4, number=5, type=14, cpp_type=8, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='last_run', full_name='hapi.release.Hook.last_run', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='weight', full_name='hapi.release.Hook.weight', index=6, number=7, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='delete_policies', full_name='hapi.release.Hook.delete_policies', index=7, number=8, type=14, cpp_type=8, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ _HOOK_EVENT, _HOOK_DELETEPOLICY, ], options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=75, serialized_end=561, ) _HOOK.fields_by_name['events'].enum_type = _HOOK_EVENT _HOOK.fields_by_name['last_run'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _HOOK.fields_by_name['delete_policies'].enum_type = _HOOK_DELETEPOLICY _HOOK_EVENT.containing_type = _HOOK _HOOK_DELETEPOLICY.containing_type = _HOOK DESCRIPTOR.message_types_by_name['Hook'] = _HOOK _sym_db.RegisterFileDescriptor(DESCRIPTOR) Hook = _reflection.GeneratedProtocolMessageType('Hook', (_message.Message,), dict( DESCRIPTOR = _HOOK, __module__ = 'hapi.release.hook_pb2' # @@protoc_insertion_point(class_scope:hapi.release.Hook) )) _sym_db.RegisterMessage(Hook) DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z\007release')) try: # THESE ELEMENTS WILL BE DEPRECATED. # Please use the generated *_pb2_grpc.py files instead. import grpc from grpc.beta import implementations as beta_implementations from grpc.beta import interfaces as beta_interfaces from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities except ImportError: pass # @@protoc_insertion_point(module_scope)
import time from base64 import urlsafe_b64encode from http import HTTPStatus from fastapi.param_functions import Query from fastapi.params import Depends from pydantic import BaseModel from starlette.exceptions import HTTPException from lnbits import bolt11 from lnbits.core.crud import delete_expired_invoices, get_payments from lnbits.core.services import create_invoice, pay_invoice from lnbits.decorators import WalletTypeInfo from lnbits.settings import WALLET from . import lndhub_ext from .decorators import check_wallet, require_admin_key from .utils import decoded_as_lndhub, to_buffer @lndhub_ext.get("/ext/getinfo") async def lndhub_getinfo(): raise HTTPException(status_code=HTTPStatus.UNAUTHORIZED, detail="bad auth") class AuthData(BaseModel): login: str = Query(None) password: str = Query(None) refresh_token: str = Query(None) @lndhub_ext.post("/ext/auth") async def lndhub_auth(data: AuthData): token = ( data.refresh_token if data.refresh_token else urlsafe_b64encode( (data.login + ":" + data.password).encode("utf-8") ).decode("ascii") ) return {"refresh_token": token, "access_token": token} class AddInvoice(BaseModel): amt: str = Query(...) memo: str = Query(...) preimage: str = Query(None) @lndhub_ext.post("/ext/addinvoice") async def lndhub_addinvoice( data: AddInvoice, wallet: WalletTypeInfo = Depends(check_wallet) ): try: _, pr = await create_invoice( wallet_id=wallet.wallet.id, amount=int(data.amt), memo=data.memo or "received sats", extra={"tag": "lndhub"}, ) except: raise HTTPException( status_code=HTTPStatus.NOT_FOUND, detail="Failed to create invoice" ) invoice = bolt11.decode(pr) return { "pay_req": pr, "payment_request": pr, "add_index": "500", "r_hash": to_buffer(invoice.payment_hash), "hash": invoice.payment_hash, } class Invoice(BaseModel): invoice: str = Query(...) @lndhub_ext.post("/ext/payinvoice") async def lndhub_payinvoice( r_invoice: Invoice, wallet: WalletTypeInfo = Depends(require_admin_key) ): try: await pay_invoice( wallet_id=wallet.wallet.id, payment_request=r_invoice.invoice, extra={"tag": "lndhub"}, ) except: raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail="Payment failed") invoice: bolt11.Invoice = bolt11.decode(r_invoice.invoice) return { "payment_error": "", "payment_preimage": "0" * 64, "route": {}, "payment_hash": invoice.payment_hash, "decoded": decoded_as_lndhub(invoice), "fee_msat": 0, "type": "paid_invoice", "fee": 0, "value": invoice.amount_msat / 1000, "timestamp": int(time.time()), "memo": invoice.description, } @lndhub_ext.get("/ext/balance") async def lndhub_balance(wallet: WalletTypeInfo = Depends(check_wallet),): return {"BTC": {"AvailableBalance": wallet.wallet.balance}} @lndhub_ext.get("/ext/gettxs") async def lndhub_gettxs( wallet: WalletTypeInfo = Depends(check_wallet), limit: int = Query(0, ge=0, lt=200) ): for payment in await get_payments( wallet_id=wallet.wallet.id, complete=False, pending=True, outgoing=True, incoming=False, exclude_uncheckable=True, ): await payment.set_pending( (await WALLET.get_payment_status(payment.checking_id)).pending ) return [ { "payment_preimage": payment.preimage, "payment_hash": payment.payment_hash, "fee_msat": payment.fee * 1000, "type": "paid_invoice", "fee": payment.fee, "value": int(payment.amount / 1000), "timestamp": payment.time, "memo": payment.memo if not payment.pending else "Payment in transition", } for payment in reversed( ( await get_payments( wallet_id=wallet.wallet.id, pending=True, complete=True, outgoing=True, incoming=False, ) )[:limit] ) ] @lndhub_ext.get("/ext/getuserinvoices") async def lndhub_getuserinvoices( wallet: WalletTypeInfo = Depends(check_wallet), limit: int = Query(0, ge=0, lt=200) ): await delete_expired_invoices() for invoice in await get_payments( wallet_id=wallet.wallet.id, complete=False, pending=True, outgoing=False, incoming=True, exclude_uncheckable=True, ): await invoice.set_pending( (await WALLET.get_invoice_status(invoice.checking_id)).pending ) return [ { "r_hash": to_buffer(invoice.payment_hash), "payment_request": invoice.bolt11, "add_index": "500", "description": invoice.memo, "payment_hash": invoice.payment_hash, "ispaid": not invoice.pending, "amt": int(invoice.amount / 1000), "expire_time": int(time.time() + 1800), "timestamp": invoice.time, "type": "user_invoice", } for invoice in reversed( ( await get_payments( wallet_id=wallet.wallet.id, pending=True, complete=True, incoming=True, outgoing=False, ) )[:limit] ) ] @lndhub_ext.get("/ext/getbtc") async def lndhub_getbtc(wallet: WalletTypeInfo = Depends(check_wallet)): "load an address for incoming onchain btc" return [] @lndhub_ext.get("/ext/getpending") async def lndhub_getpending(wallet: WalletTypeInfo = Depends(check_wallet)): "pending onchain transactions" return [] @lndhub_ext.get("/ext/decodeinvoice") async def lndhub_decodeinvoice(invoice: str = Query(None)): inv = bolt11.decode(invoice) return decoded_as_lndhub(inv) @lndhub_ext.get("/ext/checkrouteinvoice") async def lndhub_checkrouteinvoice(): "not implemented on canonical lndhub" pass
"use strict"; // Diablo 3 Game Data API documentation: https://develop.battle.net/documentation/diablo-3/game-data-apis var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); class Diablo3GameData { constructor(axiosInstance) { this.gameBaseUrlPath = '/data/d3'; this.axios = axiosInstance; } /** * Returns an index of available seasons. */ getSeasonIndex() { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/season`, 'Error fetching the season index.'); }); } /** * Returns a leaderboard list for the specified season. * * @param seasonId The season for the leaderboard list; get a list of seasons with `getSeasonIndex`. */ getSeason(seasonId) { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/season/${seasonId}`, 'Error fetching the specified season.'); }); } /** * Returns a the specified leaderboard for the specified season. * * @param seasonId The season for the leaderboard; get a list of seasons with `getSeasonIndex`. * @param leaderboardId The leaderboard to retrieve; get a list of leaderboards with `getSeason`. */ getSeasonLeaderboard(seasonId, leaderboardId) { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/season/${seasonId}/leaderboard/${leaderboardId}`, 'Error fetching the specified season leaderboard.'); }); } /** * Returns an index of available eras. */ getEraIndex() { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/era`, 'Error fetching the era index.'); }); } /** * Returns a leaderboard list for a particular era. * * @param eraId The era to retrieve; get a list of eras with `getEraIndex`. */ getEra(eraId) { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/era/${eraId}`, 'Error fetching the specified era.'); }); } /** * Returns the specified leaderboard for the specified era. * * @param eraId The era for the leaderboard; get a list of eras with `getEraIndex`. * @param leaderboardId The leaderboard to retrieve; get a list of leaderboards with `getEra`. */ getEraLeaderboard(eraId, leaderboardId) { return __awaiter(this, void 0, void 0, function* () { return yield this._handleApiCall(`${this.gameBaseUrlPath}/era/${eraId}/leaderboard/${leaderboardId}`, 'Error fetching the specified era leaderboard.'); }); } /******************************** * Private Class Helper Functions ********************************/ _handleApiCall(apiUrl, errorMessage) { return __awaiter(this, void 0, void 0, function* () { try { const response = yield this.axios.get(encodeURI(apiUrl)); return response.data; } catch (error) { console.log(error); throw new Error(`Diablo 3 Game Data Error :: ${errorMessage}`); } }); } } exports.default = Diablo3GameData;
"use strict"; /* CONFIG.js Contains API information. */ export default { POKE_API: { URL_ROOT: "https://pokeapi.co/api/v2/pokemon/" }, BINARY_JAZZ: { URL_ROOT: "https://binaryjazz.us/wp-json/genrenator/v1/", ENDPOINTS: { GENRE: "genre", STORY: "story" } }, FIREBASE: { }, UNSPLASH: { }, };
import axios from '../../../axios/index.js' import store from '../../../../store/store.js' // Token Refresh let isAlreadyFetchingAccessToken = false let subscribers = [] function onAccessTokenFetched (access_token) { subscribers = subscribers.filter(callback => callback(access_token)) } function addSubscriber (callback) { subscribers.push(callback) } export default { init () { axios.interceptors.response.use(function (response) { return response }, function (error) { // const { config, response: { status } } = error const { config, response } = error const originalRequest = config // if (status === 401) { if (response && response.status === 401) { if (!isAlreadyFetchingAccessToken) { isAlreadyFetchingAccessToken = true store.dispatch('auth/fetchAccessToken') .then((access_token) => { isAlreadyFetchingAccessToken = false onAccessTokenFetched(access_token) }) } const retryOriginalRequest = new Promise((resolve) => { addSubscriber(access_token => { originalRequest.headers.Authorization = `Bearer ${access_token}` resolve(axios(originalRequest)) }) }) return retryOriginalRequest } return Promise.reject(error) }) }, login (email, pwd) { return axios.post('/api/jwt/login', { email, password: pwd }) }, registerUser (name, email, pwd) { return axios.post('/api/auth/register', { displayName: name, email, password: pwd }) }, refreshToken () { return axios.post('/api/auth/refresh-token', {accessToken: localStorage.getItem('accessToKen')}) } }
(function(){throw"poop";}).call(this);
import React from "react" import { graphql } from "gatsby" import Layout from "../components/layout" import SEO from "../components/seo" import { Card, Button, Input, Form } from "antd" const { Meta } = Card const IndexPage = props => ( <Layout> <SEO title="Apex refrigeration" keywords={[`gatsby`, `application`, `react`]} /> <div> <div style={{ backgroundImage: `url(${ props.data.allLandingPage.edges[0].node.backgroundImage })`, backgroundRepeat: "no-repeat", backgroundPosition: "center", backgroundSize: "cover", minHeight: 600, }} > <div style={{ minHeight: 600, display: "flex", alignItems: "center", justifyContent: "center", color: "white", width: "100%", background: "rgb(0,0,0)", background: " linear-gradient(90deg, rgba(0,0,0,0.80015756302521) 0%, rgba(0,0,0,0.6152836134453781) 18%, rgba(0,212,255,0) 100%)", }} > <div style={{ maxWidth: 1080, width: "100%", justifyContent: "left" }} > <div style={{ maxWidth: 700, padding: `1rem 1rem` }}> <p>YOUR APPLICANCES ARE IN SAFE HANDS</p> <h1 style={{ fontWeight: 700, fontSize: 50, color: "white" }}> Refrigeration and Air Conditioning Appliances </h1> <Button shape="round" style={{ marginTop: 32 }} type="primary"> Contact Us </Button> </div> </div> </div> </div> <section style={{ backgroundColor: "#f8f8f8" }}> <div style={{ alignItems: "center", display: "flex", padding: `4rem 1rem`, flexDirection: "column", maxWidth: 1080, marginLeft: "auto", marginRight: "auto", }} > <h1>Our Services</h1> <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> <div style={{ display: "flex", flexWrap: "wrap", marginTop: 48 }}> <Card hoverable style={{ margin: "1em 1em", border: "none", borderRadius: 16 }} > <Meta title={<h3 style={{ textAlign: "center" }}>New equipment supply and installation</h3>} description={ <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> } /> </Card> <Card hoverable style={{ margin: "1em 1em", border: "none", borderRadius: 16 }} > <Meta title={<h3 style={{ textAlign: "center" }}>Good quality after sale service</h3>} description={ <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> } /> </Card> <Card hoverable style={{ margin: "1em 1em", border: "none", borderRadius: 16 }} > <Meta title={<h3 style={{ textAlign: "center" }}>Existing equipment scheduled and breakdown maintenance</h3>} description={ <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> } /> </Card> <Card hoverable style={{ margin: "1em 1em", border: "none", borderRadius: 16 }} > <Meta title={<h3 style={{ textAlign: "center" }}>Retail, wholesale and bulk supply of related parts</h3>} description={ <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> } /> </Card> </div> </div> </section> <section style={{ backgroundColor: "#ffffff" }}> <div style={{ alignItems: "center", display: "flex", padding: `4rem 1rem`, flexDirection: "column", maxWidth: 1080, marginLeft: "auto", marginRight: "auto", }} > <h1>Our Products</h1> <p style={{ textAlign: "center" }}> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> <div style={{ marginTop: "6em" }}> <Card hoverable style={{ padding: 0, border: "none", margin: "1em" }} > <div style={{ display: "flex", flexWrap: "wrap" }}> <img src={props.data.allLandingPage.edges[0].node.backgroundImage} style={{ height: 200, flex: 1 }} /> <div style={{ flex: 1, padding: "0em 2em", alignItems: "center" }} > <h3>Cold Room building and maintainance</h3> <p> We build cold rooms from scratch with minimal supervision. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> </div> </div> </Card> <Card hoverable style={{ padding: 0, border: "none", margin: "1em" }} > <div style={{ display: "flex", flexWrap: "wrap" }}> <img src={props.data.allLandingPage.edges[0].node.backgroundImage} style={{ height: 200, flex: 1 }} /> <div style={{ flex: 1, padding: "0em 2em", alignItems: "center" }} > <h3>Refrigerator repair and maintainance</h3> <p> We build cold rooms from scratch with minimal supervision. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> </div> </div> </Card> <Card hoverable style={{ padding: 0, border: "none", margin: "1em" }} > <div style={{ display: "flex", flexWrap: "wrap" }}> <img src={props.data.allLandingPage.edges[0].node.backgroundImage} style={{ height: 200, flex: 1 }} /> <div style={{ flex: 1, padding: "0em 2em", alignItems: "center" }} > <h3>Microwave services</h3> <p> We build cold rooms from scratch with minimal supervision. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris. </p> </div> </div> </Card> </div> </div> </section> <section style={{ backgroundColor: "#f8f8f8" }}> <div style={{ alignItems: "center", display: "flex", padding: `4rem 1rem`, flexDirection: "column", maxWidth: 1080, marginLeft: "auto", marginRight: "auto", }} > <h1>Contact Us</h1> <p style={{ textAlign: "center" }}> Send us an email by filling your details in the form below. We check emails regularly </p> <Form style={{ width: 400, marginTop: "6em" }}> <Form.Item> <Input placeholder="Full Name" /> </Form.Item> <Form.Item> <Input placeholder="Email Address" /> </Form.Item> <Form.Item> <Input.TextArea rows={4} /> </Form.Item> <Form.Item style={{ display: "flex", justifyContent: "center" }}> <Button shape="round" type="primary"> Submit </Button> </Form.Item> </Form> </div> </section> </div> </Layout> ) export default IndexPage export const query = graphql` { allLandingPage { edges { node { backgroundImage } } } } `
import {StyleParser} from './style_parser'; import Utils from '../utils/utils'; import log from '../utils/log'; import mergeObjects from '../utils/merge'; import {buildFilter} from './filter'; // N.B.: 'visible' is legacy compatibility for 'enabled' export const reserved = ['filter', 'draw', 'visible', 'enabled', 'data']; let layer_cache = {}; export function layerCache () { return layer_cache; } function cacheKey (layers) { if (layers.length > 1) { var k = layers[0]; for (var i=1; i < layers.length; i++) { k += '/' + layers[i]; } return k; } return layers[0]; } // Merge matching layer trees into a final draw group export function mergeTrees(matchingTrees, group) { let draws, treeDepth = 0; // Find deepest tree for (let t=0; t < matchingTrees.length; t++) { if (matchingTrees[t].length > treeDepth) { treeDepth = matchingTrees[t].length; } } // No layers to parse if (treeDepth === 0) { return null; } // Merged draw group object let draw = { visible: true, // visible by default }; // Iterate trees in parallel for (let x=0; x < treeDepth; x++) { // Pull out the requested draw group, for each tree, at this depth draws = matchingTrees.map(tree => tree[x] && tree[x][group]); if (draws.length === 0) { continue; } // Sort by layer name before merging, so layers are applied deterministically // when multiple layers modify the same properties draws.sort((a, b) => (a && a.layer_name) > (b && b.layer_name) ? 1 : -1); // Merge draw objects mergeObjects(draw, ...draws); // Remove layer names, they were only used transiently to sort and calculate final layer // (final merged names will not be accurate since only one tree can win) delete draw.layer_name; } // Short-circuit if not visible if (draw.visible === false) { return null; } return draw; } const blacklist = ['any', 'all', 'not', 'none']; class Layer { constructor({ layer, name, parent, draw, visible, enabled, filter, styles }) { this.id = Layer.id++; this.config_data = layer.data; this.parent = parent; this.name = name; this.full_name = this.parent ? (this.parent.full_name + ':' + this.name) : this.name; this.draw = draw; this.filter = filter; this.styles = styles; this.is_built = false; enabled = (enabled === undefined) ? visible : enabled; // `visible` property is backwards compatible for `enabled` if (this.parent && this.parent.visible === false) { this.enabled = false; // all descendants of disabled layer are also disabled } else { this.enabled = (enabled !== false); // layer is enabled unless explicitly set to disabled } // Denormalize layer name to draw groups if (this.draw) { for (let group in this.draw) { this.draw[group] = (this.draw[group] == null) ? {} : this.draw[group]; if (typeof this.draw[group] !== 'object') { // Invalid draw group let msg = `Draw group '${group}' for layer ${this.full_name} is invalid, must be an object, `; msg += `but was set to \`${group}: ${this.draw[group]}\` instead`; log('warn', msg); // TODO: fire external event that clients to subscribe to delete this.draw[group]; } else { this.draw[group].layer_name = this.full_name; } } } } build () { log('trace', `Building layer '${this.full_name}'`); this.buildFilter(); this.buildDraw(); this.is_built = true; } buildDraw() { this.draw = Utils.stringsToFunctions(this.draw, StyleParser.wrapFunction); this.calculatedDraw = calculateDraw(this); } buildFilter() { this.filter_original = this.filter; this.filter = Utils.stringsToFunctions(this.filter, StyleParser.wrapFunction); let type = typeof this.filter; if (this.filter != null && type !== 'object' && type !== 'function') { // Invalid filter let msg = `Filter for layer ${this.full_name} is invalid, filter value must be an object or function, `; msg += `but was set to \`filter: ${this.filter}\` instead`; log('warn', msg); // TODO: fire external event that clients to subscribe to return; } try { this.buildZooms(); this.buildPropMatches(); if (this.filter != null && (typeof this.filter === 'function' || Object.keys(this.filter).length > 0)) { this.filter = buildFilter(this.filter, FilterOptions); } else { this.filter = null; } } catch(e) { // Invalid filter let msg = `Filter for layer ${this.full_name} is invalid, \`filter: ${JSON.stringify(this.filter)}\` `; msg += `failed with error '${e.message}', stack trace: ${e.stack}`; log('warn', msg); // TODO: fire external event that clients to subscribe to } } // Zooms often cull large swaths of the layer tree, so they get special treatment and are checked first buildZooms() { let zoom = this.filter && this.filter.$zoom; let ztype = typeof zoom; if (zoom != null && ztype !== 'function') { // don't accelerate function-based filters this.zooms = {}; if (ztype === 'number') { this.zooms[zoom] = true; } else if (Array.isArray(zoom)) { for (let z=0; z < zoom.length; z++) { this.zooms[zoom[z]] = true; } } else if (ztype === 'object' && (zoom.min != null || zoom.max != null)) { let zmin = zoom.min || 0; let zmax = zoom.max || 25; // TODO: replace constant for max possible zoom for (let z=zmin; z < zmax; z++) { this.zooms[z] = true; } } delete this.filter.$zoom; // don't process zoom through usual generic filter logic } } buildPropMatches() { if (!this.filter || Array.isArray(this.filter) || typeof this.filter === 'function') { return; } Object.keys(this.filter).forEach(key => { if (blacklist.indexOf(key) === -1) { let val = this.filter[key]; let type = typeof val; let array = Array.isArray(val); if (!(array || type === 'string' || type === 'number')) { return; } if (key[0] === '$') { // Context property this.context_prop_matches = this.context_prop_matches || []; this.context_prop_matches.push([key.substring(1), array ? val : [val]]); } else { // Feature property this.feature_prop_matches = this.feature_prop_matches || []; this.feature_prop_matches.push([key, array ? val : [val]]); } delete this.filter[key]; } }); } doPropMatches (context) { if (this.feature_prop_matches) { for (let r=0; r < this.feature_prop_matches.length; r++) { let match = this.feature_prop_matches[r]; let val = context.feature.properties[match[0]]; if (val == null || match[1].indexOf(val) === -1) { return false; } } } if (this.context_prop_matches) { for (let r=0; r < this.context_prop_matches.length; r++) { let match = this.context_prop_matches[r]; let val = context[match[0]]; if (val == null || match[1].indexOf(val) === -1) { return false; } } } return true; } doesMatch (context) { if (!this.enabled) { return false; } if (!this.is_built) { this.build(); } // zoom pre-filter: skip rest of filter if out of layer zoom range if (this.zooms != null && !this.zooms[context.zoom]) { return false; } // direct feature property matches if (!this.doPropMatches(context)) { return false; } // any remaining filter (more complex matches or dynamic function) let match; if (this.filter instanceof Function){ try { match = this.filter(context); } catch (error) { // Filter function error let msg = `Filter for this ${this.full_name}: \`filter: ${this.filter_original}\` `; msg += `failed with error '${error.message}', stack trace: ${error.stack}`; log('error', msg, context.feature); } } else { match = this.filter == null; } if (match) { if (this.children_to_parse) { parseLayerChildren(this, this.children_to_parse, this.styles); delete this.children_to_parse; } return true; } return false; } } Layer.id = 0; export class LayerLeaf extends Layer { constructor (config) { super(config); this.is_leaf = true; } } export class LayerTree extends Layer { constructor (config) { super(config); this.is_tree = true; this.layers = config.layers || []; } addLayer (layer) { this.layers.push(layer); } buildDrawGroups (context) { let layers = [], layer_ids = []; matchFeature(context, [this], layers, layer_ids); if (layers.length > 0) { let cache_key = cacheKey(layer_ids); // Only evaluate each layer combination once (undefined means not yet evaluated, // null means evaluated with no draw object) if (layer_cache[cache_key] === undefined) { // Find all the unique visible draw blocks for this layer tree let draw_groups = layers.map(x => x && x.visible !== false && x.calculatedDraw); let draw_keys = {}; for (let r=0; r < draw_groups.length; r++) { let stack = draw_groups[r]; if (!stack) { continue; } for (let g=0; g < stack.length; g++) { let group = stack[g]; for (let key in group) { draw_keys[key] = true; } } } // Calculate each draw group for (let draw_key in draw_keys) { layer_cache[cache_key] = layer_cache[cache_key] || {}; layer_cache[cache_key][draw_key] = mergeTrees(draw_groups, draw_key); // Only save the ones that weren't null if (!layer_cache[cache_key][draw_key]) { delete layer_cache[cache_key][draw_key]; } else { layer_cache[cache_key][draw_key].key = cache_key + '/' + draw_key; layer_cache[cache_key][draw_key].layers = layers.map(x => x && x.full_name); layer_cache[cache_key][draw_key].group = draw_key; } } // No layers evaluated if (layer_cache[cache_key] && Object.keys(layer_cache[cache_key]).length === 0) { layer_cache[cache_key] = null; } } return layer_cache[cache_key]; } } } const FilterOptions = { // Handle unit conversions on filter ranges rangeTransform(val) { if (typeof val === 'string' && val.trim().slice(-3) === 'px2') { return `${parseFloat(val)} * context.meters_per_pixel_sq`; } return val; } }; function isReserved(key) { return reserved.indexOf(key) > -1; } function isEmpty(obj) { return Object.keys(obj).length === 0; } export function groupProps(obj) { let reserved = {}, children = {}; for (let key in obj) { if (isReserved(key)) { reserved[key] = obj[key]; } else { children[key] = obj[key]; } } return [reserved, children]; } export function calculateDraw(layer) { let draw = []; if (layer.parent) { let cs = layer.parent.calculatedDraw || []; draw.push(...cs); } draw.push(layer.draw); return draw; } export function parseLayerNode(name, layer, parent, styles) { layer = (layer == null) ? {} : layer; let properties = { name, layer, parent, styles }; let [reserved, children] = groupProps(layer); let empty = isEmpty(children); let Create; if (empty && parent != null) { Create = LayerLeaf; } else { Create = LayerTree; } let r = new Create(Object.assign(properties, reserved)); // only process child layers if this layer is enabled if (r.enabled) { if (parent) { parent.addLayer(r); } r.children_to_parse = empty ? null : children; } return r; } function parseLayerChildren (parent, children, styles) { for (let key in children) { let child = children[key]; if (typeof child === 'object' && !Array.isArray(child)) { parseLayerNode(key, child, parent, styles); } else { // Invalid layer let msg = `Layer value must be an object: cannot create layer '${key}: ${JSON.stringify(child)}'`; msg += `, under parent layer '${parent.full_name}'.`; // If the parent is a style name, this may be an incorrectly nested layer if (styles[parent.name]) { msg += ` The parent name '${parent.name}' is also the name of a style, did you mean to create a 'draw' group`; if (parent.parent) { msg += ` under '${parent.parent.name}'`; } msg += ` instead?`; } log('warn', msg); // TODO: fire external event that clients to subscribe to } } } export function parseLayers (layers, styles) { layer_cache = {}; // clear layer cache let layer_trees = {}; for (let key in layers) { let layer = layers[key]; if (layer) { layer_trees[key] = parseLayerNode(key, layer, null, styles); } } return layer_trees; } export function matchFeature(context, layers, collected_layers, collected_layers_ids) { let matched = false; let childMatched = false; if (layers.length === 0) { return; } for (let r=0; r < layers.length; r++) { let current = layers[r]; if (current.is_leaf) { if (current.doesMatch(context)) { matched = true; collected_layers.push(current); collected_layers_ids.push(current.id); } } else if (current.is_tree) { if (current.doesMatch(context)) { matched = true; childMatched = matchFeature( context, current.layers, collected_layers, collected_layers_ids ); if (!childMatched) { collected_layers.push(current); collected_layers_ids.push(current.id); } } } } return matched; }
""" :codeauthor: :email:`Gareth J. Greenaway <gareth@saltstack.com>` :codeauthor: :email:`David Murphy <dmurphy@saltstack.com>` """ import datetime import time import types import pytest import salt.modules.gpg as gpg from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch pytest.importorskip("gnupg") pytestmark = [ pytest.mark.skip_unless_on_linux, ] GPG_TEST_KEY_PASSPHRASE = "testkeypassphrase" GPG_TEST_KEY_ID = "7416F045" GPG_TEST_PUB_KEY = """-----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBFz1dx4BDACph7J5nuWE+zb9rZqTaL8akAnPAli2j6Qtk7BTDzTM9Kq80U2P O3QRAFBQDODsgmrBTWgeZeNhN6Snz2WrZ8pC0RMK+mCmEt5S49ydWtvWl/xtzPfg sy8h8OrIjSH1G0NQv9vdBpg2Y9vXLNDCZAqH0/Sh/wCkHT80c4i8TU09UZfx96S6 fFVmB7nHu/ztgiIkC6Fr04WGHlkd50g8r8CFPvwKOTD+rfoMsGppmAC1+y8ajfik B+tEL88Rv2s4hLU78nQ3iGtdVRSs5Ip0x4O/PYZIDEd8KuBMo+flSzOZj2HCbUzN MHiTXIbL8hBlwku9LGO7Itks4v2vfDh57JRHykwzGnvOlgXtSSvbayWLohNXtzWq WtsMKrsrsIUprg1jhIVHnMSZZXMMizlni6MT5vbil2Bgn1g7diNscDnfCD6vlWUH FRS1XkFFZ5ozu0+lC/5UaTcrjhH8/hQBNJwjsDSPsyKYQm+t7PXqq4SlI3Er7JJW esK0diZ6reeebl0AEQEAAbQhdGVzdGtleSA8cGFja2FnaW5nQHNhbHRzdGFjay5j b20+iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEjS1DixNC naoZrRFuvMeUg3QW8EUFAlz1ekoACgkQvMeUg3QW8EVm1gv/Z5CCqFoF8IXpa3g0 G+9C4gRS0h+tEYtjebAgxBn/dqk6cSNIb1BGDM/sSWxK5/jweN8CF/ojVgP1CFrX igULnL3g5351L+8feU2ImP2OML438/GcOOJ+iwTKUBRuqxqK8NwcRuuN6YmbjtUw JSD2+60DlWfGsInyenwGkgBAM44Y6dSAXKsm6dJ/IGVTQIsHE5mKRykrRZ1jyXxw i1CF8fEyG6fNNb8I8Oiyj52xdYMxBvGmgPpFlF1jRoU+OViGFeUiZ49XFlC8GNCf boWfXg+PCwZeWUeJ/s6a6iC5HG7iC0XYRiqhzymP8ctrwwm5dPT4ebYNfUSqq8i0 /YG6JGdsQZrq0i0FuceUSfOKVeFvSm+AkCG3kLxxgM925fqBetWiAJRCDYdmy8uc jm618584hqa/yFMOfwVoLqq8mVg84wyGU6gXo6hXCa/008PITFZD47ILuN/Z8iLm 8Or/aJD5Tq+Wg3r2Di9+Ku8/gcn3bVxwFRjiVPrFwJkyjfMFuQGNBFz1dx4BDADU Ynz0efLmaKqZIjfxwDf7iVqwcD9b8cMXIv2aa3Y56QDVJBXU5952LiU8XuzBBPq+ 4FYQ78UmxSv3Rk6LKb9P2ih2L1PaJuQ1ZkNrQLqab3olpAu/Xe3raGLgCOU0RKJw EPF3RcKu8ALuRcovfwzXWg8w19QRUPewZdVC4VgslKp8mNLECvdUxxVIDQWf06RZ uCAfbqdiYReE62QT7NR4lAa1RpfU7Nt149OcQEP8VKTAZgTYyuwhRXFbrDD3Zp58 k5H0nKHNX+w1Ayih/YUk2b3etaBhlcTVAy/73TPfrd3Gl8dtzJZNtUD/eLWdGfP9 mCghmyAqbiQngH2eAMeifIYornynZFVBPBlvnwy7Iouq0V6tIVyNPGp0jcy1j2XT NRBJyFbvam3hmrRW8A/VOJQ1W7LOKaM/5lh/BarrSLKn0xlL97GTmuSqlS+WrmyM kU182TUYyUD7Rs3mydnMVS/N4aRxu4ITaTm9vieZLmAPR9vPgo+GwdHEkwm797kA EQEAAYkBtgQYAQoAIAIbDBYhBI0tQ4sTQp2qGa0RbrzHlIN0FvBFBQJc9XqkAAoJ ELzHlIN0FvBFlyEL/jVhm2PFj2mCLuKE5/nV4JvxY4Qu4+NCFiEdYK+zUoD36gEJ 3VjHL5dydHuZWcvm+XLW1PseNx2awVs47mjv2iZOLwY6BtfAFWhWEFmBEe6fTFXz KkDWRst4gm0b0B7S3byoABwcyYNS6RkTfUApK4zdYErbfOLoT+Xa08YQKLVK7fmE KBnBnnHUvktYTEvhwv9BID+qLnTVSQcjRcXbDQAYm14c7Nyb/SyxcUaUkCk41MVY +vzNQlFrVc4h2np41X8JbmrsQb37E7lE+h32sJFBU03SGf0vT7SXXQj+UD/DEGay Gt/8aRa5FGrcJyM5mTdbSgvCp0EjTrdokK5GHwM23cbSTo+nN9BNhIBRc4929SaJ DVRqOIoJ+eHZdf3gIkMPOA3fBbMYzW65LIxt/p49tHD0c/nioZETycEgGuuYbnrn IfXHFqiCAxkobIHqUg/BSu1cs8GNgE7BVUXy8JThuzmVdh4Pvd3YN1ouoPyVuDrk ylirh0aqUQdSeIuJTg== =yF8M -----END PGP PUBLIC KEY BLOCK----- """ GPG_TEST_PRIV_KEY = """-----BEGIN PGP PRIVATE KEY BLOCK----- lQWFBFz1dx4BDACph7J5nuWE+zb9rZqTaL8akAnPAli2j6Qtk7BTDzTM9Kq80U2P O3QRAFBQDODsgmrBTWgeZeNhN6Snz2WrZ8pC0RMK+mCmEt5S49ydWtvWl/xtzPfg sy8h8OrIjSH1G0NQv9vdBpg2Y9vXLNDCZAqH0/Sh/wCkHT80c4i8TU09UZfx96S6 fFVmB7nHu/ztgiIkC6Fr04WGHlkd50g8r8CFPvwKOTD+rfoMsGppmAC1+y8ajfik B+tEL88Rv2s4hLU78nQ3iGtdVRSs5Ip0x4O/PYZIDEd8KuBMo+flSzOZj2HCbUzN MHiTXIbL8hBlwku9LGO7Itks4v2vfDh57JRHykwzGnvOlgXtSSvbayWLohNXtzWq WtsMKrsrsIUprg1jhIVHnMSZZXMMizlni6MT5vbil2Bgn1g7diNscDnfCD6vlWUH FRS1XkFFZ5ozu0+lC/5UaTcrjhH8/hQBNJwjsDSPsyKYQm+t7PXqq4SlI3Er7JJW esK0diZ6reeebl0AEQEAAf4HAwIqiZQqEMAZQ/+u0gE6tBcp52lUhE9fjORqgsY6 C5klAfrnrQyHXYkfjjQMWErSDR5FHeOxOPdZNnhVTBRaUIypLd+Os/YWl5lVO223 znbfK8GJIwHbDFQBSxtkC3WtD8cCqtKXvzApZzqeOhgNcaFJE956ZNlZfsCf0qsm 6xpEq07YiRVga6jJvjIFiPv7wMtdQQ67pEP4/tavLl+yuf6oJko2FjuG3RxrTf/C CB4tyHCsRwgV7ouEdoSVhjFiDSS5xeWWLPRaXu4ceL0AjClHmdlMJtcpbyXKoh3U uG5Cnwv9gXh24Qc6uuTWX61u7EhFLUWmKMFOI8dA+INYS8cXU8t6TU6XeV/01c7N Q1O6QUCOx5VRbWRQuuvQN4f1gZm5QqN2jpNWjoUp2GSoxcHycEVSweEr+TmaouDA ZOo12gx6dppkiwqS7Feq28qdpiZZPfdl/CvuWHxveNU9OVlexJ6A5PLep053qY+3 OlkvvkOxwmkJk2A3ITb1XngQkZCQDxAqCG6xMYjGIblKqqLqV1/q3pQ1nNbq5/iM OtoxB7O7kZcyk7fQodk8EUz/ehTAZ5K8EWUETmiH9YlKTBbw8YMYEnuKfUFW6xqT ROqurJfBlYmZEOxQ3oDVLZSfJQ3g/SXAOTKprB9GKyahM026Y+gfqR7yfwA8ifrH E+HV4u7n/UjaUgu45LRGLGZQ7slmm79uYcVhBodQ0/eWcow7roHpOCFWTgyY3uhS xdfuqgkEF8BGjQFaI4VNVeY+3+SM989BagAFuDlJw33fDoFSTPt9C+sqP1t1IvLv 9Eajn55MhO6gUptO3ViFPQE/EkiOrmaAJglu1LHEF/ssqWb/1+RGqF6N0OkKC+gx iuuTgWl4wfxUsyh2JqIcj+xHRSf3G9OVJYkXaYsSNQ2eoSRlEzzu7Cxi83/qt6Dm S+ST4wHl2VypfkhbNMq0W1aR8Kubi2Ixvk31ZDyk0uecRf3kNjVwD84WPjDedBsh 5rtCZO5kCAyWooCG41il09HfV9NCTjACCeO+dl4FO5aaLS0JSCBLVtORtwDCCZz+ QhS9CeXC+ook7sIaaiT0xWSnPmhEYE6roqwj4Lq3vvXIgHZjxeJizlGO0OSdTPBw 9wQ5ij/8G6MEGap4thvTohsFGUxHK2xx8Z089kGdmKd4piY/kjtX7AFtLEc0YiDa w7PTlrqJA9FRta7g/aYVCKBk8G+8dxiErErFgm6RBxnQiJ/lLUAVsJv1cAQ8oyCK GyDzGXEFk9eQtKGczF4CK8NhOMc9HabnQnzxcMGiVXEn/E3bDqocfeOAWEYft8zJ sy96EJAk581uZ4CiKOcQW+Zv3N8O7ogdtCF0ZXN0a2V5IDxwYWNrYWdpbmdAc2Fs dHN0YWNrLmNvbT6JAc4EEwEKADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AW IQSNLUOLE0KdqhmtEW68x5SDdBbwRQUCXPV6SgAKCRC8x5SDdBbwRWbWC/9nkIKo WgXwhelreDQb70LiBFLSH60Ri2N5sCDEGf92qTpxI0hvUEYMz+xJbErn+PB43wIX +iNWA/UIWteKBQucveDnfnUv7x95TYiY/Y4wvjfz8Zw44n6LBMpQFG6rGorw3BxG 643piZuO1TAlIPb7rQOVZ8awifJ6fAaSAEAzjhjp1IBcqybp0n8gZVNAiwcTmYpH KStFnWPJfHCLUIXx8TIbp801vwjw6LKPnbF1gzEG8aaA+kWUXWNGhT45WIYV5SJn j1cWULwY0J9uhZ9eD48LBl5ZR4n+zprqILkcbuILRdhGKqHPKY/xy2vDCbl09Ph5 tg19RKqryLT9gbokZ2xBmurSLQW5x5RJ84pV4W9Kb4CQIbeQvHGAz3bl+oF61aIA lEINh2bLy5yObrXznziGpr/IUw5/BWguqryZWDzjDIZTqBejqFcJr/TTw8hMVkPj sgu439nyIubw6v9okPlOr5aDevYOL34q7z+ByfdtXHAVGOJU+sXAmTKN8wWdBYYE XPV3HgEMANRifPR58uZoqpkiN/HAN/uJWrBwP1vxwxci/ZprdjnpANUkFdTn3nYu JTxe7MEE+r7gVhDvxSbFK/dGTospv0/aKHYvU9om5DVmQ2tAuppveiWkC79d7eto YuAI5TREonAQ8XdFwq7wAu5Fyi9/DNdaDzDX1BFQ97Bl1ULhWCyUqnyY0sQK91TH FUgNBZ/TpFm4IB9up2JhF4TrZBPs1HiUBrVGl9Ts23Xj05xAQ/xUpMBmBNjK7CFF cVusMPdmnnyTkfScoc1f7DUDKKH9hSTZvd61oGGVxNUDL/vdM9+t3caXx23Mlk21 QP94tZ0Z8/2YKCGbICpuJCeAfZ4Ax6J8hiiufKdkVUE8GW+fDLsii6rRXq0hXI08 anSNzLWPZdM1EEnIVu9qbeGatFbwD9U4lDVbss4poz/mWH8FqutIsqfTGUv3sZOa 5KqVL5aubIyRTXzZNRjJQPtGzebJ2cxVL83hpHG7ghNpOb2+J5kuYA9H28+Cj4bB 0cSTCbv3uQARAQAB/gcDAgUPU1tmC3CS/x0qZYicVcMiU5wop6fnbnNkEfUQip8V qpL64/GpP6X7sJiY2BCo0/5AMPDKlTwPxogMQ6NduZ2AbvJybGC7AQULMkd4Y4H1 nwrDk5HWO5dLVoXRSVw9Dm6oaV4bi6wno9yapkq7AVRnvtNEza47gxmV2iwRoU5H 5ciQTU6nd1TkFNhD4ZwZ25CMqffvbrE2Ie6RsBUr9HlxYIint91rVLkkBGhw8W4t KushxAZpBOQB0Rqtuak/q+/xyDnvNvU/A9GeKpRrxzwAbIdtW0VjPulDk1tThGDA kmuxSJ1yxUb+CzA/5YoMXto1OqjUI2hO108xgTVl5hpmckBnwsPtbjrtDYFAqwfq qF9YAVQ3RfMn3ThZ2oXg+FJMcwd9uVJn2/LZd81Nc6g4UogD1sD2ye2vqDGTEztK BAdthEcufnUP5UrEixE8CPzAJOjuC5ROU57FXCaSSUfIwXO3UoxvNWcuXDC7RVDz nsv/Hg2j0pSeFht2NO6Pom+4XHY+LHImPTfXamN6IDsTRJGQW8R7Y131fjPQMn7I 0WjyIiqD4eLo5KQYjL+0bE0JiLRaJnlfbu1uoV3sgi8bwG6WlnLh7eKDErA2P0Zs r0KX5yGR5Ih2CAMfMmqqYrkEYmNxNbLvL5ie9F35MnvRbqyY/9pl0p1Eah7uGnuK or13bg801HoZJLBTr4sJTqkwuUztloVyBdM6T5hal+rxX37Wnj1PgD0e0Ydqo6hJ 7WJ/Zjd+0qk90VoiGNRre7tMBYDQ3w3wS+tSta3kxTKj5I4hLZncN+pt9F6o+tgd YAhWO93DzWjMMUV/jkKTJqwAFAuRlnTwzbBS70N2Z8jrGczV05RV9OH7DRr34noF O7/Bn0iDpKZdbArtkJZyu4B+MUp/RRiuxn7iWOM2tEjDhUuyHXYYFppFB8fG7r52 VcxH/Sc3VcXB0l2KywrAG2oZfiE8M4NPHuiIHFpcjeK2VLrP2iGLvdlL4IsvtFIU uLiFi7r0egEi/Ge8ebRF7TtjmhL5Jzi9bbUGuvxSIGZU1HCECq+hHVy45XwKrRTo AzDIwNjBFmZzL7FI7X16W/6Y11VVmXEmDt9dmmu78bT0z2Bq0Q7K9C7Eq2qzW65z +4fntFF8BWDs3l5yPKLjg+wlgPPXieHgrUQpZOYCsFJqig3xFZSu1ZMzYdlvyNSF KAgMPZfi37kAUo8ZiH27SZAA/aTK6b69oEQ6I7CsMJZLRp/gzYvn4NN/DIK3fuYc jsKB6OR3gWmU7EDf/1EZkO0YK2YiwkSrDALJdUo7ArYR2KIZTUEG9rxDBUD8IyIz PGdh7sBG4PhOxpQ+SiZyzLzZAJjviQG2BBgBCgAgAhsMFiEEjS1DixNCnaoZrRFu vMeUg3QW8EUFAlz1eqQACgkQvMeUg3QW8EWXIQv+NWGbY8WPaYIu4oTn+dXgm/Fj hC7j40IWIR1gr7NSgPfqAQndWMcvl3J0e5lZy+b5ctbU+x43HZrBWzjuaO/aJk4v BjoG18AVaFYQWYER7p9MVfMqQNZGy3iCbRvQHtLdvKgAHBzJg1LpGRN9QCkrjN1g Stt84uhP5drTxhAotUrt+YQoGcGecdS+S1hMS+HC/0EgP6oudNVJByNFxdsNABib Xhzs3Jv9LLFxRpSQKTjUxVj6/M1CUWtVziHaenjVfwluauxBvfsTuUT6HfawkUFT TdIZ/S9PtJddCP5QP8MQZrIa3/xpFrkUatwnIzmZN1tKC8KnQSNOt2iQrkYfAzbd xtJOj6c30E2EgFFzj3b1JokNVGo4ign54dl1/eAiQw84Dd8FsxjNbrksjG3+nj20 cPRz+eKhkRPJwSAa65hueuch9ccWqIIDGShsgepSD8FK7VyzwY2ATsFVRfLwlOG7 OZV2Hg+93dg3Wi6g/JW4OuTKWKuHRqpRB1J4i4lO =WRTN -----END PGP PRIVATE KEY BLOCK----- """ @pytest.fixture def gpghome(tmp_path): root = tmp_path / "gpghome" root.mkdir(mode=0o0700) pub = root / "gpgfile.pub" pub.write_text(GPG_TEST_PUB_KEY) priv = root / "gpgfile.priv" priv.write_text(GPG_TEST_PRIV_KEY) return types.SimpleNamespace(path=root, pub=pub, priv=priv) @pytest.fixture def configure_loader_modules(gpghome): return {gpg: {}} def test_list_keys(): """ Test gpg.list_keys """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": "/root", "fullname": "root", "homephone": "", "name": "root", } _list_result = [ { "dummy": "", "keyid": "xxxxxxxxxxxxxxxx", "expires": "2011188692", "sigs": [], "subkeys": [ ["xxxxxxxxxxxxxxxx", "e", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] ], "length": "4096", "ownertrust": "-", "sig": "", "algo": "1", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "date": "1506612692", "trust": "-", "type": "pub", "uids": ["GPG Person <person@example.com>"], } ] _expected_result = [ { "keyid": "xxxxxxxxxxxxxxxx", "uids": ["GPG Person <person@example.com>"], "created": "2017-09-28", "expires": "2033-09-24", "keyLength": "4096", "ownerTrust": "Unknown", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "trust": "Unknown", } ] mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch.object(gpg, "_list_keys", return_value=_list_result): assert gpg.list_keys() == _expected_result def test_get_key(): """ Test gpg.get_key """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": "/root", "fullname": "root", "homephone": "", "name": "root", } _list_result = [ { "dummy": "", "keyid": "xxxxxxxxxxxxxxxx", "expires": "2011188692", "sigs": [], "subkeys": [ ["xxxxxxxxxxxxxxxx", "e", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] ], "length": "4096", "ownertrust": "-", "sig": "", "algo": "1", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "date": "1506612692", "trust": "-", "type": "pub", "uids": ["GPG Person <person@example.com>"], } ] _expected_result = { "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "keyid": "xxxxxxxxxxxxxxxx", "uids": ["GPG Person <person@example.com>"], "created": "2017-09-28", "trust": "Unknown", "ownerTrust": "Unknown", "expires": "2033-09-24", "keyLength": "4096", } mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch.object(gpg, "_list_keys", return_value=_list_result): ret = gpg.get_key("xxxxxxxxxxxxxxxx") assert ret == _expected_result def test_delete_key_without_passphrase(gpghome): """ Test gpg.delete_key without passphrase """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } _list_result = [ { "dummy": "", "keyid": "xxxxxxxxxxxxxxxx", "expires": "2011188692", "sigs": [], "subkeys": [ ["xxxxxxxxxxxxxxxx", "e", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] ], "length": "4096", "ownertrust": "-", "sig": "", "algo": "1", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "date": "1506612692", "trust": "-", "type": "pub", "uids": ["GPG Person <person@example.com>"], } ] _expected_result = { "res": True, "message": ( "Secret key for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx deleted\nPublic" " key for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx deleted" ), } mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch.object(gpg, "_list_keys", return_value=_list_result): with patch( "salt.modules.gpg.gnupg.GPG.delete_keys", MagicMock(return_value="ok"), ) as gnupg_delete_keys: ret = gpg.delete_key( "xxxxxxxxxxxxxxxx", delete_secret=True, use_passphrase=False ) assert ret == _expected_result gnupg_delete_keys.assert_called_with( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", False, expect_passphrase=False, ) def test_delete_key_with_passphrase_without_gpg_passphrase_in_pillar(gpghome): """ Test gpg.delete_key with passphrase but without gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } _list_result = [ { "dummy": "", "keyid": "xxxxxxxxxxxxxxxx", "expires": "2011188692", "sigs": [], "subkeys": [ ["xxxxxxxxxxxxxxxx", "e", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] ], "length": "4096", "ownertrust": "-", "sig": "", "algo": "1", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "date": "1506612692", "trust": "-", "type": "pub", "uids": ["GPG Person <person@example.com>"], } ] _expected_result = { "res": True, "message": "gpg_passphrase not available in pillar.", } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=None) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): with patch.object(gpg, "_list_keys", return_value=_list_result): with patch( "salt.modules.gpg.gnupg.GPG.delete_keys" ) as gnupg_delete_keys: ret = gpg.delete_key("xxxxxxxxxxxxxxxx", delete_secret=True) assert ret == _expected_result gnupg_delete_keys.assert_not_called() def test_delete_key_with_passphrase_with_gpg_passphrase_in_pillar(gpghome): """ Test gpg.delete_key with passphrase and gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } _list_result = [ { "dummy": "", "keyid": "xxxxxxxxxxxxxxxx", "expires": "2011188692", "sigs": [], "subkeys": [ ["xxxxxxxxxxxxxxxx", "e", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] ], "length": "4096", "ownertrust": "-", "sig": "", "algo": "1", "fingerprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "date": "1506612692", "trust": "-", "type": "pub", "uids": ["GPG Person <person@example.com>"], } ] _expected_result = { "res": True, "message": ( "Secret key for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx deleted\nPublic" " key for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx deleted" ), } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=GPG_TEST_KEY_PASSPHRASE) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): with patch.object(gpg, "_list_keys", return_value=_list_result): with patch( "salt.modules.gpg.gnupg.GPG.delete_keys", MagicMock(return_value="ok"), ) as gnupg_delete_keys: ret = gpg.delete_key("xxxxxxxxxxxxxxxx", delete_secret=True) assert ret == _expected_result gnupg_delete_keys.assert_called_with( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", False, passphrase=GPG_TEST_KEY_PASSPHRASE, ) def test_export_key_without_passphrase(gpghome): """ Test gpg.export_key without passphrase """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch( "salt.modules.gpg.gnupg.GPG.export_keys", MagicMock(return_value=GPG_TEST_PUB_KEY), ) as gnupg_export_keys: ret = gpg.export_key("xxxxxxxxxxxxxxxx") assert ret == GPG_TEST_PUB_KEY gnupg_export_keys.assert_called_with( ["xxxxxxxxxxxxxxxx"], False, expect_passphrase=False, ) def test_export_multiple_keys_without_passphrase(gpghome): """ Test gpg.export_key with multiple keys and without passphrase """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch( "salt.modules.gpg.gnupg.GPG.export_keys", MagicMock(return_value=GPG_TEST_PUB_KEY), ) as gnupg_export_keys: ret = gpg.export_key( "xxxxxxxxxxxxxxxx,yyyyyyyyyyyyyyyy,zzzzzzzzzzzzzzzz" ) assert ret == GPG_TEST_PUB_KEY gnupg_export_keys.assert_called_with( ["xxxxxxxxxxxxxxxx", "yyyyyyyyyyyyyyyy", "zzzzzzzzzzzzzzzz"], False, expect_passphrase=False, ) def test_export_key_with_passphrase_without_gpg_passphrase_in_pillar(gpghome): """ Test gpg.export_key with passphrase but without gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=None) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): with patch( "salt.modules.gpg.gnupg.GPG.export_keys", MagicMock(return_value=GPG_TEST_PUB_KEY), ) as gnupg_export_keys: with pytest.raises(SaltInvocationError): assert gpg.export_key("xxxxxxxxxxxxxxxx", use_passphrase=True) gnupg_export_keys.assert_not_called() def test_export_key_with_passphrase_with_gpg_passphrase_in_pillar(gpghome): """ Test gpg.export_key with passphrase and gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=GPG_TEST_KEY_PASSPHRASE) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): with patch( "salt.modules.gpg.gnupg.GPG.export_keys", MagicMock(return_value=GPG_TEST_PUB_KEY), ) as gnupg_export_keys: ret = gpg.export_key("xxxxxxxxxxxxxxxx", use_passphrase=True) assert ret == GPG_TEST_PUB_KEY gnupg_export_keys.assert_called_with( ["xxxxxxxxxxxxxxxx"], False, passphrase=GPG_TEST_KEY_PASSPHRASE, ) def test_create_key_without_passphrase(gpghome): """ Test gpg.create_key without a passphrase """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): ret = gpg.create_key() assert ret["res"] assert ret["fingerprint"] assert ret["message"] == "GPG key pair successfully generated." def test_create_key_with_passphrase_without_gpg_passphrase_in_pillar(gpghome): """ Test gpg.create_key with passphrase but without gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=None) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): ret = gpg.create_key(use_passphrase=True) assert not ret["res"] assert ret["message"] == "gpg_passphrase not available in pillar." def test_create_key_with_passphrase_with_gpg_passphrase_in_pillar(gpghome): """ Test gpg.create_key with passphrase and gpg_passphrase pillar """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } mock_opt = MagicMock(return_value="root") pillar_mock = MagicMock(return_value=GPG_TEST_KEY_PASSPHRASE) with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}), patch.dict( gpg.__salt__, {"pillar.get": pillar_mock} ): ret = gpg.create_key(use_passphrase=True) assert ret["res"] assert ret["fingerprint"] assert ret["message"] == "GPG key pair successfully generated." def test_search_keys(gpghome): """ Test gpg.search_keys """ _user_mock = { "shell": "/bin/bash", "workphone": "", "uid": 0, "passwd": "x", "roomnumber": "", "gid": 0, "groups": ["root"], "home": str(gpghome.path), "fullname": "root", "homephone": "", "name": "root", } _search_result = [ { "keyid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "uids": ["GPG Person <person@example.com>"], "expires": "", "sigs": [], "length": "1024", "algo": "17", "date": int(time.mktime(datetime.datetime(2004, 11, 13).timetuple())), "type": "pub", } ] _expected_result = [ { "uids": ["GPG Person <person@example.com>"], "created": "2004-11-13", "keyLength": "1024", "keyid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", } ] mock_opt = MagicMock(return_value="root") with patch.dict(gpg.__salt__, {"user.info": MagicMock(return_value=_user_mock)}): with patch.dict(gpg.__salt__, {"config.option": mock_opt}): with patch.object(gpg, "_search_keys", return_value=_search_result): ret = gpg.search_keys("person@example.com") assert ret == _expected_result def test_gpg_import_pub_key(gpghome): config_user = MagicMock(return_value="salt") user_info = MagicMock( return_value={"name": "salt", "home": str(gpghome.path), "uid": 1000} ) with patch.dict(gpg.__salt__, {"config.option": config_user}): with patch.dict(gpg.__salt__, {"user.info": user_info}): ret = gpg.import_key(None, str(gpghome.pub), "salt", str(gpghome.path)) assert ret["res"] is True def test_gpg_import_priv_key(gpghome): config_user = MagicMock(return_value="salt") user_info = MagicMock( return_value={"name": "salt", "home": str(gpghome.path), "uid": 1000} ) with patch.dict(gpg.__salt__, {"config.option": config_user}): with patch.dict(gpg.__salt__, {"user.info": user_info}): ret = gpg.import_key(None, str(gpghome.priv), "salt", str(gpghome.path)) assert ret["res"] is True def test_gpg_sign(gpghome): config_user = MagicMock(return_value="salt") user_info = MagicMock( return_value={"name": "salt", "home": str(gpghome.path), "uid": 1000} ) pillar_mock = MagicMock(return_value={"gpg_passphrase": GPG_TEST_KEY_PASSPHRASE}) with patch.dict(gpg.__salt__, {"config.option": config_user}): with patch.dict(gpg.__salt__, {"user.info": user_info}): with patch.dict(gpg.__salt__, {"pillar.get": pillar_mock}): ret = gpg.import_key(None, str(gpghome.priv), "salt", str(gpghome.path)) assert ret["res"] is True gpg_text_input = "The quick brown fox jumped over the lazy dog" gpg_sign_output = gpg.sign( config_user, GPG_TEST_KEY_ID, gpg_text_input, None, None, True, str(gpghome.path), ) assert gpg_sign_output is not None
import * as THREE from 'three'; // TextSprite class TextSprite { // @param {object} options The options object // @param {number} [options.x] The point on the x-axis // @param {number} [options.y] The point on the y-axis // @param {number} [options.z] The point on the z-axis // @param {string} [options.text] The text string // @param {string} [options.textAlign] Sets the text alignment: left|center|right // @param {string} [options.textBaseline] Sets the text baseline: top|middle|bottom // @param {number} [options.size] The actual font size // @param {number|string} [options.color] The color // @param {number} [options.opacity] The opacity of text [0,1] constructor(options) { let localOptions = options; localOptions = localOptions || {}; const {opacity = 0.6, size = 10} = localOptions; const textObject = new THREE.Object3D(); const textHeight = 100; let textWidth = 0; const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); context.font = `normal ${textHeight}px Arial`; const metrics = context.measureText(localOptions.text); textWidth = metrics.width; canvas.width = textWidth; canvas.height = textHeight; context.font = `normal ${textHeight}px Arial`; context.textAlign = 'center'; context.textBaseline = 'middle'; context.fillStyle = localOptions.color; context.fillText(localOptions.text, textWidth / 2, textHeight / 2); const texture = new THREE.Texture(canvas); texture.needsUpdate = true; texture.minFilter = THREE.LinearFilter; const material = new THREE.SpriteMaterial({ map: texture, transparent: true, opacity, }); textObject.textHeight = size; textObject.textWidth = (textWidth / textHeight) * textObject.textHeight; // Position X if (localOptions.textAlign === 'left') { textObject.position.x = localOptions.x + textObject.textWidth / 2; } else if (localOptions.textAlign === 'right') { textObject.position.x = localOptions.x - textObject.textWidth / 2; } else { textObject.position.x = localOptions.x || 0; } // Position Y if (localOptions.textBaseline === 'top') { textObject.position.y = localOptions.y - textObject.textHeight / 2; } else if (localOptions.textBaseline === 'bottom') { textObject.position.y = localOptions.y + textObject.textHeight / 2; } else { textObject.position.y = localOptions.y || 0; } // Position Z textObject.position.z = localOptions.z || 0; const sprite = new THREE.Sprite(material); sprite.scale.set((textWidth / textHeight) * size, size, 1); textObject.add(sprite); return textObject; } } export default TextSprite;
# Generated by Django 3.0.8 on 2021-03-07 14:45 from django.db import migrations import taggit.managers class Migration(migrations.Migration): dependencies = [ ('taggit', '0003_taggeditem_add_unique_index'), ('blog', '0005_auto_20210307_2323'), ] operations = [ migrations.AddField( model_name='post', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), ]
// Creating a XML Obj Parser instance const xotree = new XML.ObjTree(); // Converting a blog.xml from xml to js object const projectsContent = xotree.parseXML(read_from_file_sync("xml/projects/projects.xml")); fetchProjects(); function fetchProjects() { const numberFormatter = new Intl.NumberFormat('en-IN'); const projectsElement = document.getElementById("projects"); const projects = projectsContent.projects.project; for (let i = 0; i < projects.length; i++) { const project = projects[i]; const progressPercentage = parseInt((project.raised / project.goal) * 100); htmlElement = `<div class="col-lg-4 col-md-6 col-sm-6"> <div class="properties pb-30"> <div class="properties-card"> <div class="properties-img"> <a href="#"><img src="xml/projects/images/${project.image}" alt=""></a> <div class="single-skill"> <div class="bar-progress"> <div id="bar${project.id}" class="barfiller"> <div class="tipWrap"> <span class="tip"></span> </div> <span class="fill" data-percentage="${progressPercentage}"></span> </div> </div> </div> </div> <div class="wrap-wrapper"> <div class="properties-caption"> <h3><a href="#">${project.title}</a></h3> <p>${project.description}</p> </div> <div class="properties-footer d-flex justify-content-between align-items-center"> <div class="class-day"> <a href="donations.html" class="btn">Donate</a> </div> <div class="class-day"> <span class="color-font2">${numberFormatter.format(project.goal)}€</span> <p>Goal</p> </div> <div class="class-day"> <span class="color-font1">${numberFormatter.format(project.raised)}€</span> <p>Raised</p> </div> </div> </div> </div> </div> </div>`; projectsElement.insertAdjacentHTML("afterbegin", htmlElement); $("#bar" + project.id).barfiller(); } }
export const getCarIdSchema = { $id: "getCarIdSchema", "type": "object", "properties": { "_id": { "type": "string" }, "type": { "type": "string" }, "speed": { "type": "integer" }, "model": { "type": "string" }, "color": { "type": "string" }, "userID": { "type": "string" }, "__v": { "type": "integer" } }, "required": [ "_id", "type", "speed", "model", "color", "userID", "__v" ] };