Browse Source

Added code

Stephen Downward 2 years ago
parent
commit
1e77b8b623
14 changed files with 1804 additions and 2 deletions
  1. 4 0
      .gitignore
  2. 596 0
      LICENSE.md
  3. 14 2
      README.md
  4. 49 0
      client/css/style.css
  5. 69 0
      client/index.html
  6. 13 0
      client/js/angular-google-maps.min.js
  7. 4 0
      client/js/jquery-3.1.1.min.js
  8. 95 0
      client/js/main.js
  9. 107 0
      client/js/main_old.js
  10. 551 0
      client/js/moment.min.js
  11. 26 0
      client/js/ng-map.min.js
  12. 90 0
      manager.js
  13. 20 0
      package.json
  14. 166 0
      server.js

+ 4 - 0
.gitignore

@ -28,3 +28,7 @@ build/Release
28 28
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
29 29
node_modules
30 30
31
# Satellite data
32
3le.txt
33
ham.txt
34
names.json

+ 596 - 0
LICENSE.md

@ -0,0 +1,596 @@
1
GNU GENERAL PUBLIC LICENSE
2
==========================
3
4
Version 3, 29 June 2007
5
6
Copyright &copy; 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;
7
8
Everyone is permitted to copy and distribute verbatim copies of this license
9
document, but changing it is not allowed.
10
11
## Preamble
12
13
The GNU General Public License is a free, copyleft license for software and other
14
kinds of works.
15
16
The licenses for most software and other practical works are designed to take away
17
your freedom to share and change the works. By contrast, the GNU General Public
18
License is intended to guarantee your freedom to share and change all versions of a
19
program--to make sure it remains free software for all its users. We, the Free
20
Software Foundation, use the GNU General Public License for most of our software; it
21
applies also to any other work released this way by its authors. You can apply it to
22
your programs, too.
23
24
When we speak of free software, we are referring to freedom, not price. Our General
25
Public Licenses are designed to make sure that you have the freedom to distribute
26
copies of free software (and charge for them if you wish), that you receive source
27
code or can get it if you want it, that you can change the software or use pieces of
28
it in new free programs, and that you know you can do these things.
29
30
To protect your rights, we need to prevent others from denying you these rights or
31
asking you to surrender the rights. Therefore, you have certain responsibilities if
32
you distribute copies of the software, or if you modify it: responsibilities to
33
respect the freedom of others.
34
35
For example, if you distribute copies of such a program, whether gratis or for a fee,
36
you must pass on to the recipients the same freedoms that you received. You must make
37
sure that they, too, receive or can get the source code. And you must show them these
38
terms so they know their rights.
39
40
Developers that use the GNU GPL protect your rights with two steps: (1) assert
41
copyright on the software, and (2) offer you this License giving you legal permission
42
to copy, distribute and/or modify it.
43
44
For the developers' and authors' protection, the GPL clearly explains that there is
45
no warranty for this free software. For both users' and authors' sake, the GPL
46
requires that modified versions be marked as changed, so that their problems will not
47
be attributed erroneously to authors of previous versions.
48
49
Some devices are designed to deny users access to install or run modified versions of
50
the software inside them, although the manufacturer can do so. This is fundamentally
51
incompatible with the aim of protecting users' freedom to change the software. The
52
systematic pattern of such abuse occurs in the area of products for individuals to
53
use, which is precisely where it is most unacceptable. Therefore, we have designed
54
this version of the GPL to prohibit the practice for those products. If such problems
55
arise substantially in other domains, we stand ready to extend this provision to
56
those domains in future versions of the GPL, as needed to protect the freedom of
57
users.
58
59
Finally, every program is threatened constantly by software patents. States should
60
not allow patents to restrict development and use of software on general-purpose
61
computers, but in those that do, we wish to avoid the special danger that patents
62
applied to a free program could make it effectively proprietary. To prevent this, the
63
GPL assures that patents cannot be used to render the program non-free.
64
65
The precise terms and conditions for copying, distribution and modification follow.
66
67
## TERMS AND CONDITIONS
68
69
### 0. Definitions.
70
71
&ldquo;This License&rdquo; refers to version 3 of the GNU General Public License.
72
73
&ldquo;Copyright&rdquo; also means copyright-like laws that apply to other kinds of
74
works, such as semiconductor masks.
75
76
&ldquo;The Program&rdquo; refers to any copyrightable work licensed under this
77
License. Each licensee is addressed as &ldquo;you&rdquo;. &ldquo;Licensees&rdquo; and
78
&ldquo;recipients&rdquo; may be individuals or organizations.
79
80
To &ldquo;modify&rdquo; a work means to copy from or adapt all or part of the work in
81
a fashion requiring copyright permission, other than the making of an exact copy. The
82
resulting work is called a &ldquo;modified version&rdquo; of the earlier work or a
83
work &ldquo;based on&rdquo; the earlier work.
84
85
A &ldquo;covered work&rdquo; means either the unmodified Program or a work based on
86
the Program.
87
88
To &ldquo;propagate&rdquo; a work means to do anything with it that, without
89
permission, would make you directly or secondarily liable for infringement under
90
applicable copyright law, except executing it on a computer or modifying a private
91
copy. Propagation includes copying, distribution (with or without modification),
92
making available to the public, and in some countries other activities as well.
93
94
To &ldquo;convey&rdquo; a work means any kind of propagation that enables other
95
parties to make or receive copies. Mere interaction with a user through a computer
96
network, with no transfer of a copy, is not conveying.
97
98
An interactive user interface displays &ldquo;Appropriate Legal Notices&rdquo; to the
99
extent that it includes a convenient and prominently visible feature that (1)
100
displays an appropriate copyright notice, and (2) tells the user that there is no
101
warranty for the work (except to the extent that warranties are provided), that
102
licensees may convey the work under this License, and how to view a copy of this
103
License. If the interface presents a list of user commands or options, such as a
104
menu, a prominent item in the list meets this criterion.
105
106
### 1. Source Code.
107
108
The &ldquo;source code&rdquo; for a work means the preferred form of the work for
109
making modifications to it. &ldquo;Object code&rdquo; means any non-source form of a
110
work.
111
112
A &ldquo;Standard Interface&rdquo; means an interface that either is an official
113
standard defined by a recognized standards body, or, in the case of interfaces
114
specified for a particular programming language, one that is widely used among
115
developers working in that language.
116
117
The &ldquo;System Libraries&rdquo; of an executable work include anything, other than
118
the work as a whole, that (a) is included in the normal form of packaging a Major
119
Component, but which is not part of that Major Component, and (b) serves only to
120
enable use of the work with that Major Component, or to implement a Standard
121
Interface for which an implementation is available to the public in source code form.
122
A &ldquo;Major Component&rdquo;, in this context, means a major essential component
123
(kernel, window system, and so on) of the specific operating system (if any) on which
124
the executable work runs, or a compiler used to produce the work, or an object code
125
interpreter used to run it.
126
127
The &ldquo;Corresponding Source&rdquo; for a work in object code form means all the
128
source code needed to generate, install, and (for an executable work) run the object
129
code and to modify the work, including scripts to control those activities. However,
130
it does not include the work's System Libraries, or general-purpose tools or
131
generally available free programs which are used unmodified in performing those
132
activities but which are not part of the work. For example, Corresponding Source
133
includes interface definition files associated with source files for the work, and
134
the source code for shared libraries and dynamically linked subprograms that the work
135
is specifically designed to require, such as by intimate data communication or
136
control flow between those subprograms and other parts of the work.
137
138
The Corresponding Source need not include anything that users can regenerate
139
automatically from other parts of the Corresponding Source.
140
141
The Corresponding Source for a work in source code form is that same work.
142
143
### 2. Basic Permissions.
144
145
All rights granted under this License are granted for the term of copyright on the
146
Program, and are irrevocable provided the stated conditions are met. This License
147
explicitly affirms your unlimited permission to run the unmodified Program. The
148
output from running a covered work is covered by this License only if the output,
149
given its content, constitutes a covered work. This License acknowledges your rights
150
of fair use or other equivalent, as provided by copyright law.
151
152
You may make, run and propagate covered works that you do not convey, without
153
conditions so long as your license otherwise remains in force. You may convey covered
154
works to others for the sole purpose of having them make modifications exclusively
155
for you, or provide you with facilities for running those works, provided that you
156
comply with the terms of this License in conveying all material for which you do not
157
control copyright. Those thus making or running the covered works for you must do so
158
exclusively on your behalf, under your direction and control, on terms that prohibit
159
them from making any copies of your copyrighted material outside their relationship
160
with you.
161
162
Conveying under any other circumstances is permitted solely under the conditions
163
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
164
165
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
166
167
No covered work shall be deemed part of an effective technological measure under any
168
applicable law fulfilling obligations under article 11 of the WIPO copyright treaty
169
adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention
170
of such measures.
171
172
When you convey a covered work, you waive any legal power to forbid circumvention of
173
technological measures to the extent such circumvention is effected by exercising
174
rights under this License with respect to the covered work, and you disclaim any
175
intention to limit operation or modification of the work as a means of enforcing,
176
against the work's users, your or third parties' legal rights to forbid circumvention
177
of technological measures.
178
179
### 4. Conveying Verbatim Copies.
180
181
You may convey verbatim copies of the Program's source code as you receive it, in any
182
medium, provided that you conspicuously and appropriately publish on each copy an
183
appropriate copyright notice; keep intact all notices stating that this License and
184
any non-permissive terms added in accord with section 7 apply to the code; keep
185
intact all notices of the absence of any warranty; and give all recipients a copy of
186
this License along with the Program.
187
188
You may charge any price or no price for each copy that you convey, and you may offer
189
support or warranty protection for a fee.
190
191
### 5. Conveying Modified Source Versions.
192
193
You may convey a work based on the Program, or the modifications to produce it from
194
the Program, in the form of source code under the terms of section 4, provided that
195
you also meet all of these conditions:
196
197
* **a)** The work must carry prominent notices stating that you modified it, and giving a
198
relevant date.
199
* **b)** The work must carry prominent notices stating that it is released under this
200
License and any conditions added under section 7. This requirement modifies the
201
requirement in section 4 to &ldquo;keep intact all notices&rdquo;.
202
* **c)** You must license the entire work, as a whole, under this License to anyone who
203
comes into possession of a copy. This License will therefore apply, along with any
204
applicable section 7 additional terms, to the whole of the work, and all its parts,
205
regardless of how they are packaged. This License gives no permission to license the
206
work in any other way, but it does not invalidate such permission if you have
207
separately received it.
208
* **d)** If the work has interactive user interfaces, each must display Appropriate Legal
209
Notices; however, if the Program has interactive interfaces that do not display
210
Appropriate Legal Notices, your work need not make them do so.
211
212
A compilation of a covered work with other separate and independent works, which are
213
not by their nature extensions of the covered work, and which are not combined with
214
it such as to form a larger program, in or on a volume of a storage or distribution
215
medium, is called an &ldquo;aggregate&rdquo; if the compilation and its resulting
216
copyright are not used to limit the access or legal rights of the compilation's users
217
beyond what the individual works permit. Inclusion of a covered work in an aggregate
218
does not cause this License to apply to the other parts of the aggregate.
219
220
### 6. Conveying Non-Source Forms.
221
222
You may convey a covered work in object code form under the terms of sections 4 and
223
5, provided that you also convey the machine-readable Corresponding Source under the
224
terms of this License, in one of these ways:
225
226
* **a)** Convey the object code in, or embodied in, a physical product (including a
227
physical distribution medium), accompanied by the Corresponding Source fixed on a
228
durable physical medium customarily used for software interchange.
229
* **b)** Convey the object code in, or embodied in, a physical product (including a
230
physical distribution medium), accompanied by a written offer, valid for at least
231
three years and valid for as long as you offer spare parts or customer support for
232
that product model, to give anyone who possesses the object code either (1) a copy of
233
the Corresponding Source for all the software in the product that is covered by this
234
License, on a durable physical medium customarily used for software interchange, for
235
a price no more than your reasonable cost of physically performing this conveying of
236
source, or (2) access to copy the Corresponding Source from a network server at no
237
charge.
238
* **c)** Convey individual copies of the object code with a copy of the written offer to
239
provide the Corresponding Source. This alternative is allowed only occasionally and
240
noncommercially, and only if you received the object code with such an offer, in
241
accord with subsection 6b.
242
* **d)** Convey the object code by offering access from a designated place (gratis or for
243
a charge), and offer equivalent access to the Corresponding Source in the same way
244
through the same place at no further charge. You need not require recipients to copy
245
the Corresponding Source along with the object code. If the place to copy the object
246
code is a network server, the Corresponding Source may be on a different server
247
(operated by you or a third party) that supports equivalent copying facilities,
248
provided you maintain clear directions next to the object code saying where to find
249
the Corresponding Source. Regardless of what server hosts the Corresponding Source,
250
you remain obligated to ensure that it is available for as long as needed to satisfy
251
these requirements.
252
* **e)** Convey the object code using peer-to-peer transmission, provided you inform
253
other peers where the object code and Corresponding Source of the work are being
254
offered to the general public at no charge under subsection 6d.
255
256
A separable portion of the object code, whose source code is excluded from the
257
Corresponding Source as a System Library, need not be included in conveying the
258
object code work.
259
260
A &ldquo;User Product&rdquo; is either (1) a &ldquo;consumer product&rdquo;, which
261
means any tangible personal property which is normally used for personal, family, or
262
household purposes, or (2) anything designed or sold for incorporation into a
263
dwelling. In determining whether a product is a consumer product, doubtful cases
264
shall be resolved in favor of coverage. For a particular product received by a
265
particular user, &ldquo;normally used&rdquo; refers to a typical or common use of
266
that class of product, regardless of the status of the particular user or of the way
267
in which the particular user actually uses, or expects or is expected to use, the
268
product. A product is a consumer product regardless of whether the product has
269
substantial commercial, industrial or non-consumer uses, unless such uses represent
270
the only significant mode of use of the product.
271
272
&ldquo;Installation Information&rdquo; for a User Product means any methods,
273
procedures, authorization keys, or other information required to install and execute
274
modified versions of a covered work in that User Product from a modified version of
275
its Corresponding Source. The information must suffice to ensure that the continued
276
functioning of the modified object code is in no case prevented or interfered with
277
solely because modification has been made.
278
279
If you convey an object code work under this section in, or with, or specifically for
280
use in, a User Product, and the conveying occurs as part of a transaction in which
281
the right of possession and use of the User Product is transferred to the recipient
282
in perpetuity or for a fixed term (regardless of how the transaction is
283
characterized), the Corresponding Source conveyed under this section must be
284
accompanied by the Installation Information. But this requirement does not apply if
285
neither you nor any third party retains the ability to install modified object code
286
on the User Product (for example, the work has been installed in ROM).
287
288
The requirement to provide Installation Information does not include a requirement to
289
continue to provide support service, warranty, or updates for a work that has been
290
modified or installed by the recipient, or for the User Product in which it has been
291
modified or installed. Access to a network may be denied when the modification itself
292
materially and adversely affects the operation of the network or violates the rules
293
and protocols for communication across the network.
294
295
Corresponding Source conveyed, and Installation Information provided, in accord with
296
this section must be in a format that is publicly documented (and with an
297
implementation available to the public in source code form), and must require no
298
special password or key for unpacking, reading or copying.
299
300
### 7. Additional Terms.
301
302
&ldquo;Additional permissions&rdquo; are terms that supplement the terms of this
303
License by making exceptions from one or more of its conditions. Additional
304
permissions that are applicable to the entire Program shall be treated as though they
305
were included in this License, to the extent that they are valid under applicable
306
law. If additional permissions apply only to part of the Program, that part may be
307
used separately under those permissions, but the entire Program remains governed by
308
this License without regard to the additional permissions.
309
310
When you convey a copy of a covered work, you may at your option remove any
311
additional permissions from that copy, or from any part of it. (Additional
312
permissions may be written to require their own removal in certain cases when you
313
modify the work.) You may place additional permissions on material, added by you to a
314
covered work, for which you have or can give appropriate copyright permission.
315
316
Notwithstanding any other provision of this License, for material you add to a
317
covered work, you may (if authorized by the copyright holders of that material)
318
supplement the terms of this License with terms:
319
320
* **a)** Disclaiming warranty or limiting liability differently from the terms of
321
sections 15 and 16 of this License; or
322
* **b)** Requiring preservation of specified reasonable legal notices or author
323
attributions in that material or in the Appropriate Legal Notices displayed by works
324
containing it; or
325
* **c)** Prohibiting misrepresentation of the origin of that material, or requiring that
326
modified versions of such material be marked in reasonable ways as different from the
327
original version; or
328
* **d)** Limiting the use for publicity purposes of names of licensors or authors of the
329
material; or
330
* **e)** Declining to grant rights under trademark law for use of some trade names,
331
trademarks, or service marks; or
332
* **f)** Requiring indemnification of licensors and authors of that material by anyone
333
who conveys the material (or modified versions of it) with contractual assumptions of
334
liability to the recipient, for any liability that these contractual assumptions
335
directly impose on those licensors and authors.
336
337
All other non-permissive additional terms are considered &ldquo;further
338
restrictions&rdquo; within the meaning of section 10. If the Program as you received
339
it, or any part of it, contains a notice stating that it is governed by this License
340
along with a term that is a further restriction, you may remove that term. If a
341
license document contains a further restriction but permits relicensing or conveying
342
under this License, you may add to a covered work material governed by the terms of
343
that license document, provided that the further restriction does not survive such
344
relicensing or conveying.
345
346
If you add terms to a covered work in accord with this section, you must place, in
347
the relevant source files, a statement of the additional terms that apply to those
348
files, or a notice indicating where to find the applicable terms.
349
350
Additional terms, permissive or non-permissive, may be stated in the form of a
351
separately written license, or stated as exceptions; the above requirements apply
352
either way.
353
354
### 8. Termination.
355
356
You may not propagate or modify a covered work except as expressly provided under
357
this License. Any attempt otherwise to propagate or modify it is void, and will
358
automatically terminate your rights under this License (including any patent licenses
359
granted under the third paragraph of section 11).
360
361
However, if you cease all violation of this License, then your license from a
362
particular copyright holder is reinstated (a) provisionally, unless and until the
363
copyright holder explicitly and finally terminates your license, and (b) permanently,
364
if the copyright holder fails to notify you of the violation by some reasonable means
365
prior to 60 days after the cessation.
366
367
Moreover, your license from a particular copyright holder is reinstated permanently
368
if the copyright holder notifies you of the violation by some reasonable means, this
369
is the first time you have received notice of violation of this License (for any
370
work) from that copyright holder, and you cure the violation prior to 30 days after
371
your receipt of the notice.
372
373
Termination of your rights under this section does not terminate the licenses of
374
parties who have received copies or rights from you under this License. If your
375
rights have been terminated and not permanently reinstated, you do not qualify to
376
receive new licenses for the same material under section 10.
377
378
### 9. Acceptance Not Required for Having Copies.
379
380
You are not required to accept this License in order to receive or run a copy of the
381
Program. Ancillary propagation of a covered work occurring solely as a consequence of
382
using peer-to-peer transmission to receive a copy likewise does not require
383
acceptance. However, nothing other than this License grants you permission to
384
propagate or modify any covered work. These actions infringe copyright if you do not
385
accept this License. Therefore, by modifying or propagating a covered work, you
386
indicate your acceptance of this License to do so.
387
388
### 10. Automatic Licensing of Downstream Recipients.
389
390
Each time you convey a covered work, the recipient automatically receives a license
391
from the original licensors, to run, modify and propagate that work, subject to this
392
License. You are not responsible for enforcing compliance by third parties with this
393
License.
394
395
An &ldquo;entity transaction&rdquo; is a transaction transferring control of an
396
organization, or substantially all assets of one, or subdividing an organization, or
397
merging organizations. If propagation of a covered work results from an entity
398
transaction, each party to that transaction who receives a copy of the work also
399
receives whatever licenses to the work the party's predecessor in interest had or
400
could give under the previous paragraph, plus a right to possession of the
401
Corresponding Source of the work from the predecessor in interest, if the predecessor
402
has it or can get it with reasonable efforts.
403
404
You may not impose any further restrictions on the exercise of the rights granted or
405
affirmed under this License. For example, you may not impose a license fee, royalty,
406
or other charge for exercise of rights granted under this License, and you may not
407
initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging
408
that any patent claim is infringed by making, using, selling, offering for sale, or
409
importing the Program or any portion of it.
410
411
### 11. Patents.
412
413
A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under this
414
License of the Program or a work on which the Program is based. The work thus
415
licensed is called the contributor's &ldquo;contributor version&rdquo;.
416
417
A contributor's &ldquo;essential patent claims&rdquo; are all patent claims owned or
418
controlled by the contributor, whether already acquired or hereafter acquired, that
419
would be infringed by some manner, permitted by this License, of making, using, or
420
selling its contributor version, but do not include claims that would be infringed
421
only as a consequence of further modification of the contributor version. For
422
purposes of this definition, &ldquo;control&rdquo; includes the right to grant patent
423
sublicenses in a manner consistent with the requirements of this License.
424
425
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license
426
under the contributor's essential patent claims, to make, use, sell, offer for sale,
427
import and otherwise run, modify and propagate the contents of its contributor
428
version.
429
430
In the following three paragraphs, a &ldquo;patent license&rdquo; is any express
431
agreement or commitment, however denominated, not to enforce a patent (such as an
432
express permission to practice a patent or covenant not to sue for patent
433
infringement). To &ldquo;grant&rdquo; such a patent license to a party means to make
434
such an agreement or commitment not to enforce a patent against the party.
435
436
If you convey a covered work, knowingly relying on a patent license, and the
437
Corresponding Source of the work is not available for anyone to copy, free of charge
438
and under the terms of this License, through a publicly available network server or
439
other readily accessible means, then you must either (1) cause the Corresponding
440
Source to be so available, or (2) arrange to deprive yourself of the benefit of the
441
patent license for this particular work, or (3) arrange, in a manner consistent with
442
the requirements of this License, to extend the patent license to downstream
443
recipients. &ldquo;Knowingly relying&rdquo; means you have actual knowledge that, but
444
for the patent license, your conveying the covered work in a country, or your
445
recipient's use of the covered work in a country, would infringe one or more
446
identifiable patents in that country that you have reason to believe are valid.
447
448
If, pursuant to or in connection with a single transaction or arrangement, you
449
convey, or propagate by procuring conveyance of, a covered work, and grant a patent
450
license to some of the parties receiving the covered work authorizing them to use,
451
propagate, modify or convey a specific copy of the covered work, then the patent
452
license you grant is automatically extended to all recipients of the covered work and
453
works based on it.
454
455
A patent license is &ldquo;discriminatory&rdquo; if it does not include within the
456
scope of its coverage, prohibits the exercise of, or is conditioned on the
457
non-exercise of one or more of the rights that are specifically granted under this
458
License. You may not convey a covered work if you are a party to an arrangement with
459
a third party that is in the business of distributing software, under which you make
460
payment to the third party based on the extent of your activity of conveying the
461
work, and under which the third party grants, to any of the parties who would receive
462
the covered work from you, a discriminatory patent license (a) in connection with
463
copies of the covered work conveyed by you (or copies made from those copies), or (b)
464
primarily for and in connection with specific products or compilations that contain
465
the covered work, unless you entered into that arrangement, or that patent license
466
was granted, prior to 28 March 2007.
467
468
Nothing in this License shall be construed as excluding or limiting any implied
469
license or other defenses to infringement that may otherwise be available to you
470
under applicable patent law.
471
472
### 12. No Surrender of Others' Freedom.
473
474
If conditions are imposed on you (whether by court order, agreement or otherwise)
475
that contradict the conditions of this License, they do not excuse you from the
476
conditions of this License. If you cannot convey a covered work so as to satisfy
477
simultaneously your obligations under this License and any other pertinent
478
obligations, then as a consequence you may not convey it at all. For example, if you
479
agree to terms that obligate you to collect a royalty for further conveying from
480
those to whom you convey the Program, the only way you could satisfy both those terms
481
and this License would be to refrain entirely from conveying the Program.
482
483
### 13. Use with the GNU Affero General Public License.
484
485
Notwithstanding any other provision of this License, you have permission to link or
486
combine any covered work with a work licensed under version 3 of the GNU Affero
487
General Public License into a single combined work, and to convey the resulting work.
488
The terms of this License will continue to apply to the part which is the covered
489
work, but the special requirements of the GNU Affero General Public License, section
490
13, concerning interaction through a network will apply to the combination as such.
491
492
### 14. Revised Versions of this License.
493
494
The Free Software Foundation may publish revised and/or new versions of the GNU
495
General Public License from time to time. Such new versions will be similar in spirit
496
to the present version, but may differ in detail to address new problems or concerns.
497
498
Each version is given a distinguishing version number. If the Program specifies that
499
a certain numbered version of the GNU General Public License &ldquo;or any later
500
version&rdquo; applies to it, you have the option of following the terms and
501
conditions either of that numbered version or of any later version published by the
502
Free Software Foundation. If the Program does not specify a version number of the GNU
503
General Public License, you may choose any version ever published by the Free
504
Software Foundation.
505
506
If the Program specifies that a proxy can decide which future versions of the GNU
507
General Public License can be used, that proxy's public statement of acceptance of a
508
version permanently authorizes you to choose that version for the Program.
509
510
Later license versions may give you additional or different permissions. However, no
511
additional obligations are imposed on any author or copyright holder as a result of
512
your choosing to follow a later version.
513
514
### 15. Disclaimer of Warranty.
515
516
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
517
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
518
PROVIDE THE PROGRAM &ldquo;AS IS&rdquo; WITHOUT WARRANTY OF ANY KIND, EITHER
519
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
520
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
521
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
522
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
523
524
### 16. Limitation of Liability.
525
526
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
527
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
528
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
529
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
530
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE
531
OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
532
WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
533
POSSIBILITY OF SUCH DAMAGES.
534
535
### 17. Interpretation of Sections 15 and 16.
536
537
If the disclaimer of warranty and limitation of liability provided above cannot be
538
given local legal effect according to their terms, reviewing courts shall apply local
539
law that most closely approximates an absolute waiver of all civil liability in
540
connection with the Program, unless a warranty or assumption of liability accompanies
541
a copy of the Program in return for a fee.
542
543
END OF TERMS AND CONDITIONS
544
545
## How to Apply These Terms to Your New Programs
546
547
If you develop a new program, and you want it to be of the greatest possible use to
548
the public, the best way to achieve this is to make it free software which everyone
549
can redistribute and change under these terms.
550
551
To do so, attach the following notices to the program. It is safest to attach them
552
to the start of each source file to most effectively state the exclusion of warranty;
553
and each file should have at least the &ldquo;copyright&rdquo; line and a pointer to
554
where the full notice is found.
555
556
    <one line to give the program's name and a brief idea of what it does.>
557
    Copyright (C) <year>  <name of author>
558
559
    This program is free software: you can redistribute it and/or modify
560
    it under the terms of the GNU General Public License as published by
561
    the Free Software Foundation, either version 3 of the License, or
562
    (at your option) any later version.
563
564
    This program is distributed in the hope that it will be useful,
565
    but WITHOUT ANY WARRANTY; without even the implied warranty of
566
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
567
    GNU General Public License for more details.
568
569
    You should have received a copy of the GNU General Public License
570
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
571
572
Also add information on how to contact you by electronic and paper mail.
573
574
If the program does terminal interaction, make it output a short notice like this
575
when it starts in an interactive mode:
576
577
    <program>  Copyright (C) <year>  <name of author>
578
    This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
579
    This is free software, and you are welcome to redistribute it
580
    under certain conditions; type 'show c' for details.
581
582
The hypothetical commands 'show w' and 'show c' should show the appropriate parts of
583
the General Public License. Of course, your program's commands might be different;
584
for a GUI interface, you would use an &ldquo;about box&rdquo;.
585
586
You should also get your employer (if you work as a programmer) or school, if any, to
587
sign a &ldquo;copyright disclaimer&rdquo; for the program, if necessary. For more
588
information on this, and how to apply and follow the GNU GPL, see
589
&lt;<http://www.gnu.org/licenses/>&gt;.
590
591
The GNU General Public License does not permit incorporating your program into
592
proprietary programs. If your program is a subroutine library, you may consider it
593
more useful to permit linking proprietary applications with the library. If this is
594
what you want to do, use the GNU Lesser General Public License instead of this
595
License. But first, please read
596
&lt;<http://www.gnu.org/philosophy/why-not-lgpl.html>&gt;.

+ 14 - 2
README.md

@ -1,3 +1,15 @@
1
# multipoint-satellite-tracker
1
# Multipoint Satellite Tracker
2 2
3
Allows viable satellites to be found given multiple points on the Earth
3
This is a piece of software I wrote to allow someone to find passes of satellites based on more than one position. It allows a different minimum AoA for each point on the Earth, based on their terrain. Elevation above sea level is found through Google's API, but will always remain positive, to account for boats in the ocean.
4
5
Check it out here: [ham.scd31.com](https://ham.scd31.com)
6
7
## Screenshots
8
9
## Information
10
11
The server runs on Node.JS, using cluster to scale vertically. At the heart of the software is the calcSatellite function, which is what actually determines viable satellites. It's terribly, terribly unoptimized. For each satellite, it advances by 30 seconds at a time, up to a week in the future. This will need to be rewritten soon, as it takes upwards of 5 seconds(!) to run. I intend to estimate how long in the future the satellite will pass by based on its current orbit and elevation, and then advance that far into the future. I may also move the function to the client, which would significantly free up server resources.
12
13
## License
14
15
This code is distrubuted under the GNU GPL v3 license. See the [LICENSE.md](LICENSE.md) file.

+ 49 - 0
client/css/style.css

@ -0,0 +1,49 @@
1
#container {
2
  display: flex;
3
}
4
5
#controls {
6
  float: left;
7
  overflow-y: scroll;
8
  height: 100%;
9
}
10
11
#map {
12
  width: calc(100% - 450px);
13
  width: -moz-calc(100% - 450px);
14
  width: calc(100% - 450px);
15
  min-width: 250px;
16
  height: 100%;
17
  background-color: grey;
18
  flex-grow: 1;
19
}
20
21
#footer {
22
}
23
24
input[type=number] {
25
  width: 40px;
26
}
27
28
table tr td {
29
  padding: 3px;
30
}
31
32
.glyphicon.spinning {
33
    animation: spin 1s infinite linear;
34
    -webkit-animation: spin2 1s infinite linear;
35
}
36
37
@keyframes spin {
38
    from { transform: scale(1) rotate(0deg);}
39
    to { transform: scale(1) rotate(360deg);}
40
}
41
42
@-webkit-keyframes spin2 {
43
    from { -webkit-transform: rotate(0deg);}
44
    to { -webkit-transform: rotate(360deg);}
45
}
46
47
.glyphicon-left {
48
    margin-right: 7px;
49
}

+ 69 - 0
client/index.html

@ -0,0 +1,69 @@
1
<html ng-app="satTrackApp">
2
  <head>
3
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
4
    <link rel="stylesheet" type="text/css" href="/client/css/style.css">
5
    <script type="text/javascript" src="/client/js/jquery-3.1.1.min.js"></script>
6
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB3FKjZo6Fe6Lg--EU1Ci7V4rHIiU9Igb4"></script>
7
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
8
    <script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
9
    <script src="/client/js/ng-map.min.js"></script>
10
    <script src="/client/js/moment.min.js"></script>
11
    <script type="text/javascript" src="/client/js/main.js"></script>
12
  </head>
13
  <body>
14
    <div id="container" ng-controller="satTrack-ctrl">
15
      <div id="controls">
16
        <table border="1" ng-show="places.length > 0">
17
          <tr>
18
            <td><b>ID</b></td>
19
            <td><b>Latitude</b></td>
20
            <td><b>Longitude</b></td>
21
            <td><b>Minimum AoA</b></td>
22
            <td></td>
23
          </tr>
24
          <tr ng-repeat="point in places">
25
            <td>{{$index + 1}}</td>
26
            <td>{{point.marker.position.lat().toFixed(6)}}</td>
27
            <td>{{point.marker.position.lng().toFixed(6)}}</td>
28
            <td><input type="number" min="0" max="90" ng-model="point.angle"> deg</td>
29
            <td><button type="button" class="btn btn-danger" ng-click="removePoint($index)">Remove</button></td>
30
          </tr>
31
        </table>
32
        <div style="margin: 6px">Click on the map to add a point</div><BR><BR>
33
        <center>
34
          <button type="button" class="btn btn-success" ng-disabled="places.length == 0" ng-click="getPasses()">Calculate Passes</button>
35
          <span class='glyphicon-left glyphicon glyphicon-refresh spinning' ng-show='isGettingPasses'></span>
36
        </center><BR>
37
        <table border="1">
38
          <tr>
39
            <td><b>Date</b></td>
40
            <td><b>Sat name</b></td>
41
            <td><b>Start time</b></td>
42
            <td><b>Max AoAs</b></td>
43
            <td><b>End time</b></td>
44
            <td><b>Total time of contact<b></td>
45
          </tr>
46
          <tr ng-repeat="pass in passes">
47
            <td>{{getDate(pass.time_start)}}</td>
48
            <td>{{pass.name}}</td>
49
            <td>{{getTime(pass.time_start)}}</td>
50
            <td style="white-space: nowrap;"><div ng-repeat="stat in pass.pointStats">
51
              Point {{$index + 1}}: {{stat.maxElv.toFixed(0)}} deg @ {{getTime(stat.timeMaxElv)}}
52
            </div></td>
53
            <td>{{getTime(pass.time_end)}}</td>
54
            <td>{{getDifferenceInMinutes(pass.time_end, pass.time_start)}}</td>
55
          </tr>
56
        </table><br>
57
        <div id="footer">
58
          <center>
59
            Developed by Stephen Downward, callsign VA1QLE.<br>
60
            <a href="https://git.scd31.com/laptopdude90/multipoint-satellite-tracker">Git repository</a>
61
          </center>
62
        </div>
63
      </div>
64
      <div id="map">
65
        <ng-map center="39.82, -77.01" zoom="4"></ng-map>
66
      </div>
67
    </div>
68
  </body>
69
</html>

+ 13 - 0
client/js/angular-google-maps.min.js

@ -0,0 +1,13 @@
1
/*! angular-google-maps 2.4.1 2017-01-05
2
 *  AngularJS directives for Google Maps
3
 *  git: https://github.com/angular-ui/angular-google-maps.git
4
 */
5
6
!function(a,b,c,d){"use strict";(function(){b.module("uiGmapgoogle-maps.providers",["nemLogging"]),b.module("uiGmapgoogle-maps.wrapped",[]),b.module("uiGmapgoogle-maps.extensions",["uiGmapgoogle-maps.wrapped","uiGmapgoogle-maps.providers"]),b.module("uiGmapgoogle-maps.directives.api.utils",["uiGmapgoogle-maps.extensions"]),b.module("uiGmapgoogle-maps.directives.api.managers",[]),b.module("uiGmapgoogle-maps.directives.api.options",["uiGmapgoogle-maps.directives.api.utils"]),b.module("uiGmapgoogle-maps.directives.api.options.builders",[]),b.module("uiGmapgoogle-maps.directives.api.models.child",["uiGmapgoogle-maps.directives.api.utils","uiGmapgoogle-maps.directives.api.options","uiGmapgoogle-maps.directives.api.options.builders"]),b.module("uiGmapgoogle-maps.directives.api.models.parent",["uiGmapgoogle-maps.directives.api.managers","uiGmapgoogle-maps.directives.api.models.child","uiGmapgoogle-maps.providers"]),b.module("uiGmapgoogle-maps.directives.api",["uiGmapgoogle-maps.directives.api.models.parent"]),b.module("uiGmapgoogle-maps",["uiGmapgoogle-maps.directives.api","uiGmapgoogle-maps.providers"])}).call(this),function(){b.module("uiGmapgoogle-maps.providers").factory("uiGmapMapScriptLoader",["$q","uiGmapuuid",function(d,e){var f,g,h,i,j;return i=void 0,j=void 0,f=function(a){return a.china?"http://maps.google.cn/maps/api/js?":"auto"===a.transport?"//maps.googleapis.com/maps/api/js?":a.transport+"://maps.googleapis.com/maps/api/js?"},g=function(a){var b,d,g,h;return b=["transport","isGoogleMapsForWork","china","preventLoad"],a.isGoogleMapsForWork&&b.push("key"),d=c.map(c.omit(a,b),function(a,b){return b+"="+a}),i&&(h=document.getElementById(i),h.parentNode.removeChild(h)),d=d.join("&"),g=document.createElement("script"),g.id=i="ui_gmap_map_load_"+e.generate(),g.type="text/javascript",g.src=f(a)+d,document.head.appendChild(g)},h=function(){return b.isDefined(a.google)&&b.isDefined(a.google.maps)},{load:function(b){var c,e;return c=d.defer(),h()?(c.resolve(a.google.maps),c.promise):(e=b.callback="onGoogleMapsReady"+Math.round(1e3*Math.random()),a[e]=function(){a[e]=null,c.resolve(a.google.maps)},a.navigator.connection&&a.Connection&&a.navigator.connection.type===a.Connection.NONE&&!b.preventLoad?document.addEventListener("online",function(){if(!h())return g(b)}):b.preventLoad||g(b),j=b,j.randomizedFunctionName=e,c.promise)},manualLoad:function(){var b;return b=j,h()?a[b.randomizedFunctionName]?a[b.randomizedFunctionName]():void 0:g(b)}}}]).provider("uiGmapGoogleMapApi",function(){return this.options={transport:"https",isGoogleMapsForWork:!1,china:!1,v:"3",libraries:"",language:"en",preventLoad:!1},this.configure=function(a){b.extend(this.options,a)},this.$get=["uiGmapMapScriptLoader",function(a){return function(b){return b.load(a.options)}}(this)],this}).service("uiGmapGoogleMapApiManualLoader",["uiGmapMapScriptLoader",function(a){return{load:function(){a.manualLoad()}}}])}.call(this),function(){var d=function(a,b){return function(){return a.apply(b,arguments)}},e=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},f={}.hasOwnProperty;b.module("uiGmapgoogle-maps.extensions").service("uiGmapExtendGWin",function(){return{init:c.once(function(){var b;if(google||("undefined"!=typeof google&&null!==google?google.maps:void 0)||null!=google.maps.InfoWindow)return google.maps.InfoWindow.prototype._open=google.maps.InfoWindow.prototype.open,google.maps.InfoWindow.prototype._close=google.maps.InfoWindow.prototype.close,google.maps.InfoWindow.prototype._isOpen=!1,google.maps.InfoWindow.prototype.open=function(a,b,c){null==c&&(this._isOpen=!0,this._open(a,b,!0))},google.maps.InfoWindow.prototype.close=function(a){null==a&&(this._isOpen=!1,this._close(!0))},google.maps.InfoWindow.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},a.InfoBox&&(a.InfoBox.prototype._open=a.InfoBox.prototype.open,a.InfoBox.prototype._close=a.InfoBox.prototype.close,a.InfoBox.prototype._isOpen=!1,a.InfoBox.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},a.InfoBox.prototype.close=function(){this._isOpen=!1,this._close()},a.InfoBox.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},b=function(b){function f(b){this.getOrigCloseBoxImg_=d(this.getOrigCloseBoxImg_,this),this.getCloseBoxDiv_=d(this.getCloseBoxDiv_,this);var e;e=new a.InfoBox(b),c.extend(this,e),null!=b.closeBoxDiv&&(this.closeBoxDiv_=b.closeBoxDiv)}return e(f,b),f.prototype.getCloseBoxDiv_=function(){return this.closeBoxDiv_},f.prototype.getCloseBoxImg_=function(){var a,b;return a=this.getCloseBoxDiv_(),b=this.getOrigCloseBoxImg_(),a||b},f.prototype.getOrigCloseBoxImg_=function(){var a;return a="",""!==this.closeBoxURL_&&(a="<img",a+=" src='"+this.closeBoxURL_+"'",a+=" align=right",a+=" style='",a+=" position: relative;",a+=" cursor: pointer;",a+=" margin: "+this.closeBoxMargin_+";",a+="'>"),a},f}(a.InfoBox),a.uiGmapInfoBox=b),a.MarkerLabel_?a.MarkerLabel_.prototype.setContent=function(){var a;a=this.marker_.get("labelContent"),a&&!c.isEqual(this.oldContent,a)&&("undefined"==typeof(null!=a?a.nodeType:void 0)?(this.labelDiv_.innerHTML=a,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML,this.oldContent=a):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(a),a=a.cloneNode(!0),this.labelDiv_.innerHTML="",this.eventDiv_.appendChild(a),this.oldContent=a))}:void 0})}})}.call(this),function(){b.module("uiGmapgoogle-maps.extensions").service("uiGmapLodash",function(){var a,b,d,e,f,g,h,i;return g=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,f=/\\(\\)?/g,d=function(a){var b,d,e;if(d=a.missingName,e=a.swapName,b=a.isProto,null==c[d]&&(c[d]=c[e],b))return c.prototype[d]=c[e]},[{missingName:"contains",swapName:"includes",isProto:!0},{missingName:"includes",swapName:"contains",isProto:!0},{missingName:"object",swapName:"zipObject"},{missingName:"zipObject",swapName:"object"},{missingName:"all",swapName:"every"},{missingName:"every",swapName:"all"},{missingName:"any",swapName:"some"},{missingName:"some",swapName:"any"},{missingName:"first",swapName:"head"},{missingName:"head",swapName:"first"}].forEach(function(a){return d(a)}),null==c.get&&(h=function(a){return c.isObject(a)?a:Object(a)},b=function(a){return null===a?"":a+""},i=function(a){var d;return c.isArray(a)?a:(d=[],b(a).replace(g,function(a,b,c,e){d.push(c?e.replace(f,"$1"):b||a)}),d)},a=function(a,b,d){var e,f;if(null!==a){void 0!==d&&d in h(a)&&(b=[d]),e=0,f=b.length;for(;!c.isUndefined(a)&&e<f;)a=a[b[e++]];return e&&e===f?a:void 0}},e=function(b,c,d){var e;return e=null===b?void 0:a(b,i(c),c+""),void 0===e?d:e},c.get=e),this.intersectionObjects=function(a,b,d){var e;return null==d&&(d=void 0),e=c.map(a,function(a){return c.find(b,function(b){return null!=d?d(a,b):c.isEqual(a,b)})}),c.filter(e,function(a){return null!=a})},this.containsObject=c.includeObject=function(a,b,d){return null==d&&(d=void 0),null!==a&&c.some(a,function(a){return null!=d?d(a,b):c.isEqual(a,b)})},this.differenceObjects=function(a,b,d){return null==d&&(d=void 0),c.filter(a,function(a){return function(c){return!a.containsObject(b,c,d)}}(this))},this.withoutObjects=this.differenceObjects,this.indexOfObject=function(a,b,d,e){var f,g;if(null==a)return-1;if(f=0,g=a.length,e){if("number"!=typeof e)return f=c.sortedIndex(a,b),a[f]===b?f:-1;f=e<0?Math.max(0,g+e):e}for(;f<g;){if(null!=d){if(d(a[f],b))return f}else if(c.isEqual(a[f],b))return f;f++}return-1},this.isNullOrUndefined=function(a){return c.isNull(a||c.isUndefined(a))},this})}.call(this),function(){b.module("uiGmapgoogle-maps.extensions").factory("uiGmapString",function(){return function(a){return this.contains=function(b,c){return a.indexOf(b,c)!==-1},this}})}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmap_sync",[function(){return{fakePromise:function(){var a;return a=void 0,{then:function(b){return a=b},resolve:function(){return a.apply(void 0,arguments)}}}}}]).service("uiGmap_async",["$timeout","uiGmapPromise","uiGmapLogger","$q","uiGmapDataStructures","uiGmapGmapUtil",function(a,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;return A=d.promiseTypes,t=d.isInProgress,z=d.promiseStatus,i=d.ExposedPromise,k=d.SniffedPromise,u=function(a,b){var c;return c=a.promise(),c.promiseType=a.promiseType,c.$$state&&e.debug("promiseType: "+c.promiseType+", state: "+z(c.$$state.status)),c.cancelCb=b,c},p=function(a,b){return a.promiseType===A.create&&b.promiseType!==A.delete&&b.promiseType!==A.init&&(e.debug("lastPromise.promiseType "+b.promiseType+", newPromiseType: "+a.promiseType+", SKIPPED MUST COME AFTER DELETE ONLY"),!0)},y=function(a,b,d){var f;if(b.promiseType===A.delete&&d.promiseType!==A.delete&&null!=d.cancelCb&&c.isFunction(d.cancelCb)&&t(d)&&(e.debug("promiseType: "+b.promiseType+", CANCELING LAST PROMISE type: "+d.promiseType),d.cancelCb("cancel safe"),f=a.peek(),null!=f&&t(f)))return f.hasOwnProperty("cancelCb")&&c.isFunction(f.cancelCb)?(e.debug("promiseType: "+f.promiseType+", CANCELING FIRST PROMISE type: "+f.promiseType),f.cancelCb("cancel safe")):e.warn("first promise was not cancelable")},j=function(a,b,d){var e,f;if(a.existingPieces){if(e=c.last(a.existingPieces._content),p(b,e))return;return y(a.existingPieces,b,e),f=i(e.finally(function(){return u(b,d)})),f.cancelCb=d,f.promiseType=b.promiseType,a.existingPieces.enqueue(f),e.finally(function(){return a.existingPieces.dequeue()})}return a.existingPieces=new g.Queue,a.existingPieces.enqueue(u(b,d))},w=function(a,b,d,f,g){var h;return null==d&&(d=""),h=function(a){if(e.debug(a+": "+a),null!=f&&c.isFunction(f))return f(a)},j(a,k(g,b),h)},n=80,r={value:null},B=function(a,b,c){var d,e;try{return a.apply(b,c)}catch(e){return d=e,r.value=d,r}},v=function(a,b,c,d){var f,g;return g=B(a,b,d),g===r&&(f="error within chunking iterator: "+r.value,e.error(f),c.reject(f)),"cancel safe"!==g},l=function(a,b,c){var d,e;return d=a===b,e=b[c],d?e:a[e]},m=["length","forEach","map"],s=function(a,d,e,f){var g,h,i;if(b.isArray(a))g=a;else if(d)g=d;else{g=[];for(h in a)i=a[h],a.hasOwnProperty(h)&&!c.includes(m,h)&&g.push(h)}return null==f&&(f=e),b.isArray(g)&&!(null!=g?g.length:void 0)&&f!==e?e():f(g,d)},o=function(d,e,f,g,h,i,j,k){return s(d,k,function(k,m){var n,p,q,r;for(n=e&&e<k.length?e:k.length,p=j,q=!0;q&&n--&&p<(k?k.length:p+1);)r=l(d,k,p),q=!!b.isFunction(r)||v(g,void 0,i,[r,p]),++p;if(k){if(!(q&&p<k.length))return i.resolve();if(j=p,e)return null!=h&&c.isFunction(h)&&v(h,void 0,i,[]),a(function(){return o(d,e,f,g,h,i,j,m)},f,!1)}})},q=function(a,b,c,f,g,h,i){var j,k,l;return null==c&&(c=n),null==g&&(g=0),null==h&&(h=1),l=void 0,k=d.defer(),l=k.promise,h?s(a,i,function(){return k.resolve(),l},function(d,e){return o(a,c,h,b,f,k,g,e),l}):(j="pause (delay) must be set from _async!",e.error(j),k.reject(j),l)},x=function(a,b,c,e,f,g,h){var i;return i=[],s(a,h,function(){return d.resolve(i)},function(d,h){return q(a,function(a){return i.push(b(a))},c,e,f,g,h).then(function(){return i})})},{each:q,map:x,managePromiseQueue:w,promiseLock:w,defaultChunkSize:n,getArrayAndKeys:s,chunkSizeFrom:function(a,b){return null==b&&(b=void 0),c.isNumber(a)&&(b=a),(h.isFalse(a)||a===!1)&&(b=!1),b}}}])}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapBaseObject",function(){var b,c;return c=["extended","included"],b=function(){function b(){}return b.extend=function(b){var d,e,f;for(d in b)f=b[d],a.call(c,d)<0&&(this[d]=f);return null!=(e=b.extended)&&e.apply(this),this},b.include=function(b){var d,e,f;for(d in b)f=b[d],a.call(c,d)<0&&(this.prototype[d]=f);return null!=(e=b.included)&&e.apply(this),this},b}()})}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapChildEvents",function(){return{onChildCreation:function(a){}}})}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapCtrlHandle",["$q",function(a){var b;return b={handle:function(c,d){return c.$on("$destroy",function(){return b.handle(c)}),c.deferred=a.defer(),{getScope:function(){return c}}},mapPromise:function(a,b){var c;return c=b.getScope(),c.deferred.promise.then(function(b){return a.map=b}),c.deferred.promise}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapEventsHelper",["uiGmapLogger",function(a){var d,e;return e=function(a){return b.isDefined(a.events)&&null!=a.events&&b.isObject(a.events)},d=function(a,b){return e(a)?a:e(b)?b:void 0},{setEvents:function(a,e,f,g){var h;if(h=d(e,f),null!=h)return c.compact(c.map(h.events,function(d,i){var j;if(g&&(j=c(g).includes(i)),h.events.hasOwnProperty(i)&&b.isFunction(h.events[i])&&!j)return google.maps.event.addListener(a,i,function(){return e.$evalAsync||(e.$evalAsync=function(){}),e.$evalAsync(d.apply(e,[a,i,f,arguments]))})}))},removeEvents:function(a){var b,c;if(a)for(b in a)c=a[b],c&&a.hasOwnProperty(b)&&google.maps.event.removeListener(c)}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapFitHelper",["uiGmapLogger","$timeout",function(a,b){return{fit:function(a,d){var e,f,g,h,i;if(d&&(null!=a?a.length:void 0)){e=new google.maps.LatLngBounds,f=!1;for(g in a)h=a[g],h&&(f||(f=!0),i=c.isFunction(h.getPosition)?h.getPosition():h),e.extend(i);if(f)return b(function(){return d.fitBounds(e)})}}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapGmapUtil",["uiGmapLogger","$compile",function(a,d){var e,f,g,h,i,j;return f=function(a,b,c){return a===b||c.indexOf(a)!==-1},e=function(a){return f(a,!1,["false","FALSE",0,"n","N","no","NO"])},h=function(a){return Array.isArray(a)&&2===a.length?a[1]:b.isDefined(a.type)&&"Point"===a.type?a.coordinates[1]:a.latitude},i=function(a){return Array.isArray(a)&&2===a.length?a[0]:b.isDefined(a.type)&&"Point"===a.type?a.coordinates[0]:a.longitude},g=function(a){if(a)return a instanceof google.maps.LatLng?a:Array.isArray(a)&&2===a.length?new google.maps.LatLng(a[1],a[0]):b.isDefined(a.type)&&"Point"===a.type?new google.maps.LatLng(a.coordinates[1],a.coordinates[0]):new google.maps.LatLng(a.latitude,a.longitude)},j=function(a){if(b.isUndefined(a))return!1;if(c.isArray(a)){if(2===a.length)return!0}else if(null!=a&&(null!=a?a.type:void 0)&&"Point"===a.type&&c.isArray(a.coordinates)&&2===a.coordinates.length)return!0;return!(!a||!b.isDefined((null!=a?a.latitude:void 0)&&b.isDefined(null!=a?a.longitude:void 0)))},{setCoordsFromEvent:function(a,c){if(a)return Array.isArray(a)&&2===a.length?(a[1]=c.lat(),a[0]=c.lng()):b.isDefined(a.type)&&"Point"===a.type?(a.coordinates[1]=c.lat(),a.coordinates[0]=c.lng()):(a.latitude=c.lat(),a.longitude=c.lng()),a},getLabelPositionPoint:function(a){var b,c;if(void 0!==a)return a=/^([-\d\.]+)\s([-\d\.]+)$/.exec(a),b=parseFloat(a[1]),c=parseFloat(a[2]),null!=b&&null!=c?new google.maps.Point(b,c):void 0},createWindowOptions:function(c,e,f,h){var i;return null!=f&&null!=h&&null!=d?(i=b.extend({},h,{content:this.buildContent(e,h,f),position:null!=h.position?h.position:b.isObject(c)?c.getPosition():g(e.coords)}),null!=c&&null==(null!=i?i.pixelOffset:void 0)&&(null==i.boxClass||(i.pixelOffset={height:0,width:-2})),i):h?h:(a.error("infoWindow defaults not defined"),f?void 0:a.error("infoWindow content not defined"))},buildContent:function(a,b,c){var e,f;return null!=b.content?f=b.content:null!=d?(c=c.replace(/^\s+|\s+$/g,""),e=""===c?"":d(c)(a),e.length>0&&(f=e[0])):f=c,f},defaultDelay:50,isTrue:function(a){return f(a,!0,["true","TRUE",1,"y","Y","yes","YES"])},isFalse:e,isFalsy:function(a){return f(a,!1,[void 0,null])||e(a)},getCoords:g,validateCoords:j,equalCoords:function(a,b){return h(a)===h(b)&&i(a)===i(b)},validatePath:function(a){var d,e,f,g;if(e=0,b.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;e<a.length;){if(!(b.isDefined(a[e].latitude)&&b.isDefined(a[e].longitude)||"function"==typeof a[e].lat&&"function"==typeof a[e].lng))return!1;e++}return!0}if(b.isUndefined(a.coordinates))return!1;if("Polygon"===a.type){if(a.coordinates[0].length<4)return!1;d=a.coordinates[0]}else if("MultiPolygon"===a.type){if(g={max:0,index:0},c.forEach(a.coordinates,function(a,b){if(a[0].length>this.max)return this.max=a[0].length,this.index=b},g),f=a.coordinates[g.index],d=f[0],d.length<4)return!1}else{if("LineString"!==a.type)return!1;if(a.coordinates.length<2)return!1;d=a.coordinates}for(;e<d.length;){if(2!==d[e].length)return!1;e++}return!0},convertPathPoints:function(a){var d,e,f,g,h;if(e=0,g=new google.maps.MVCArray,b.isUndefined(a.type))for(;e<a.length;)b.isDefined(a[e].latitude)&&b.isDefined(a[e].longitude)?f=new google.maps.LatLng(a[e].latitude,a[e].longitude):"function"==typeof a[e].lat&&"function"==typeof a[e].lng&&(f=a[e]),g.push(f),e++;else for("Polygon"===a.type?d=a.coordinates[0]:"MultiPolygon"===a.type?(h={max:0,index:0},c.forEach(a.coordinates,function(a,b){if(a[0].length>this.max)return this.max=a[0].length,this.index=b},h),d=a.coordinates[h.index][0]):"LineString"===a.type&&(d=a.coordinates);e<d.length;)g.push(new google.maps.LatLng(d[e][1],d[e][0])),e++;return g},getPath:function(a,b){var d;return null!=b&&c.isString(b)?(d=a,c.each(b.split("."),function(a){if(d)return d=d[a]}),d):b},validateBoundPoints:function(a){return!(b.isUndefined(a.sw.latitude)||b.isUndefined(a.sw.longitude)||b.isUndefined(a.ne.latitude)||b.isUndefined(a.ne.longitude))},convertBoundPoints:function(a){var b;return b=new google.maps.LatLngBounds(new google.maps.LatLng(a.sw.latitude,a.sw.longitude),new google.maps.LatLng(a.ne.latitude,a.ne.longitude))},fitMapBounds:function(a,b){return a.fitBounds(b)}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapIsReady",["$q","$timeout",function(a,b){var c,d,e,f;return d=0,f=[],e=function(){return a.all(f)},c=function(a,f,g){return b(function(){return g<=0?void a.reject("Your maps are not found we have checked the maximum amount of times. :)"):void(d!==f?c(a,f,g-1):a.resolve(e()))},100)},{spawn:function(){var b;return b=a.defer(),f.push(b.promise),d+=1,{instance:d,deferred:b}},promises:e,instances:function(){return d},promise:function(b,d){var e;return null==b&&(b=1),null==d&&(d=50),e=a.defer(),c(e,b,d),e.promise},reset:function(){d=0,f.length=0},decrement:function(){d>0&&(d-=1),f.length&&(f.length-=1)}}}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapLinked",["uiGmapBaseObject",function(b){var c;return c=function(b){function c(a,b,c,d){this.scope=a,this.element=b,this.attrs=c,this.ctrls=d}return a(c,b),c}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapLogger",["nemSimpleLogger",function(a){return a.spawn()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapModelKey",["uiGmapBaseObject","uiGmapGmapUtil",function(e,f){return function(e){function g(b,c){this.scope=b,this.interface=null!=c?c:{scopeKeys:[]},this.modelsLength=a(this.modelsLength,this),this.updateChild=a(this.updateChild,this),this.destroy=a(this.destroy,this),this.setChildScope=a(this.setChildScope,this),this.getChanges=a(this.getChanges,this),this.getProp=a(this.getProp,this),this.setIdKey=a(this.setIdKey,this),this.modelKeyComparison=a(this.modelKeyComparison,this),g.__super__.constructor.call(this),this.defaultIdKey="id",this.idKey=void 0}return d(g,e),g.prototype.evalModelHandle=function(a,b){if(null!=a&&null!=b)return"self"===b?a:(c.isFunction(b)&&(b=b()),f.getPath(a,b))},g.prototype.modelKeyComparison=function(a,b){var d,e,g,h,i,j;if(g=this.interface.scopeKeys.indexOf("coords")>=0,(g&&null!=this.scope.coords||!g)&&(i=this.scope),null==i)throw"No scope set!";return g&&(d=this.scopeOrModelVal("coords",i,a),e=this.scopeOrModelVal("coords",i,b),h=f.equalCoords(d,e),!h)?h:(j=c.without(this.interface.scopeKeys,"coords"),h=c.every(j,function(d){return function(e){var f,g;return f=d.scopeOrModelVal(i[e],i,a),g=d.scopeOrModelVal(i[e],i,b),i.deepComparison?c.isEqual(f,g):f===g}}(this)))},g.prototype.setIdKey=function(a){return this.idKey=null!=a.idKey?a.idKey:this.defaultIdKey},g.prototype.setVal=function(a,b,c){return this.modelOrKey(a,b=c),a},g.prototype.modelOrKey=function(a,b){if(null!=b)return"self"!==b?f.getPath(a,b):a},g.prototype.getProp=function(a,b,c){return this.scopeOrModelVal(a,b,c)},g.prototype.getChanges=function(a,b,d){var e,f,g;d&&(b=c.pick(b,d),a=c.pick(a,d)),f={},g={},e={};for(g in a)b&&b[g]===a[g]||(c.isArray(a[g])?f[g]=a[g]:c.isObject(a[g])?(e=this.getChanges(a[g],b?b[g]:null),c.isEmpty(e)||(f[g]=e)):f[g]=a[g]);return f},g.prototype.scopeOrModelVal=function(a,b,d,e){var f,g,h,i;return null==e&&(e=!1),f=function(a,b,c){return null==c&&(c=!1),c?{isScope:a,value:b}:b},i=c.get(b,a),c.isFunction(i)?f(!0,i(d),e):c.isObject(i)?f(!0,i,e):c.isString(i)?(g=i,h=g?"self"===g?d:c.get(d,g):c.get(d,a),c.isFunction(h)?f(!1,h(),e):f(!1,h,e)):f(!0,i,e)},g.prototype.setChildScope=function(a,b,c){var d,e,f,g;for(e in a)f=a[e],d=this.scopeOrModelVal(f,b,c,!0),null!=(null!=d?d.value:void 0)&&(g=d.value,g!==b[f]&&(b[f]=g));return b.model=c},g.prototype.onDestroy=function(a){},g.prototype.destroy=function(a){var b;return null==a&&(a=!1),null==this.scope||(null!=(b=this.scope)?b.$$destroyed:void 0)||!this.needToManualDestroy&&!a?this.clean():this.scope.$destroy()},g.prototype.updateChild=function(a,b){return null==b[this.idKey]?void this.$log.error("Model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):a.updateModel(b)},g.prototype.modelsLength=function(a){var c,d;return null==a&&(a=void 0),c=0,d=a?a:this.scope.models,null==d?c:c=b.isArray(d)||null!=d.length?d.length:Object.keys(d).length},g}(e)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapModelsWatcher",["uiGmapLogger","uiGmap_async","$q","uiGmapPromise",function(a,b,c,d){return{didQueueInitPromise:function(a,c){return 0===c.models.length&&(b.promiseLock(a,d.promiseTypes.init,null,null,function(){return d.resolve()}),!0)},figureOutState:function(b,c,d,e,f){var g,h,i,j,k;return g=[],i={},j=[],k=[],c.models.forEach(function(f){var h;return null==f[b]?a.error(" id missing for model #{m.toString()},\ncan not use do comparison/insertion"):(i[f[b]]={},null==d.get(f[b])?g.push(f):(h=d.get(f[b]),e(f,h.clonedModel,c)?void 0:k.push({model:f,child:h})))}),h=d.values(),h.forEach(function(c){var d;return null==c?void a.error("child undefined in ModelsWatcher."):null==c.model?void a.error("child.model undefined in ModelsWatcher."):(d=c.model[b],null==i[d]?j.push(c):void 0)}),{adds:g,removals:j,updates:k}}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapPromise",["$q","$timeout","uiGmapLogger",function(a,b,d){var e,f,g,h,i,j,k,l,m,n,o;return m={create:"create",update:"update",delete:"delete",init:"init"},l={IN_PROGRESS:0,RESOLVED:1,REJECTED:2},o=function(){var a;return a={},a[""+l.IN_PROGRESS]="in-progress",a[""+l.RESOLVED]="resolved",a[""+l.REJECTED]="rejected",a}(),h=function(a){return a.$$state?a.$$state.status===l.IN_PROGRESS:!a.hasOwnProperty("$$v")||void 0},i=function(a){return a.$$state?a.$$state.status===l.RESOLVED:!!a.hasOwnProperty("$$v")||void 0},k=function(a){return o[a]||"done w error"},e=function(b){var c,d,e;return c=a.defer(),d=a.all([b,c.promise]),e=a.defer(),b.then(c.resolve,function(){},function(a){return c.notify(a),e.notify(a)}),d.then(function(a){return e.resolve(a[0]||a[1])},function(a){return e.reject(a)}),e.promise.cancel=function(a){return null==a&&(a="canceled"),c.reject(a)},e.promise.notify=function(a){if(null==a&&(a="cancel safe"),e.notify(a),b.hasOwnProperty("notify"))return b.notify(a)},null!=b.promiseType&&(e.promise.promiseType=b.promiseType),e.promise},f=function(a,b){return{promise:a,promiseType:b}},g=function(){return a.defer()},n=function(){var b;return b=a.defer(),b.resolve.apply(void 0,arguments),b.promise},j=function(e){var f;return c.isFunction(e)?(f=a.defer(),b(function(){var a;return a=e(),f.resolve(a)}),f.promise):void d.error("uiGmapPromise.promise() only accepts functions")},{defer:g,promise:j,resolve:n,promiseTypes:m,isInProgress:h,isResolved:i,promiseStatus:k,ExposedPromise:e,SniffedPromise:f}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapPropMap",function(){var b;return b=function(){function b(){this.removeAll=a(this.removeAll,this),this.slice=a(this.slice,this),this.push=a(this.push,this),this.keys=a(this.keys,this),this.values=a(this.values,this),this.remove=a(this.remove,this),this.put=a(this.put,this),this.stateChanged=a(this.stateChanged,this),this.get=a(this.get,this),this.length=0,this.dict={},this.didValsStateChange=!1,this.didKeysStateChange=!1,this.allVals=[],this.allKeys=[]}return b.prototype.get=function(a){return this.dict[a]},b.prototype.stateChanged=function(){return this.didValsStateChange=!0,this.didKeysStateChange=!0},b.prototype.put=function(a,b){return null==this.get(a)&&this.length++,this.stateChanged(),this.dict[a]=b},b.prototype.remove=function(a,b){var c;if(null==b&&(b=!1),!b||this.get(a))return c=this.dict[a],delete this.dict[a],this.length--,this.stateChanged(),c},b.prototype.valuesOrKeys=function(a){var b,d;return null==a&&(a="Keys"),this["did"+a+"StateChange"]?(d=[],b=[],c.each(this.dict,function(a,c){return d.push(a),b.push(c)}),this.didKeysStateChange=!1,this.didValsStateChange=!1,this.allVals=d,this.allKeys=b,this["all"+a]):this["all"+a]},b.prototype.values=function(){return this.valuesOrKeys("Vals")},b.prototype.keys=function(){return this.valuesOrKeys()},b.prototype.push=function(a,b){return null==b&&(b="key"),this.put(a[b],a)},b.prototype.slice=function(){return this.keys().map(function(a){return function(b){return a.remove(b)}}(this))},b.prototype.removeAll=function(){return this.slice()},b.prototype.each=function(a){return c.each(this.dict,function(b,c){return a(b)})},b.prototype.map=function(a){return c.map(this.dict,function(b,c){return a(b)})},b}()})}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapPropertyAction",["uiGmapLogger",function(a){var b;return b=function(a){return this.setIfChange=function(b){return function(d,e){if(!c.isEqual(e,d))return a(b,d)}},this.sic=this.setIfChange,this}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapClustererMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap","uiGmapEventsHelper",function(c,d,e,f){var g;return g=function(){function g(b,d,f,h){null==d&&(d={}),this.opt_options=null!=f?f:{},this.opt_events=h,this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.destroy=a(this.destroy,this),this.attachEvents=a(this.attachEvents,this),this.clear=a(this.clear,this),this.draw=a(this.draw,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=g.type,this.clusterer=new NgMapMarkerClusterer(b,d,this.opt_options),this.propMapGMarkers=new e,this.attachEvents(this.opt_events,"opt_events"),this.clusterer.setIgnoreHidden(!0),this.noDrawOnSingleAddRemoves=!0,c.info(this)}return g.type="ClustererMarkerManager",g.prototype.checkKey=function(a){var b;if(null==a.key)return b="gMarker.key undefined and it is REQUIRED!!",c.error(b)},g.prototype.add=function(a){return this.checkKey(a),this.clusterer.addMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.put(a.key,a),this.checkSync()},g.prototype.update=function(a){return this.remove(a),this.add(a)},g.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},g.prototype.remove=function(a){var b;return this.checkKey(a),b=this.propMapGMarkers.get(a.key),b&&(this.clusterer.removeMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.remove(a.key)),this.checkSync()},g.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},g.prototype.draw=function(){return this.clusterer.repaint()},g.prototype.clear=function(){return this.removeMany(this.getGMarkers()),this.clusterer.repaint()},g.prototype.attachEvents=function(a,d){var e,f,g;if(this.listeners=[],b.isDefined(a)&&null!=a&&b.isObject(a)){g=[];for(f in a)e=a[f],a.hasOwnProperty(f)&&b.isFunction(a[f])?(c.info(d+": Attaching event: "+f+" to clusterer"),g.push(this.listeners.push(google.maps.event.addListener(this.clusterer,f,a[f])))):g.push(void 0);return g}},g.prototype.clearEvents=function(){return f.removeEvents(this.listeners),this.listeners=[]},g.prototype.destroy=function(){return this.clearEvents(),this.clear()},g.prototype.fit=function(){return d.fit(this.getGMarkers(),this.clusterer.getMap())},g.prototype.getGMarkers=function(){return this.clusterer.getMarkers().values()},g.prototype.checkSync=function(){},g}()}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.managers").service("uiGmapGoogleMapObjectManager",[function(){var a,c;return a=[],c=[],{createMapInstance:function(d,e){var f;return f=null,0===a.length?(f=new google.maps.Map(d,e),c.push(f)):(f=a.pop(),b.element(d).append(f.getDiv()),f.setOptions(e),c.push(f)),f},recycleMapInstance:function(b){var d;if(d=c.indexOf(b),d<0)throw new Error("Expected map instance to be a previously used instance");return c.splice(d,1),a.push(b)}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap",function(b,c,d){var e;return e=function(){function e(c,f,g){this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.handleOptDraw=a(this.handleOptDraw,this),this.clear=a(this.clear,this),this.destroy=a(this.destroy,this),this.draw=a(this.draw,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=e.type,this.gMap=c,this.gMarkers=new d,this.$log=b,this.$log.info(this)}return e.type="MarkerManager",e.prototype.add=function(a,c){var d,e;if(null==c&&(c=!0),null==a.key)throw e="gMarker.key undefined and it is REQUIRED!!",b.error(e),e;if(d=this.gMarkers.get(a.key),!d)return this.handleOptDraw(a,c,!0),this.gMarkers.put(a.key,a)},e.prototype.update=function(a,b){return null==b&&(b=!0),this.remove(a,b),this.add(a,b)},e.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},e.prototype.remove=function(a,b){if(null==b&&(b=!0),this.handleOptDraw(a,b,!1),this.gMarkers.get(a.key))return this.gMarkers.remove(a.key)},e.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},e.prototype.draw=function(){var a;return a=[],this.gMarkers.each(function(b){return function(c){if(!c.isDrawn)return c.doAdd?(c.setMap(b.gMap),c.isDrawn=!0):a.push(c)}}(this)),a.forEach(function(a){return function(b){return b.isDrawn=!1,a.remove(b,!0)}}(this))},e.prototype.destroy=function(){return this.clear()},e.prototype.clear=function(){return this.gMarkers.each(function(a){
7
return a.setMap(null)}),delete this.gMarkers,this.gMarkers=new d},e.prototype.handleOptDraw=function(a,b,c){return b===!0?(c?a.setMap(this.gMap):a.setMap(null),a.isDrawn=!0):(a.isDrawn=!1,a.doAdd=c)},e.prototype.fit=function(){return c.fit(this.getGMarkers(),this.gMap)},e.prototype.getGMarkers=function(){return this.gMarkers.values()},e}()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapSpiderfierMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap","uiGmapMarkerSpiderfier",function(d,e,f,g){var h;return h=function(){function h(b,c,e,i,j){null==c&&(c={}),this.opt_options=null!=e?e:{},this.opt_events=i,this.scope=j,this.isSpiderfied=a(this.isSpiderfied,this),this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.destroy=a(this.destroy,this),this.attachEvents=a(this.attachEvents,this),this.clear=a(this.clear,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=h.type,this.markerSpiderfier=new g(b,this.opt_options),this.propMapGMarkers=new f,this.attachEvents(this.opt_events,"opt_events"),this.noDrawOnSingleAddRemoves=!0,d.info(this)}return h.type="SpiderfierMarkerManager",h.prototype.checkKey=function(a){var b;if(null==a.key)return b="gMarker.key undefined and it is REQUIRED!!",d.error(b)},h.prototype.add=function(a){return a.setMap(this.markerSpiderfier.map),this.checkKey(a),this.markerSpiderfier.addMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.put(a.key,a),this.checkSync()},h.prototype.update=function(a){return this.remove(a),this.add(a)},h.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},h.prototype.remove=function(a){var b;return this.checkKey(a),b=this.propMapGMarkers.get(a.key),b&&(a.setMap(null),this.markerSpiderfier.removeMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.remove(a.key)),this.checkSync()},h.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},h.prototype.draw=function(){},h.prototype.clear=function(){return this.removeMany(this.getGMarkers())},h.prototype.attachEvents=function(a,e){if(b.isDefined(a)&&null!=a&&b.isObject(a))return c.each(a,function(c){return function(f,g){if(a.hasOwnProperty(g)&&b.isFunction(a[g]))return d.info(e+": Attaching event: "+g+" to markerSpiderfier"),c.markerSpiderfier.addListener(g,function(){return"spiderfy"===g||"unspiderfy"===g?c.scope.$evalAsync(a[g].apply(a,arguments)):c.scope.$evalAsync(a[g].apply(a,[arguments[0],g,arguments[0].model,arguments]))})}}(this))},h.prototype.clearEvents=function(a,c){var e,f;if(b.isDefined(a)&&null!=a&&b.isObject(a))for(f in a)e=a[f],a.hasOwnProperty(f)&&b.isFunction(a[f])&&(d.info(c+": Clearing event: "+f+" to markerSpiderfier"),this.markerSpiderfier.clearListeners(f))},h.prototype.destroy=function(){return this.clearEvents(this.opt_events,"opt_events"),this.clear()},h.prototype.fit=function(){return e.fit(this.getGMarkers(),this.markerSpiderfier.map)},h.prototype.getGMarkers=function(){return this.markerSpiderfier.getMarkers()},h.prototype.isSpiderfied=function(){return c.find(this.getGMarkers(),function(a){return null!=(null!=a?a._omsData:void 0)})},h.prototype.checkSync=function(){},h}()}])}.call(this),function(){b.module("uiGmapgoogle-maps").factory("uiGmapadd-events",["$timeout",function(a){var c,d;return c=function(b,c,d){return google.maps.event.addListener(b,c,function(){return d.apply(this,arguments),a(function(){},!0)})},d=function(a,d,e){var f;return e?c(a,d,e):(f=[],b.forEach(d,function(b,d){return f.push(c(a,d,b))}),function(){return b.forEach(f,function(a){return google.maps.event.removeListener(a)}),f=null})}}])}.call(this),function(){b.module("uiGmapgoogle-maps").factory("uiGmaparray-sync",["uiGmapadd-events",function(a){return function(c,d,e,f){var g,h,i,j,k,l,m,n,o;return j=!1,n=d.$eval(e),d.static||(k={set_at:function(a){var b;if(!j&&(b=c.getAt(a)))return b.lng&&b.lat?(n[a].latitude=b.lat(),n[a].longitude=b.lng()):n[a]=b},insert_at:function(a){var b;if(!j&&(b=c.getAt(a)))return b.lng&&b.lat?n.splice(a,0,{latitude:b.lat(),longitude:b.lng()}):n.splice(a,0,b)},remove_at:function(a){if(!j)return n.splice(a,1)}},"Polygon"===n.type?g=n.coordinates[0]:"LineString"===n.type&&(g=n.coordinates),h={set_at:function(a){var b;if(!j&&(b=c.getAt(a),b&&b.lng&&b.lat))return g[a][1]=b.lat(),g[a][0]=b.lng()},insert_at:function(a){var b;if(!j&&(b=c.getAt(a),b&&b.lng&&b.lat))return g.splice(a,0,[b.lng(),b.lat()])},remove_at:function(a){if(!j)return g.splice(a,1)}},m=a(c,b.isUndefined(n.type)?k:h)),l=function(a){var b,d,e,g,h,i,k,l;if(j=!0,i=c,b=!1,a){for(d=0,k=i.getLength(),g=a.length,e=Math.min(k,g),h=void 0;d<e;)l=i.getAt(d),h=a[d],"function"==typeof h.equals?h.equals(l)||(i.setAt(d,h),b=!0):l.lat()===h.latitude&&l.lng()===h.longitude||(i.setAt(d,new google.maps.LatLng(h.latitude,h.longitude)),b=!0),d++;for(;d<g;)h=a[d],"function"==typeof h.lat&&"function"==typeof h.lng?i.push(h):i.push(new google.maps.LatLng(h.latitude,h.longitude)),b=!0,d++;for(;d<k;)i.pop(),b=!0,d++}if(j=!1,b)return f(i)},i=function(a){var b,d,e,g,h,i,k,l,m;if(j=!0,k=c,d=!1,a){for("Polygon"===n.type?b=a.coordinates[0]:"LineString"===n.type&&(b=a.coordinates),e=0,l=k.getLength(),h=b.length,g=Math.min(l,h),i=void 0;e<g;)m=k.getAt(e),i=b[e],m.lat()===i[1]&&m.lng()===i[0]||(k.setAt(e,new google.maps.LatLng(i[1],i[0])),d=!0),e++;for(;e<h;)i=b[e],k.push(new google.maps.LatLng(i[1],i[0])),d=!0,e++;for(;e<l;)k.pop(),d=!0,e++}if(j=!1,d)return f(k)},d.static||(o=b.isUndefined(n.type)?d.$watchCollection(e,l):d.$watch(e,i,!0)),function(){if(m&&(m(),m=null),o)return o(),o=null}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapChromeFixes",["$timeout",function(a){return{maybeRepaint:function(b){if(b)return b.style.opacity=.9,a(function(){return b.style.opacity=1})}}}])}.call(this),function(){b.module("uiGmapgoogle-maps").service("uiGmapObjectIterators",function(){var a,b,d,e;return a=["length","forEach","map"],b=[],d=function(b){return b.forEach=function(d){return c.each(c.omit(b,a),function(a){if(!c.isFunction(a))return d(a)})},b},b.push(d),e=function(b){return b.map=function(d){return c.map(c.omit(b,a),function(a){if(!c.isFunction(a))return d(a)})},b},b.push(e),{slapMap:e,slapForEach:d,slapAll:function(a){return b.forEach(function(b){return b(a)}),a}}})}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.options.builders").service("uiGmapCommonOptionsBuilder",["uiGmapBaseObject","uiGmapLogger","uiGmapModelKey",function(d,e,f){var g;return g=function(d){function f(){return this.watchProps=a(this.watchProps,this),this.buildOpts=a(this.buildOpts,this),f.__super__.constructor.apply(this,arguments)}return c(f,d),f.prototype.props=["clickable","draggable","editable","visible",{prop:"stroke",isColl:!0}],f.prototype.getCorrectModel=function(a){return b.isDefined(null!=a?a.model:void 0)?a.model:a},f.prototype.buildOpts=function(a,c,d){var f,g,h;return null==a&&(a={}),null==d&&(d={}),this.scope?this.gMap?(f=this.getCorrectModel(this.scope),h=this.scopeOrModelVal("stroke",this.scope,f),g=b.extend(a,this.DEFAULTS,{map:this.gMap,strokeColor:null!=h?h.color:void 0,strokeOpacity:null!=h?h.opacity:void 0,strokeWeight:null!=h?h.weight:void 0}),b.forEach(b.extend(d,{clickable:!0,draggable:!1,editable:!1,static:!1,fit:!1,visible:!0,zIndex:0,icons:[]}),function(a){return function(d,e){var h;return h=c?c[e]:a.scopeOrModelVal(e,a.scope,f),b.isUndefined(h)?g[e]=d:g[e]=f[e]}}(this)),g.static&&(g.editable=!1),g):void e.error("this.map not defined in CommonOptionsBuilder can not buildOpts"):void e.error("this.scope not defined in CommonOptionsBuilder can not buildOpts")},f.prototype.watchProps=function(a){return null==a&&(a=this.props),a.forEach(function(a){return function(b){if(null!=a.attrs[b]||null!=a.attrs[null!=b?b.prop:void 0])return(null!=b?b.isColl:void 0)?a.scope.$watchCollection(b.prop,a.setMyOptions):a.scope.$watch(b,a.setMyOptions)}}(this))},f}(f)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.options.builders").factory("uiGmapPolylineOptionsBuilder",["uiGmapCommonOptionsBuilder",function(b){var c;return c=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{path:a},b,{geodesic:!1})},c}(b)}]).factory("uiGmapShapeOptionsBuilder",["uiGmapCommonOptionsBuilder",function(c){var d;return d=function(c){function d(){return d.__super__.constructor.apply(this,arguments)}return a(d,c),d.prototype.buildOpts=function(a,c,e){var f,g;return g=this.getCorrectModel(this.scope),f=c?c.fill:this.scopeOrModelVal("fill",this.scope,g),a=b.extend(a,{fillColor:null!=f?f.color:void 0,fillOpacity:null!=f?f.opacity:void 0}),d.__super__.buildOpts.call(this,a,c,e)},d}(c)}]).factory("uiGmapPolygonOptionsBuilder",["uiGmapShapeOptionsBuilder",function(b){var c;return c=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{path:a},b,{geodesic:!1})},c}(b)}]).factory("uiGmapRectangleOptionsBuilder",["uiGmapShapeOptionsBuilder",function(b){var c;return c=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{bounds:a},b)},c}(b)}]).factory("uiGmapCircleOptionsBuilder",["uiGmapShapeOptionsBuilder",function(b){var c;return c=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c.prototype.buildOpts=function(a,b,d){return c.__super__.buildOpts.call(this,{center:a,radius:b},d)},c}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.options").service("uiGmapMarkerOptions",["uiGmapLogger","uiGmapGmapUtil",function(a,d){return c.extend(d,{createOptions:function(a,c,e,f){var g;return null==e&&(e={}),g=b.extend({},e,{position:null!=e.position?e.position:d.getCoords(a),visible:null!=e.visible?e.visible:d.validateCoords(a)}),null==e.icon&&null==c||(g=b.extend(g,{icon:null!=e.icon?e.icon:c})),null!=f&&(g.map=f),g},isLabel:function(a){return null!=a&&(null!=a.labelContent||null!=a.labelAnchor||null!=a.labelClass||null!=a.labelStyle||null!=a.labelVisible)}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapBasePolyChildModel",["uiGmapLogger","$timeout","uiGmaparray-sync","uiGmapGmapUtil","uiGmapEventsHelper",function(e,f,g,h,i){return function(e,f){var j;return j=function(e){function j(d){var e,h,j;this.scope=d.scope,this.attrs=d.attrs,this.gMap=d.gMap,this.defaults=d.defaults,this.model=d.model,h=d.gObjectChangeCb,this.isScopeModel=null!=(j=d.isScopeModel)&&j,this.clean=a(this.clean,this),this.isScopeModel&&(this.clonedModel=c.clone(this.model,!0)),this.isDragging=!1,this.internalEvents={dragend:function(a){return function(){return c.defer(function(){return a.isDragging=!1})}}(this),dragstart:function(a){return function(){return a.isDragging=!0}}(this)},e=function(a){return function(){var c;if(!a.isDragging)return a.pathPoints=a.convertPathPoints(a.scope.path),null!=a.gObject&&a.clean(),null!=a.scope.model&&(c=a.scope),a.pathPoints.length>0&&(a.gObject=f(a.buildOpts(a.pathPoints,c))),a.gObject?(g(a.gObject.getPath(),a.scope,"path",function(b){if(a.pathPoints=b,null!=h)return h()}),b.isDefined(a.scope.events)&&b.isObject(a.scope.events)&&(a.listeners=a.model?i.setEvents(a.gObject,a.scope,a.model):i.setEvents(a.gObject,a.scope,a.scope)),a.internalListeners=a.model?i.setEvents(a.gObject,{events:a.internalEvents},a.model):i.setEvents(a.gObject,{events:a.internalEvents},a.scope)):void 0}}(this),e(),this.scope.$watch("path",function(a){return function(b,d){if(!c.isEqual(b,d)||!a.gObject)return e()}}(this),!0),!this.scope.static&&b.isDefined(this.scope.editable)&&this.scope.$watch("editable",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setEditable(b):void 0}}(this),!0),b.isDefined(this.scope.draggable)&&this.scope.$watch("draggable",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setDraggable(b):void 0}}(this),!0),b.isDefined(this.scope.visible)&&this.scope.$watch("visible",function(a){return function(b,c){var d;return b!==c&&(b=!a.isFalse(b)),null!=(d=a.gObject)?d.setVisible(b):void 0}}(this),!0),b.isDefined(this.scope.geodesic)&&this.scope.$watch("geodesic",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.weight)&&this.scope.$watch("stroke.weight",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.color)&&this.scope.$watch("stroke.color",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.opacity)&&this.scope.$watch("stroke.opacity",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.icons)&&this.scope.$watch("icons",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),this.scope.$on("$destroy",function(a){return function(){return a.clean(),a.scope=null}}(this)),b.isDefined(this.scope.fill)&&b.isDefined(this.scope.fill.color)&&this.scope.$watch("fill.color",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this)),b.isDefined(this.scope.fill)&&b.isDefined(this.scope.fill.opacity)&&this.scope.$watch("fill.opacity",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this)),b.isDefined(this.scope.zIndex)&&this.scope.$watch("zIndex",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this))}return d(j,e),j.include(h),j.prototype.clean=function(){var a;return i.removeEvents(this.listeners),i.removeEvents(this.internalListeners),null!=(a=this.gObject)&&a.setMap(null),this.gObject=null},j}(e)}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapDrawFreeHandChildModel",["uiGmapLogger","$q",function(a,b){var d,e;return d=function(a,b,c){var d,e;e=new google.maps.Polyline({map:a,clickable:!1}),d=google.maps.event.addListener(a,"mousemove",function(a){return e.getPath().push(a.latLng)}),google.maps.event.addListenerOnce(a,"mouseup",function(f){var g;return google.maps.event.removeListener(d),g=e.getPath(),e.setMap(null),b.push(new google.maps.Polygon({map:a,path:g})),e=null,google.maps.event.clearListeners(a.getDiv(),"mousedown"),c()})},e=function(e,f){var g,h;return this.map=e,g=function(b){return function(){var c;return c={draggable:!1,disableDefaultUI:!0,scrollwheel:!1,disableDoubleClickZoom:!1},a.info("disabling map move"),b.map.setOptions(c)}}(this),h=function(a){return function(){var b,d;return b={draggable:!0,disableDefaultUI:!1,scrollwheel:!0,disableDoubleClickZoom:!0},null!=(d=a.deferred)&&d.resolve(),c.defer(function(){return a.map.setOptions(c.extend(b,f.options))})}}(this),this.engage=function(c){return function(e){return c.polys=e,c.deferred=b.defer(),g(),a.info("DrawFreeHandChildModel is engaged (drawing)."),google.maps.event.addDomListener(c.map.getDiv(),"mousedown",function(a){return d(c.map,c.polys,h)}),c.deferred.promise}}(this),this}}])}.call(this),function(){var d=function(a,b){return function(){return a.apply(b,arguments)}},e=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},f={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapMarkerChildModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger","uiGmapEventsHelper","uiGmapPropertyAction","uiGmapMarkerOptions","uiGmapIMarker","uiGmapMarkerManager","uiGmapPromise",function(f,g,h,i,j,k,l,m,n){var o;return o=function(f){function o(a){this.internalEvents=d(this.internalEvents,this),this.setLabelOptions=d(this.setLabelOptions,this),this.setOptions=d(this.setOptions,this),this.setIcon=d(this.setIcon,this),this.setCoords=d(this.setCoords,this),this.isNotValid=d(this.isNotValid,this),this.maybeSetScopeValue=d(this.maybeSetScopeValue,this),this.createMarker=d(this.createMarker,this),this.setMyScope=d(this.setMyScope,this),this.updateModel=d(this.updateModel,this),this.handleModelChanges=d(this.handleModelChanges,this),this.destroy=d(this.destroy,this);var b,e,f,g,i,k,l;l=a.scope,this.model=a.model,this.keys=a.keys,this.gMap=a.gMap,this.defaults=null!=(e=a.defaults)?e:{},this.doClick=a.doClick,this.gManager=a.gManager,this.doDrawSelf=null==(f=a.doDrawSelf)||f,this.trackModel=null==(g=a.trackModel)||g,this.needRedraw=null!=(i=a.needRedraw)&&i,this.isScopeModel=null!=(k=a.isScopeModel)&&k,this.isScopeModel&&(this.clonedModel=c.clone(this.model,!0)),this.deferred=n.defer(),c.each(this.keys,function(a){return function(b,d){var e;if(e=a.keys[d],null!=e&&!c.isFunction(e)&&c.isString(e))return a[d+"Key"]=e}}(this)),this.idKey=this.idKeyKey||"id",null!=this.model[this.idKey]&&(this.id=this.model[this.idKey]),o.__super__.constructor.call(this,l),this.scope.getGMarker=function(a){return function(){return a.gObject}}(this),this.firstTime=!0,this.trackModel?(this.scope.model=this.model,this.scope.$watch("model",function(a){return function(b,c){if(b!==c)return a.handleModelChanges(b,c)}}(this),!0)):(b=new j(function(a){return function(b){if(c.isFunction(b)&&(b="all"),!a.firstTime)return a.setMyScope(b,l)}}(this),!1),c.each(this.keys,function(a,c){return l.$watch(c,b.sic(c),!0)})),this.scope.$on("$destroy",function(a){return function(){return p(a)}}(this)),this.createMarker(this.model),h.info(this)}var p;return e(o,f),o.include(g),o.include(i),o.include(k),p=function(a){if(null!=(null!=a?a.gObject:void 0)&&(a.removeEvents(a.externalListeners),a.removeEvents(a.internalListeners),null!=a?a.gObject:void 0))return a.removeFromManager&&a.gManager.remove(a.gObject),a.gObject.setMap(null),a.gObject=null},o.prototype.destroy=function(a){return null==a&&(a=!0),this.removeFromManager=a,this.scope.$destroy()},o.prototype.handleModelChanges=function(a,b){var d,e,f;if(d=this.getChanges(a,b,l.keys),!this.firstTime)return e=0,f=c.keys(d).length,c.each(d,function(c){return function(d,g){var h;return e+=1,h=f===e,c.setMyScope(g,a,b,!1,!0,h),c.needRedraw=!0}}(this))},o.prototype.updateModel=function(a){return this.isScopeModel&&(this.clonedModel=c.clone(a,!0)),this.setMyScope("all",a,this.model)},o.prototype.renderGMarker=function(b,c){var d,e,f;if(null==b&&(b=!0),d=this.getProp("coords",this.scope,this.model),null!=(null!=(f=this.gManager)?f.isSpiderfied:void 0)&&(e=this.gManager.isSpiderfied()),null!=d){if(!this.validateCoords(d))return void h.debug("MarkerChild does not have coords yet. They may be defined later.");if(null!=c&&c(),b&&this.gObject&&this.gManager.add(this.gObject),e)return this.gManager.markerSpiderfier.spiderListener(this.gObject,a.event)}else if(b&&this.gObject)return this.gManager.remove(this.gObject)},o.prototype.setMyScope=function(a,b,d,e,f){var g;switch(null==d&&(d=void 0),null==e&&(e=!1),null==f&&(f=!0),null==b?b=this.model:this.model=b,this.gObject||(this.setOptions(this.scope,f),g=!0),a){case"all":return c.each(this.keys,function(a){return function(c,g){return a.setMyScope(g,b,d,e,f)}}(this));case"icon":return this.maybeSetScopeValue({gSetter:this.setIcon,doDraw:f});case"coords":return this.maybeSetScopeValue({gSetter:this.setCoords,doDraw:f});case"options":if(!g)return this.createMarker(b,d,e,f)}},o.prototype.createMarker=function(a,b,c,d){return null==b&&(b=void 0),null==c&&(c=!1),null==d&&(d=!0),this.maybeSetScopeValue({gSetter:this.setOptions,doDraw:d}),this.firstTime=!1},o.prototype.maybeSetScopeValue=function(a){var b,c,d;if(c=a.gSetter,b=null==(d=a.doDraw)||d,null!=c&&c(this.scope,b),this.doDrawSelf&&b)return this.gManager.draw()},o.prototype.isNotValid=function(a,b){var c,d;return null==b&&(b=!0),d=!!b&&void 0===this.gObject,c=!this.trackModel&&a.$id!==this.scope.$id,c||d},o.prototype.setCoords=function(a,b){if(null==b&&(b=!0),!this.isNotValid(a)&&null!=this.gObject)return this.renderGMarker(b,function(b){return function(){var c,d,e;if(d=b.getProp("coords",a,b.model),c=b.getCoords(d),e=b.gObject.getPosition(),null==e||null==c||c.lng()!==e.lng()||c.lat()!==e.lat())return b.gObject.setPosition(c),b.gObject.setVisible(b.validateCoords(d))}}(this))},o.prototype.setIcon=function(a,b){if(null==b&&(b=!0),!this.isNotValid(a)&&null!=this.gObject)return this.renderGMarker(b,function(b){return function(){var c,d,e;if(e=b.gObject.getIcon(),d=b.getProp("icon",a,b.model),e!==d)return b.gObject.setIcon(d),c=b.getProp("coords",a,b.model),b.gObject.setPosition(b.getCoords(c)),b.gObject.setVisible(b.validateCoords(c))}}(this))},o.prototype.setOptions=function(a,b){var d;if(null==b&&(b=!0),!this.isNotValid(a,!1)){if(this.renderGMarker(b,function(b){return function(){var d,e,f;if(e=b.getProp("coords",a,b.model),f=b.getProp("icon",a,b.model),d=b.getProp("options",a,b.model),b.opts=b.createOptions(e,f,d),b.isLabel(b.gObject)!==b.isLabel(b.opts)&&null!=b.gObject&&(b.gManager.remove(b.gObject),b.gObject=void 0),null!=b.gObject&&b.gObject.setOptions(b.setLabelOptions(b.opts)),b.gObject||(b.isLabel(b.opts)?b.gObject=new MarkerWithLabel(b.setLabelOptions(b.opts)):b.opts.content?(b.gObject=new RichMarker(b.opts),b.gObject.getIcon=b.gObject.getContent,b.gObject.setIcon=b.gObject.setContent):b.gObject=new google.maps.Marker(b.opts),c.extend(b.gObject,{model:b.model})),b.externalListeners&&b.removeEvents(b.externalListeners),b.internalListeners&&b.removeEvents(b.internalListeners),b.externalListeners=b.setEvents(b.gObject,b.scope,b.model,["dragend"]),b.internalListeners=b.setEvents(b.gObject,{events:b.internalEvents(),$evalAsync:function(){}},b.model),null!=b.id)return b.gObject.key=b.id}}(this)),this.gObject&&(this.gObject.getMap()||this.gManager.type!==m.type))this.deferred.resolve(this.gObject);else{if(!this.gObject)return this.deferred.reject("gObject is null");null!=(d=this.gObject)&&d.getMap()&&this.gManager.type===m.type||(h.debug("gObject has no map yet"),this.deferred.resolve(this.gObject))}return this.model[this.fitKey]?this.gManager.fit():void 0}},o.prototype.setLabelOptions=function(a){return a.labelAnchor&&(a.labelAnchor=this.getLabelPositionPoint(a.labelAnchor)),a},o.prototype.internalEvents=function(){return{dragend:function(a){return function(b,c,d,e){var f,g,h;return g=a.trackModel?a.scope.model:a.model,h=a.setCoordsFromEvent(a.modelOrKey(g,a.coordsKey),a.gObject.getPosition()),g=a.setVal(d,a.coordsKey,h),f=a.scope.events,null!=(null!=f?f.dragend:void 0)&&f.dragend(b,c,g,e),a.scope.$apply()}}(this),click:function(a){return function(c,d,e,f){var g;if(g=a.getProp("click",a.scope,a.model),a.doClick&&b.isFunction(g))return a.scope.$evalAsync(g(c,d,a.model,f))}}(this)}},o}(f)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygonChildModel",["uiGmapBasePolyChildModel","uiGmapPolygonOptionsBuilder",function(b,c){var d,e,f;return f=function(a){return new google.maps.Polygon(a)},e=new b(c,f),d=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolylineChildModel",["uiGmapBasePolyChildModel","uiGmapPolylineOptionsBuilder",function(b,c){var d,e,f;return f=function(a){return new google.maps.Polyline(a)},e=b(c,f),d=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c}(e)}])}.call(this),function(){var d=function(a,b){return function(){return a.apply(b,arguments)}},e=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},f={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapWindowChildModel",["uiGmapBaseObject","uiGmapGmapUtil","uiGmapLogger","$compile","$http","$templateCache","uiGmapChromeFixes","uiGmapEventsHelper",function(f,g,h,i,j,k,l,m){var n;return n=function(f){function n(a){this.updateModel=d(this.updateModel,this),this.destroy=d(this.destroy,this),this.remove=d(this.remove,this),this.getLatestPosition=d(this.getLatestPosition,this),this.hideWindow=d(this.hideWindow,this),this.showWindow=d(this.showWindow,this),this.handleClick=d(this.handleClick,this),this.watchOptions=d(this.watchOptions,this),this.watchCoords=d(this.watchCoords,this),this.createGWin=d(this.createGWin,this),this.watchElement=d(this.watchElement,this),this.watchAndDoShow=d(this.watchAndDoShow,this),this.doShow=d(this.doShow,this);var b,e,f,g,i;this.model=null!=(e=a.model)?e:{},this.scope=a.scope,this.opts=a.opts,this.isIconVisibleOnClick=a.isIconVisibleOnClick,this.gMap=a.gMap,this.markerScope=a.markerScope,this.element=a.element,this.needToManualDestroy=null!=(f=a.needToManualDestroy)&&f,this.markerIsVisibleAfterWindowClose=null==(g=a.markerIsVisibleAfterWindowClose)||g,this.isScopeModel=null!=(i=a.isScopeModel)&&i,this.isScopeModel&&(this.clonedModel=c.clone(this.model,!0)),this.getGmarker=function(){var a,b;if(null!=(null!=(a=this.markerScope)?a.getGMarker:void 0))return null!=(b=this.markerScope)?b.getGMarker():void 0},this.listeners=[],this.createGWin(),b=this.getGmarker(),null!=b&&b.setClickable(!0),this.watchElement(),this.watchOptions(),this.watchCoords(),this.watchAndDoShow(),this.scope.$on("$destroy",function(a){return function(){return a.destroy()}}(this)),h.info(this)}return e(n,f),n.include(g),n.include(m),n.prototype.doShow=function(a){return this.scope.show===!0||a?this.showWindow():this.hideWindow()},n.prototype.watchAndDoShow=function(){return null!=this.model.show&&(this.scope.show=this.model.show),this.scope.$watch("show",this.doShow,!0),this.doShow()},n.prototype.watchElement=function(){return this.scope.$watch(function(a){return function(){var b,c;if(a.element||a.html)return a.html!==a.element.html()&&a.gObject?(null!=(b=a.opts)&&(b.content=void 0),c=a.gObject.isOpen(),a.remove(),a.createGWin(c)):void 0}}(this))},n.prototype.createGWin=function(b){var d,e,f,g,h;if(null==b&&(b=!1),f=this.getGmarker(),e={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),e=this.opts),this.element&&(this.html=c.isObject(this.element)?this.element.html():this.element),d=this.scope.options?this.scope.options:e,this.opts=this.createWindowOptions(f,this.markerScope||this.scope,this.html,d),null!=this.opts)return this.gObject||(this.opts.boxClass&&a.InfoBox&&"function"==typeof a.InfoBox?this.gObject=new a.InfoBox(this.opts):this.gObject=new google.maps.InfoWindow(this.opts),this.listeners.push(google.maps.event.addListener(this.gObject,"domready",function(){return l.maybeRepaint(this.content)})),this.listeners.push(google.maps.event.addListener(this.gObject,"closeclick",function(a){return function(){return f&&(f.setAnimation(a.oldMarkerAnimation),a.markerIsVisibleAfterWindowClose&&c.delay(function(){return f.setVisible(!1),f.setVisible(a.markerIsVisibleAfterWindowClose)},250)),a.gObject.close(),a.model.show=!1,null!=a.scope.closeClick?a.scope.$evalAsync(a.scope.closeClick()):a.scope.$evalAsync()}}(this)))),this.gObject.setContent(this.opts.content),this.handleClick((null!=(g=this.scope)&&null!=(h=g.options)?h.forceClick:void 0)||b),this.doShow(this.gObject.isOpen())},n.prototype.watchCoords=function(){var a;return a=null!=this.markerScope?this.markerScope:this.scope,a.$watch("coords",function(a){return function(b,c){var d;if(b!==c){if(null==b)a.hideWindow();else if(!a.validateCoords(b))return void h.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(a.model));if(d=a.getCoords(b),a.doShow(),a.gObject.setPosition(d),a.opts)return a.opts.position=d}}}(this),!0)},n.prototype.watchOptions=function(){return this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&(a.opts=b,null!=a.gObject)){if(a.gObject.setOptions(a.opts),null!=a.opts.visible&&a.opts.visible)return a.showWindow();if(null!=a.opts.visible)return a.hideWindow()}}}(this),!0)},n.prototype.handleClick=function(a){var b,c;if(null!=this.gObject)return c=this.getGmarker(),b=function(a){return function(){if(null==a.gObject&&a.createGWin(),a.showWindow(),null!=c)return a.initialMarkerVisibility=c.getVisible(),a.oldMarkerAnimation=c.getAnimation(),c.setVisible(a.isIconVisibleOnClick)}}(this),a&&b(),c?this.listeners=this.listeners.concat(this.setEvents(c,{events:{click:b}},this.model)):void 0},n.prototype.showWindow=function(){var a,c,d;if(null!=this.gObject)return d=null,c=function(a){return function(){var b,c,d;if(!a.gObject.isOpen()){if(c=a.getGmarker(),null!=a.gObject&&null!=a.gObject.getPosition&&(d=a.gObject.getPosition()),c&&(d=c.getPosition()),!d)return;if(a.gObject.open(a.gMap,c),b=a.gObject.isOpen(),a.model.show!==b)return a.model.show=b}}}(this),this.scope.templateUrl?j.get(this.scope.templateUrl,{cache:k}).then(function(a){return function(e){var f;return d=a.scope.$new(),b.isDefined(a.scope.templateParameter)&&(d.parameter=a.scope.templateParameter),f=i(e.data)(d),a.gObject.setContent(f[0]),c()}}(this)):this.scope.template?(d=this.scope.$new(),b.isDefined(this.scope.templateParameter)&&(d.parameter=this.scope.templateParameter),a=i(this.scope.template)(d),this.gObject.setContent(a[0]),c()):c(),this.scope.$on("destroy",function(){return d.$destroy()})},n.prototype.hideWindow=function(){if(null!=this.gObject&&this.gObject.isOpen())return this.gObject.close()},n.prototype.getLatestPosition=function(a){var b;return b=this.getGmarker(),null==this.gObject||null==b||a?a?this.gObject.setPosition(a):void 0:this.gObject.setPosition(b.getPosition())},n.prototype.remove=function(){return this.hideWindow(),this.removeEvents(this.listeners),this.listeners.length=0,delete this.gObject,delete this.opts},n.prototype.destroy=function(a){var b;if(null==a&&(a=!1),this.remove(),null!=this.scope&&!(null!=(b=this.scope)?b.$$destroyed:void 0)&&(this.needToManualDestroy||a))return this.scope.$destroy()},n.prototype.updateModel=function(a){return this.isScopeModel&&(this.clonedModel=c.clone(a,!0)),c.extend(this.model,this.clonedModel||a)},n}(f)}])}.call(this),
8
function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapBasePolysParentModel",["$timeout","uiGmapLogger","uiGmapModelKey","uiGmapModelsWatcher","uiGmapPropMap","uiGmap_async","uiGmapPromise","uiGmapFitHelper",function(e,f,g,h,i,j,k,l){return function(e,m,n){var o;return o=function(g){function o(b,d,g,h,j){this.element=d,this.attrs=g,this.gMap=h,this.defaults=j,this.maybeFit=a(this.maybeFit,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchDestroy=a(this.watchDestroy,this),this.onDestroy=a(this.onDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),o.__super__.constructor.call(this,b),this.interface=e,this.$log=f,this.plurals=new i,c.each(e.scopeKeys,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.models=void 0,this.firstTime=!0,this.$log.info(this),this.createChildScopes()}return d(o,g),o.include(h),o.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){if(c!==d)return b.doINeedToWipe(c)||a.doRebuildAll?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)}}(this),!0)},o.prototype.doINeedToWipe=function(a){var b;return b=null==a||0===a.length,this.plurals.length>0&&b},o.prototype.rebuildAll=function(a,b,c){return this.onDestroy(c).then(function(a){return function(){if(b)return a.createChildScopes()}}(this))},o.prototype.onDestroy=function(){return o.__super__.onDestroy.call(this,this.scope),j.promiseLock(this,k.promiseTypes.delete,void 0,void 0,function(a){return function(){return j.each(a.plurals.values(),function(a){return a.destroy(!0)},j.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){var b;return null!=(b=a.plurals)?b.removeAll():void 0})}}(this))},o.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.rebuildAll(a,!1,!0)}}(this))},o.prototype.createChildScopes=function(a){return null==a&&(a=!0),b.isUndefined(this.scope.models)?void this.$log.error("No models to create "+n+"s from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},o.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){if(c!==d&&null==c)return b.idKey=c,b.rebuildAll(a,!0,!0)}}(this))},o.prototype.createAllNew=function(a,b){var c;if(null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),!this.didQueueInitPromise(this,a))return c=null,j.promiseLock(this,k.promiseTypes.create,"createAllNew",function(a){return c=a},function(b){return function(){return j.map(a.models,function(a){var d;return d=b.createChild(a,b.gMap),c&&(f.debug("createNew should fall through safely"),d.isEnabled=!1),d.pathPoints.getArray()},j.chunkSizeFrom(a.chunk)).then(function(a){return b.maybeFit(a),b.firstTime=!1})}}(this))},o.prototype.pieceMeal=function(a,b){var d,e;if(null==b&&(b=!0),!a.$$destroyed)return d=null,e=null,this.models=a.models,null!=a&&this.modelsLength()&&this.plurals.length?j.promiseLock(this,k.promiseTypes.update,"pieceMeal",function(a){return d=a},function(b){return function(){return k.promise(function(){return b.figureOutState(b.idKey,a,b.plurals,b.modelKeyComparison)}).then(function(f){return e=f,e.updates.length&&j.each(e.updates,function(a){return c.extend(a.child.scope,a.model),a.child.model=a.model}),j.each(e.removals,function(a){if(null!=a)return a.destroy(),b.plurals.remove(a.model[b.idKey]),d},j.chunkSizeFrom(a.chunk))}).then(function(){return j.each(e.adds,function(a){return d&&f.debug("pieceMeal should fall through safely"),b.createChild(a,b.gMap),d},j.chunkSizeFrom(a.chunk)).then(function(){return b.maybeFit()})})}}(this)):(this.inProgress=!1,this.rebuildAll(this.scope,!0,!0))},o.prototype.createChild=function(a,b){var c,d;return d=this.scope.$new(!1),this.setChildScope(e.scopeKeys,d,a),d.$watch("model",function(a){return function(b,c){if(b!==c)return a.setChildScope(e.scopeKeys,d,b)}}(this),!0),d.static=this.scope.static,c=new m({isScopeModel:!0,scope:d,attrs:this.attrs,gMap:b,defaults:this.defaults,model:a,gObjectChangeCb:function(a){return function(){return a.maybeFit()}}(this)}),null==a[this.idKey]?void this.$log.error(n+" model has no id to assign a child to.\nThis is required for performance. Please assign id,\nor redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},o.prototype.maybeFit=function(a){if(null==a&&(a=this.plurals.map(function(a){return a.pathPoints})),this.scope.fit)return a=c.flatten(a),l.fit(a,this.gMap)},o}(g)}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapCircleParentModel",["uiGmapLogger","$timeout","uiGmapGmapUtil","uiGmapEventsHelper","uiGmapCircleOptionsBuilder",function(d,e,f,g,h){var i,j;return j=function(a,b){return a.settingFromDirective=!0,b(),e(function(){return a.settingFromDirective=!1})},i=function(e){function h(a,e,g,h,i){var k,l,m;this.attrs=g,this.gMap=h,this.DEFAULTS=i,this.scope=a,m=null,k=function(a){return function(){if(m=null,null!=a.listeners)return a.removeEvents(a.listeners),a.listeners=void 0}}(this),l=new google.maps.Circle(this.buildOpts(f.getCoords(a.center),a.radius)),this.setMyOptions=function(b){return function(d,e){if(!a.settingFromDirective)return!c.isEqual(d,e)||d!==e||null!=d&&null!=e&&d.coordinates!==e.coordinates?l.setOptions(b.buildOpts(f.getCoords(a.center),a.radius)):void 0}}(this),this.props=this.props.concat([{prop:"center",isColl:!0},{prop:"fill",isColl:!0},"radius","zIndex"]),this.watchProps(),null!=this.scope.control&&(this.scope.control.getCircle=function(){return l}),k(),this.listeners=this.setEvents(l,a,a,["radius_changed"])||[],this.listeners.push(google.maps.event.addListener(l,"radius_changed",function(){var d,e;if(d=l.getRadius(),d!==m)return m=d,e=function(){return j(a,function(){var b,e;if(d!==a.radius&&(a.radius=d),(null!=(b=a.events)?b.radius_changed:void 0)&&c.isFunction(null!=(e=a.events)?e.radius_changed:void 0))return a.events.radius_changed(l,"radius_changed",a,arguments)})},b.mock?e():a.$evalAsync(function(){return e()})})),this.listeners.push(google.maps.event.addListener(l,"center_changed",function(){return a.$evalAsync(function(){return j(a,function(){return b.isDefined(a.center.type)?(a.center.coordinates[1]=l.getCenter().lat(),a.center.coordinates[0]=l.getCenter().lng()):(a.center.latitude=l.getCenter().lat(),a.center.longitude=l.getCenter().lng())})})})),a.$on("$destroy",function(){return k(),l.setMap(null)}),d.info(this)}return a(h,e),h.include(f),h.include(g),h}(h)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapDrawingManagerParentModel",["uiGmapLogger","$timeout","uiGmapBaseObject","uiGmapEventsHelper",function(b,d,e,f){var g;return g=function(b){function d(a,b,d,e){var f,g;this.scope=a,this.attrs=d,this.map=e,f=new google.maps.drawing.DrawingManager(this.scope.options),f.setMap(this.map),g=void 0,null!=this.scope.control&&(this.scope.control.getDrawingManager=function(){return f}),!this.scope.static&&this.scope.options&&this.scope.$watch("options",function(a){return null!=f?f.setOptions(a):void 0},!0),null!=this.scope.events&&(g=this.setEvents(f,this.scope,this.scope),this.scope.$watch("events",function(a){return function(b,d){if(!c.isEqual(b,d))return null!=g&&a.removeEvents(g),g=a.setEvents(f,a.scope,a.scope)}}(this))),this.scope.$on("$destroy",function(a){return function(){return null!=g&&a.removeEvents(g),f.setMap(null),f=null}}(this))}return a(d,b),d.include(f),d}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIMarkerParentModel",["uiGmapModelKey","uiGmapLogger",function(e,f){var g;return g=function(e){function g(c,d,e,h){if(this.scope=c,this.element=d,this.attrs=e,this.map=h,this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),g.__super__.constructor.call(this,this.scope),this.$log=f,!this.validateScope(this.scope))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=b.isDefined(this.attrs.click),null!=this.scope.options&&(this.DEFAULTS=this.scope.options),this.watch("coords",this.scope),this.watch("icon",this.scope),this.watch("options",this.scope),this.scope.$on("$destroy",function(a){return function(){return a.onDestroy(a.scope)}}(this))}return d(g,e),g.prototype.DEFAULTS={},g.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},g.prototype.watch=function(a,b,d){return null==d&&(d=!0),b.$watch(a,function(d){return function(e,f){if(!c.isEqual(e,f))return d.onWatch(a,b,e,f)}}(this),d)},g.prototype.onWatch=function(a,b,c,d){},g}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIWindowParentModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger",function(b,c,d){var e;return e=function(b){function e(a,b,c,f,g,h,i,j){e.__super__.constructor.call(this,a),this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,this.DEFAULTS={},null!=a.options&&(this.DEFAULTS=a.options)}return a(e,b),e.include(c),e.prototype.getItem=function(a,b,c){return"models"===b?a[b][c]:a[b].get(c)},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapLayerParentModel",["uiGmapBaseObject","uiGmapLogger","$timeout",function(d,e,f){var g;return g=function(d){function f(c,d,f,g,h,i){return this.scope=c,this.element=d,this.attrs=f,this.gMap=g,this.onLayerCreated=null!=h?h:void 0,this.$log=null!=i?i:e,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.doShow=!0,b.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.gObject.setMap(this.gMap),this.scope.$watch("show",function(a){return function(b,c){if(b!==c)return a.doShow=b,b?a.gObject.setMap(a.gMap):a.gObject.setMap(null)}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&a.doShow)return a.gObject.setOptions(b)}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.gObject.setMap(null)}}(this)))}return c(f,d),f.prototype.createGoogleLayer=function(){var a;if(null==this.attrs.options?this.gObject=void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:this.gObject=void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),null!=this.gObject&&this.doShow&&this.gObject.setMap(this.gMap),null!=this.gObject&&null!=this.onLayerCreated)return"function"==typeof(a=this.onLayerCreated(this.scope,this.gObject))?a(this.gObject):void 0},f}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMapTypeParentModel",["uiGmapBaseObject","uiGmapLogger",function(e,f){var g;return g=function(e){function g(d,e,g,h,i,j,k){var l,m,n,o;return this.scope=d,this.element=e,this.attrs=g,this.gMap=h,this.$log=null!=i?i:f,this.childModel=j,this.propMap=k,this.refreshShown=a(this.refreshShown,this),this.hideOverlay=a(this.hideOverlay,this),this.showOverlay=a(this.showOverlay,this),this.refreshMapType=a(this.refreshMapType,this),this.createMapType=a(this.createMapType,this),null==this.scope.options?void this.$log.info("options attribute for the map-type directive is mandatory. Map type creation aborted!!"):(this.id=this.gMap.overlayMapTypesCount=this.gMap.overlayMapTypesCount+1||0,this.doShow=!0,this.createMapType(),this.refreshShown(),this.doShow&&null!=this.gMap&&this.showOverlay(),m=function(a){return function(){return a.childModel[a.attrs.show]}}(this),o=this.childModel?m:"show",this.scope.$watch(o,function(a){return function(b,c){if(b!==c)return a.doShow=b,b?a.showOverlay():a.hideOverlay()}}(this)),l=function(a){return function(){return a.childModel[a.attrs.options]}}(this),n=this.childModel?l:"options",this.scope.$watchCollection(n,function(a){return function(b,d){var e,f;if(!c.isEqual(b,d)&&(f=["tileSize","maxZoom","minZoom","name","alt"],e=c.some(f,function(a){return!d||!b||!c.isEqual(b[a],d[a])})))return a.refreshMapType()}}(this)),b.isDefined(this.attrs.refresh)&&this.scope.$watch("refresh",function(a){return function(b,d){if(!c.isEqual(b,d))return a.refreshMapType()}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.hideOverlay(),a.mapType=null}}(this)))}return d(g,e),g.prototype.createMapType=function(){var a,c,d;if(d=this.childModel?this.attrs.options?this.childModel[this.attrs.options]:this.childModel:this.scope.options,null!=d.getTile)this.mapType=d;else{if(null==d.getTileUrl)return void this.$log.info("options should provide either getTile or getTileUrl methods. Map type creation aborted!!");this.mapType=new google.maps.ImageMapType(d)}if(c=this.attrs.id?this.childModel?this.attrs.id:"id":void 0,a=c?this.childModel?this.childModel[c]:this.scope[c]:void 0,a&&(this.gMap.mapTypes.set(a,this.mapType),b.isDefined(this.attrs.show)||(this.doShow=!1)),this.mapType.layerId=this.id,this.childModel&&b.isDefined(this.scope.index))return this.propMap.put(this.mapType.layerId,this.scope.index)},g.prototype.refreshMapType=function(){if(this.hideOverlay(),this.mapType=null,this.createMapType(),this.doShow&&null!=this.gMap)return this.showOverlay()},g.prototype.showOverlay=function(){var a;return b.isDefined(this.scope.index)?(a=!1,this.gMap.overlayMapTypes.getLength()?(this.gMap.overlayMapTypes.forEach(function(c){return function(d,e){var f;a||(f=c.propMap.get(d.layerId.toString()),(f>c.scope.index||!b.isDefined(f))&&(a=!0,c.gMap.overlayMapTypes.insertAt(e,c.mapType)))}}(this)),a?void 0:this.gMap.overlayMapTypes.push(this.mapType)):this.gMap.overlayMapTypes.push(this.mapType)):this.gMap.overlayMapTypes.push(this.mapType)},g.prototype.hideOverlay=function(){var a;return a=!1,this.gMap.overlayMapTypes.forEach(function(b){return function(c,d){a||c.layerId!==b.id||(a=!0,b.gMap.overlayMapTypes.removeAt(d))}}(this))},g.prototype.refreshShown=function(){return this.doShow=!b.isDefined(this.attrs.show)||(this.childModel?this.childModel[this.attrs.show]:this.scope.show)},g}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMapTypesParentModel",["uiGmapBaseObject","uiGmapLogger","uiGmapMapTypeParentModel","uiGmapPropMap",function(b,c,d,e){var f;return f=function(b){function f(a,b,f,g,h){var i;return this.scope=a,this.element=b,this.attrs=f,this.gMap=g,this.$log=null!=h?h:c,null==this.attrs.mapTypes?void this.$log.info("layers attribute for the map-types directive is mandatory. Map types creation aborted!!"):(i=new e,void this.scope.mapTypes.forEach(function(a){return function(b,c){var e,f;f={options:a.scope.options,show:a.scope.show,refresh:a.scope.refresh},e=a.scope.$new(),e.index=c,new d(e,null,f,a.gMap,a.$log,b,i)}}(this)))}return a(f,b),f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMarkersParentModel",["uiGmapIMarkerParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapMarkerChildModel","uiGmap_async","uiGmapClustererMarkerManager","uiGmapMarkerManager","$timeout","uiGmapIMarker","uiGmapPromise","uiGmapGmapUtil","uiGmapLogger","uiGmapSpiderfierMarkerManager",function(e,f,g,h,i,j,k,l,m,n,o,p,q){var r,s;return s=function(a,b){return b.plurals=new g,b.scope.plurals=b.plurals,b},r=function(e){function l(b,d,e,f){this.maybeExecMappedEvent=a(this.maybeExecMappedEvent,this),this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.pieceMeal=a(this.pieceMeal,this),this.rebuildAll=a(this.rebuildAll,this),this.createAllNew=a(this.createAllNew,this),this.bindToTypeEvents=a(this.bindToTypeEvents,this),this.createChildScopes=a(this.createChildScopes,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this),l.__super__.constructor.call(this,b,d,e,f),this.interface=m,s(new g,this),this.scope.pluralsUpdate={updateCtr:0},this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll&&this.scope.doRebuildAll,this.setIdKey(this.scope),this.scope.$watch("doRebuildAll",function(a){return function(b,c){if(b!==c)return a.doRebuildAll=b}}(this)),this.modelsLength()||(this.modelsRendered=!1),this.scope.$watch("models",function(a){return function(b,d){if(!c.isEqual(b,d)||!a.modelsRendered){if(0===b.length&&0===d.length)return;return a.modelsRendered=!0,a.onWatch("models",a.scope,b,d)}}}(this),!this.isTrue(e.modelsbyref)),this.watch("doCluster",this.scope),this.watch("type",this.scope),this.watch("clusterOptions",this.scope),this.watch("clusterEvents",this.scope),this.watch("typeOptions",this.scope),this.watch("typeEvents",this.scope),this.watch("fit",this.scope),this.watch("idKey",this.scope),this.gManager=void 0,this.createAllNew(this.scope)}return d(l,e),l.include(o),l.include(f),l.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll||"doCluster"===a||"type"===a?this.rebuildAll(b):this.pieceMeal(b)},l.prototype.validateScope=function(a){var c;return c=b.isUndefined(a.models)||void 0===a.models,c&&this.$log.error(this.constructor.name+": no valid models attribute found"),l.__super__.validateScope.call(this,a)||c},l.prototype.createChildScopes=function(a){if(null!=this.gMap&&null!=this.scope.models)return a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)},l.prototype.bindToTypeEvents=function(a,d){var e,f;return null==d&&(d=["click","mouseout","mouseover"]),f=this,this.origTypeEvents?b.extend(a,this.origTypeEvents):(this.origTypeEvents={},c.each(d,function(b){return function(c){return b.origTypeEvents[c]=null!=a?a[c]:void 0}}(this))),e={},c.each(d,function(a){return e[a]=function(b){return f.maybeExecMappedEvent(b,a)}}),b.extend(a,e)},l.prototype.createAllNew=function(a){var b,c,d,e;if(null!=this.gManager&&(this.gManager instanceof q&&(b=this.gManager.isSpiderfied()),this.gManager.clear(),delete this.gManager),d=a.typeEvents||a.clusterEvents,e=a.typeOptions||a.clusterOptions,a.doCluster||"cluster"===a.type?(null!=d&&this.bindToTypeEvents(d),this.gManager=new j(this.map,void 0,e,d)):"spider"===a.type?(null!=d&&this.bindToTypeEvents(d,["spiderfy","unspiderfy"]),this.gManager=new q(this.map,void 0,e,d,this.scope),b&&this.gManager.spiderfy()):this.gManager=new k(this.map),!this.didQueueInitPromise(this,a))return c=null,i.promiseLock(this,n.promiseTypes.create,"createAllNew",function(a){return c=a},function(b){return function(){return i.each(a.models,function(d){return b.newChildMarker(d,a),c},i.chunkSizeFrom(a.chunk)).then(function(){return b.modelsRendered=!0,a.fit&&b.gManager.fit(),b.gManager.draw(),b.scope.pluralsUpdate.updateCtr+=1},i.chunkSizeFrom(a.chunk))}}(this))},l.prototype.rebuildAll=function(a){var b;if(a.doRebuild||void 0===a.doRebuild)return(null!=(b=this.scope.plurals)?b.length:void 0)?this.onDestroy(a).then(function(b){return function(){return b.createAllNew(a)}}(this)):this.createAllNew(a)},l.prototype.pieceMeal=function(a){var b,c;if(!a.$$destroyed)return b=null,c=null,this.modelsLength()&&this.scope.plurals.length?i.promiseLock(this,n.promiseTypes.update,"pieceMeal",function(a){return b=a},function(d){return function(){return n.promise(function(){return d.figureOutState(d.idKey,a,d.scope.plurals,d.modelKeyComparison)}).then(function(e){return c=e,i.each(c.removals,function(a){if(null!=a)return null!=a.destroy&&a.destroy(),d.scope.plurals.remove(a.id),b},i.chunkSizeFrom(a.chunk))}).then(function(){return i.each(c.adds,function(c){return d.newChildMarker(c,a),b},i.chunkSizeFrom(a.chunk))}).then(function(){return i.each(c.updates,function(a){return d.updateChild(a.child,a.model),b},i.chunkSizeFrom(a.chunk))}).then(function(){return(c.adds.length>0||c.removals.length>0||c.updates.length>0)&&(a.plurals=d.scope.plurals,a.fit&&d.gManager.fit(),d.gManager.draw()),d.scope.pluralsUpdate.updateCtr+=1})}}(this)):(this.inProgress=!1,this.rebuildAll(a))},l.prototype.newChildMarker=function(a,b){var c,d,e;if(!a)throw"model undefined";return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),d=b.$new(!1),d.events=b.events,e={},m.scopeKeys.forEach(function(a){return e[a]=b[a]}),c=new h({scope:d,model:a,keys:e,gMap:this.map,defaults:this.DEFAULTS,doClick:this.doClick,gManager:this.gManager,doDrawSelf:!1,isScopeModel:!0}),this.scope.plurals.put(a[this.idKey],c),c)},l.prototype.onDestroy=function(a){return l.__super__.onDestroy.call(this,a),i.promiseLock(this,n.promiseTypes.delete,void 0,void 0,function(a){return function(){return i.each(a.scope.plurals.values(),function(a){if(null!=a)return a.destroy(!1)},i.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){return null!=a.gManager&&a.gManager.destroy(),a.plurals.removeAll(),a.plurals!==a.scope.plurals&&console.error("plurals out of sync for MarkersParentModel"),a.scope.pluralsUpdate.updateCtr+=1})}}(this))},l.prototype.maybeExecMappedEvent=function(a,b){var d,e;if(!this.scope.$$destroyed)return e=this.scope.typeEvents||this.scope.clusterEvents,c.isFunction(null!=e?e[b]:void 0)&&(d=this.mapTypeToPlurals(a),this.origTypeEvents[b])?this.origTypeEvents[b](d.group,d.mapped):void 0},l.prototype.mapTypeToPlurals=function(a){var b,d,e;return c.isArray(a)?b=a:c.isFunction(a.getMarkers)&&(b=a.getMarkers()),null==b?void p.error("Unable to map event as we cannot find the array group to map"):(d=(null!=(e=this.scope.plurals.values())?e.length:void 0)?b.map(function(a){return function(b){return a.scope.plurals.get(b.key).model}}(this)):[],{cluster:a,mapped:d,group:a})},l.prototype.getItem=function(a,b,c){return"models"===b?a[b][c]:a[b].get(c)},l}(e)}])}.call(this),function(){["Polygon","Polyline"].forEach(function(a){return b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmap"+a+"sParentModel",["uiGmapBasePolysParentModel","uiGmap"+a+"ChildModel","uiGmapI"+a,function(b,c,d){return b(d,c,a)}])})}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapRectangleParentModel",["uiGmapLogger","uiGmapGmapUtil","uiGmapEventsHelper","uiGmapRectangleOptionsBuilder",function(b,d,e,f){var g;return g=function(f){function g(a,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;this.scope=a,this.attrs=e,this.gMap=f,this.DEFAULTS=g,h=void 0,k=!1,p=[],o=void 0,l=function(a){return function(){if(a.isTrue(a.attrs.fit))return a.fitMapBounds(a.gMap,h)}}(this),j=function(a){return function(){var c,d,e;return null!=a.scope.bounds&&null!=(null!=(c=a.scope.bounds)?c.sw:void 0)&&null!=(null!=(d=a.scope.bounds)?d.ne:void 0)&&a.validateBoundPoints(a.scope.bounds)?(h=a.convertBoundPoints(a.scope.bounds),b.info("new new bounds created: "+JSON.stringify(h))):null!=a.scope.bounds.getNorthEast&&null!=a.scope.bounds.getSouthWest?h=a.scope.bounds:null!=a.scope.bounds?b.error("Invalid bounds for newValue: "+JSON.stringify(null!=(e=a.scope)?e.bounds:void 0)):void 0}}(this),j(),m=new google.maps.Rectangle(this.buildOpts(h)),b.info("gObject (rectangle) created: "+m),q=!1,r=function(a){return function(){var b,c,d;if(b=m.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),!q)return a.scope.$evalAsync(function(a){if(null!=a.bounds&&null!=a.bounds.sw&&null!=a.bounds.ne&&(a.bounds.ne={latitude:c.lat(),longitude:c.lng()},a.bounds.sw={latitude:d.lat(),longitude:d.lng()}),null!=a.bounds.getNorthEast&&null!=a.bounds.getSouthWest)return a.bounds=b})}}(this),n=function(a){return function(){return l(),a.removeEvents(p),p.push(google.maps.event.addListener(m,"dragstart",function(){return k=!0})),p.push(google.maps.event.addListener(m,"dragend",function(){return k=!1,r()})),p.push(google.maps.event.addListener(m,"bounds_changed",function(){if(!k)return r()}))}}(this),i=function(a){return function(){return a.removeEvents(p),null!=o&&a.removeEvents(o),m.setMap(null)}}(this),null!=h&&n(),this.scope.$watch("bounds",function(a,b){var d;if(!(c.isEqual(a,b)&&null!=h||k))return q=!0,null==a?void i():(null==h?d=!0:l(),j(),m.setBounds(h),q=!1,d&&null!=h?n():void 0)},!0),this.setMyOptions=function(a){return function(b,d){if(!c.isEqual(b,d)&&null!=h&&null!=b)return m.setOptions(a.buildOpts(h))}}(this),this.props.push("bounds"),this.watchProps(this.props),null!=this.attrs.events&&(o=this.setEvents(m,this.scope,this.scope),this.scope.$watch("events",function(a){return function(b,d){if(!c.isEqual(b,d))return null!=o&&a.removeEvents(o),o=a.setEvents(m,a.scope,a.scope)}}(this))),this.scope.$on("$destroy",function(){return i()}),b.info(this)}return a(g,f),g.include(d),g.include(e),g}(f)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapSearchBoxParentModel",["uiGmapBaseObject","uiGmapLogger","uiGmapEventsHelper",function(d,e,f){var g;return g=function(d){function g(c,d,f,g,h,i,j){var k;return this.scope=c,this.element=d,this.attrs=f,this.gMap=g,this.ctrlPosition=h,this.template=i,this.$log=null!=j?j:e,this.setVisibility=a(this.setVisibility,this),this.getBounds=a(this.getBounds,this),this.setBounds=a(this.setBounds,this),this.createSearchBox=a(this.createSearchBox,this),this.addToParentDiv=a(this.addToParentDiv,this),this.addAsMapControl=a(this.addAsMapControl,this),this.init=a(this.init,this),null==this.attrs.template?void this.$log.error("template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!"):(b.isUndefined(this.scope.options)&&(this.scope.options={},this.scope.options.visible=!0),b.isUndefined(this.scope.options.visible)&&(this.scope.options.visible=!0),b.isUndefined(this.scope.options.autocomplete)&&(this.scope.options.autocomplete=!1),this.visible=this.scope.options.visible,this.autocomplete=this.scope.options.autocomplete,k=b.element("<div></div>"),k.append(this.template),this.input=k.find("input")[0],void this.init())}return c(g,d),g.include(f),g.prototype.init=function(){return this.createSearchBox(),this.scope.$watch("options",function(a){return function(c,d){if(b.isObject(c)&&(null!=c.bounds&&a.setBounds(c.bounds),null!=c.visible&&a.visible!==c.visible))return a.setVisibility(c.visible)}}(this),!0),null!=this.attrs.parentdiv?this.addToParentDiv():this.addAsMapControl(),this.visible||this.setVisibility(this.visible),this.autocomplete?this.listener=google.maps.event.addListener(this.gObject,"place_changed",function(a){return function(){return a.places=a.gObject.getPlace()}}(this)):this.listener=google.maps.event.addListener(this.gObject,"places_changed",function(a){return function(){return a.places=a.gObject.getPlaces()}}(this)),this.listeners=this.setEvents(this.gObject,this.scope,this.scope),this.$log.info(this),this.scope.$on("$stateChangeSuccess",function(a){return function(){if(null!=a.attrs.parentdiv)return a.addToParentDiv()}}(this)),this.scope.$on("$destroy",function(a){return function(){return a.gObject=null}}(this))},g.prototype.addAsMapControl=function(){return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input)},g.prototype.addToParentDiv=function(){var a;if(this.parentDiv=b.element(document.getElementById(this.scope.parentdiv)),null!=(a=this.parentDiv)?a.length:void 0)return this.parentDiv.append(this.input)},g.prototype.createSearchBox=function(){return this.autocomplete?this.gObject=new google.maps.places.Autocomplete(this.input,this.scope.options):this.gObject=new google.maps.places.SearchBox(this.input,this.scope.options)},g.prototype.setBounds=function(a){if(b.isUndefined(a.isEmpty))this.$log.error("Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.");else if(a.isEmpty()===!1&&null!=this.gObject)return this.gObject.setBounds(a)},g.prototype.getBounds=function(){return this.gObject.getBounds()},g.prototype.setVisibility=function(a){return null!=this.attrs.parentdiv?a===!1?this.parentDiv.addClass("ng-hide"):this.parentDiv.removeClass("ng-hide"):a===!1?this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].clear():this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input),this.visible=a},g}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapWindowsParentModel",["uiGmapIWindowParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapWindowChildModel","uiGmapLinked","uiGmap_async","uiGmapLogger","$timeout","$compile","$http","$templateCache","$interpolate","uiGmapPromise","uiGmapIWindow","uiGmapGmapUtil",function(e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){var t;return t=function(e){function t(b,d,e,f,h,j){this.gMap=h,this.markersScope=j,this.modelKeyComparison=a(this.modelKeyComparison,this),
9
this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.onDestroy=a(this.onDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.go=a(this.go,this),t.__super__.constructor.call(this,b,d,e,f,l,m,n,o),this.interface=r,this.plurals=new g,c.each(r.scopeKeys,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.linked=new i(b,d,e,f),this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.firstWatchModels=!0,this.$log.info(self),this.parentScope=void 0,this.go(b)}return d(t,e),t.include(f),t.prototype.go=function(a){return this.watchOurScope(a),this.doRebuildAll=null!=this.scope.doRebuildAll&&this.scope.doRebuildAll,a.$watch("doRebuildAll",function(a){return function(b,c){if(b!==c)return a.doRebuildAll=b}}(this)),this.createChildScopes()},t.prototype.watchModels=function(a){var b;return b=null!=this.markersScope?"pluralsUpdate":"models",a.$watch(b,function(b){return function(d,e){var f;if(!c.isEqual(d,e)||b.firstWatchModels)return b.firstWatchModels=!1,b.doRebuildAll||b.doINeedToWipe(a.models)?b.rebuildAll(a,!0,!0):(f=0===b.plurals.length,null!=b.existingPieces?c.last(b.existingPieces._content).then(function(){return b.createChildScopes(f)}):b.createChildScopes(f))}}(this),!0)},t.prototype.doINeedToWipe=function(a){var b;return b=null==a||0===a.length,this.plurals.length>0&&b},t.prototype.rebuildAll=function(a,b,c){return this.onDestroy(c).then(function(a){return function(){if(b)return a.createChildScopes()}}(this))},t.prototype.onDestroy=function(a){return t.__super__.onDestroy.call(this,this.scope),j.promiseLock(this,q.promiseTypes.delete,void 0,void 0,function(a){return function(){return j.each(a.plurals.values(),function(a){return a.destroy(!0)},j.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){var b;return null!=(b=a.plurals)?b.removeAll():void 0})}}(this))},t.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.firstWatchModels=!0,b.firstTime=!0,b.rebuildAll(a,!1,!0)}}(this))},t.prototype.watchOurScope=function(a){return c.each(r.scopeKeys,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c]}}(this))},t.prototype.createChildScopes=function(a){var c,d,e;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,b.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),c=b.isUndefined(this.linked.scope.models),!c||void 0!==this.markersScope&&void 0!==(null!=(d=this.markersScope)?d.plurals:void 0)&&void 0!==(null!=(e=this.markersScope)?e.models:void 0)?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNew(this.linked.scope,!1):this.pieceMeal(this.linked.scope,!1)):(this.parentScope=this.markersScope,this.watchIdKey(this.parentScope),a?this.createAllNew(this.markersScope,!0,"plurals",!1):this.pieceMeal(this.markersScope,!0,"plurals",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derived from markers!")},t.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){if(c!==d&&null==c)return b.idKey=c,b.rebuildAll(a,!0,!0)}}(this))},t.prototype.createAllNew=function(a,b,c,d){var e;if(null==c&&(c="models"),null==d&&(d=!1),this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),!this.didQueueInitPromise(this,a))return e=null,j.promiseLock(this,q.promiseTypes.create,"createAllNew",function(a){return e=a},function(d){return function(){return j.each(a.models,function(f){var g,h;return g=b&&null!=(h=d.getItem(a,c,f[d.idKey]))?h.gObject:void 0,e||(!g&&d.markersScope&&k.error("Unable to get gMarker from markersScope!"),d.createWindow(f,g,d.gMap)),e},j.chunkSizeFrom(a.chunk)).then(function(){return d.firstTime=!1})}}(this))},t.prototype.pieceMeal=function(a,b,c,d){var e,f;if(null==c&&(c="models"),null==d&&(d=!0),!a.$$destroyed)return e=null,f=null,null!=a&&this.modelsLength()&&this.plurals.length?j.promiseLock(this,q.promiseTypes.update,"pieceMeal",function(a){return e=a},function(b){return function(){return q.promise(function(){return b.figureOutState(b.idKey,a,b.plurals,b.modelKeyComparison)}).then(function(c){return f=c,j.each(f.removals,function(a){if(null!=a)return b.plurals.remove(a.id),null!=a.destroy&&a.destroy(!0),e},j.chunkSizeFrom(a.chunk))}).then(function(){return j.each(f.adds,function(d){var f,g;if(f=null!=(g=b.getItem(a,c,d[b.idKey]))?g.gObject:void 0,!f)throw"Gmarker undefined";return b.createWindow(d,f,b.gMap),e})}).then(function(){return j.each(f.updates,function(a){return b.updateChild(a.child,a.model),e},j.chunkSizeFrom(a.chunk))})}}(this)):(k.debug("pieceMeal: rebuildAll"),this.rebuildAll(this.scope,!0,!0))},t.prototype.setContentKeys=function(a){if(this.modelsLength(a))return this.contentKeys=Object.keys(a[0])},t.prototype.createWindow=function(a,b,c){var d,e,f,g,i,j;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a){return function(b,c){if(b!==c)return a.setChildScope(e,b)}}(this),!0),f={html:function(b){return function(){return b.interpolateContent(b.linked.element.html(),a)}}(this)},this.DEFAULTS=this.scopeOrModelVal(this.optionsKey,this.scope,a)||{},g=this.createWindowOptions(b,e,f.html(),this.DEFAULTS),d=new h({model:a,scope:e,opts:g,isIconVisibleOnClick:this.isIconVisibleOnClick,gMap:c,markerScope:null!=(i=this.markersScope)&&null!=(j=i.plurals.get(a[this.idKey]))?j.scope:void 0,element:f,needToManualDestroy:!1,markerIsVisibleAfterWindowClose:!0,isScopeModel:!0}),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],d),d)},t.prototype.setChildScope=function(a,b){return c.each(r.scopeKeys,function(c){return function(d){var e,f;if(e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d])return a[d]=f}}(this)),a.model=b},t.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=p(a),e={},h=this.contentKeys,d=0,g=h.length;d<g;d++)f=h[d],e[f]=b[f];return c(e)}},t.prototype.modelKeyComparison=function(a,b){var d,e;if(e=null!=this.scope.coords?this.scope:this.parentScope,null==e)throw"No scope or parentScope set!";return(d=s.equalCoords(this.evalModelHandle(a,e.coords),this.evalModelHandle(b,e.coords)))?d=c.every(c.without(this.interface.scopeKeys,"coords"),function(c){return function(d){return c.evalModelHandle(a,e[d])===c.evalModelHandle(b,e[d])}}(this)):d},t}(e)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapCircle",["uiGmapICircle","uiGmapCircleParentModel",function(a,b){return c.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return new b(a,c,d,e)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapControl",["uiGmapIControl","$http","$templateCache","$compile","$controller","uiGmapGoogleMapApi",function(d,e,f,g,h,i){var j;return j=function(j){function k(){this.link=a(this.link,this),k.__super__.constructor.call(this)}return c(k,j),k.prototype.transclude=!0,k.prototype.link=function(a,c,j,k,l){return i.then(function(c){return function(i){var j,m,n;return j=b.isUndefined(a.template),m=b.isDefined(a.index&&!isNaN(parseInt(a.index)))?parseInt(a.index):void 0,n=b.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_CENTER",i.ControlPosition[n]?d.mapPromise(a,k).then(function(d){var i,k,o;return i=void 0,k=b.element("<div></div>"),o=function(a,b,c){return c&&(b[0].index=c),a.controls[google.maps.ControlPosition[n]].push(b[0])},j?l(function(a){return k.append(a),o(d,k.children(),m)}):e.get(a.template,{cache:f}).then(function(c){var d,e,f;return d=c.data,f=a.$new(),k.append(d),b.isDefined(a.controller)&&(e=h(a.controller,{$scope:f}),k.children().data("$ngControllerController",e)),i=g(k.children())(f)}).catch(function(a){return c.$log.error("mapControl: template could not be found")}).then(function(){return o(d,i,m)})}):void c.$log.error("mapControl: invalid position property")}}(this))},k}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapDragZoom",["uiGmapCtrlHandle","uiGmapPropertyAction",function(a,b){return{restrict:"EMA",transclude:!0,template:'<div class="angular-google-map-dragzoom" ng-transclude style="display: none"></div>',require:"^uiGmapGoogleMap",scope:{keyboardkey:"=",options:"=",spec:"="},controller:["$scope","$element",function(b,d){return b.ctrlType="uiGmapDragZoom",c.extend(this,a.handle(b,d))}],link:function(c,d,e,f){return a.mapPromise(c,f).then(function(a){var d,e,f;return d=function(b){return a.enableKeyDragZoom(b)},e=new b(function(a,b){return b?d({key:b}):d()}),f=new b(function(a,b){if(b)return d(b)}),c.$watch("keyboardkey",e.sic("keyboardkey")),e.sic(c.keyboardkey),c.$watch("options",f.sic("options")),f.sic(c.options)})}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapDrawingManager",["uiGmapIDrawingManager","uiGmapDrawingManagerParentModel",function(a,b){return c.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return new b(a,c,d,e)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapApiFreeDrawPolygons",["uiGmapLogger","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapDrawFreeHandChildModel","uiGmapLodash",function(b,e,f,g,h){var i;return i=function(e){function i(){return this.link=a(this.link,this),i.__super__.constructor.apply(this,arguments)}return d(i,e),i.include(f),i.prototype.restrict="EMA",i.prototype.replace=!0,i.prototype.require="^uiGmapGoogleMap",i.prototype.scope={polygons:"=",draw:"="},i.prototype.link=function(a,d,e,f){return this.mapPromise(a,f).then(function(d){return function(d){var e,i;return a.polygons?c.isArray(a.polygons)?(e=new g(d,f.getScope()),i=void 0,a.draw=function(){return"function"==typeof i&&i(),e.engage(a.polygons).then(function(){var b;return b=!0,i=a.$watchCollection("polygons",function(a,c){var d;return b||a===c?void(b=!1):(d=h.differenceObjects(c,a),d.forEach(function(a){return a.setMap(null)}))})})}):b.error("Free Draw Polygons must be of type Array!"):b.error("No polygons to bind to!")}}(this))},i}(e)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapICircle",[function(){return{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"=",events:"=",control:"=",zIndex:"=zindex"}}}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIControl",["uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,c,d){var e;return e=function(b){function e(){this.restrict="EA",this.replace=!0,this.require="^uiGmapGoogleMap",this.scope={template:"@template",position:"@position",controller:"@controller",index:"@index"},this.$log=c}return a(e,b),e.extend(d),e.prototype.link=function(a,b,c,d){throw new Error("Not implemented!!")},e}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapIDrawingManager",[function(){return{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{static:"@",control:"=",options:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIMarker",["uiGmapBaseObject","uiGmapCtrlHandle",function(b,d){var e;return e=function(b){function e(){this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.replace=!0,this.scope=c.extend(this.scope||{},e.scope)}return a(e,b),e.scope={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit",idKey:"=idkey",control:"=control"},e.scopeKeys=c.keys(e.scope),e.keys=e.scopeKeys,e.extend(d),e}(b)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolygon",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,d,e,f){var g;return g=function(d){function g(){}return a(g,d),g.scope={path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=",static:"=",events:"=",zIndex:"=zindex",fit:"=",control:"=control"},g.scopeKeys=c.keys(g.scope),g.include(b),g.extend(f),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^uiGmapGoogleMap",g.prototype.scope=g.scope,g.prototype.DEFAULTS={},g.prototype.$log=e,g}(d)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolyline",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,d,e,f){var g;return g=function(d){function g(){}return a(g,d),g.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=",static:"=",fit:"=",events:"=",zIndex:"=zindex"},g.scopeKeys=c.keys(g.scope),g.include(b),g.extend(f),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^uiGmapGoogleMap",g.prototype.scope=g.scope,g.prototype.DEFAULTS={},g.prototype.$log=e,g}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapIRectangle",[function(){return{restrict:"EMA",require:"^uiGmapGoogleMap",replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIWindow",["uiGmapBaseObject","uiGmapChildEvents","uiGmapCtrlHandle",function(b,d,e){var f;return f=function(b){function f(){this.restrict="EMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require="^uiGmapGoogleMap",this.replace=!0,this.scope=c.extend(this.scope||{},f.scope)}return a(f,b),f.scope={coords:"=coords",template:"=template",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options",control:"=control",show:"=show"},f.scopeKeys=c.keys(f.scope),f.include(d),f.extend(e),f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMap",["$timeout","$q","$log","uiGmapGmapUtil","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapIsReady","uiGmapuuid","uiGmapExtendGWin","uiGmapExtendMarkerClusterer","uiGmapGoogleMapsUtilV3","uiGmapGoogleMapApi","uiGmapEventsHelper","uiGmapGoogleMapObjectManager",function(e,f,g,h,i,j,k,l,m,n,o,p,q,r){var s,t,u;return s=void 0,u=[o,m,n],t=function(f){function i(){this.link=a(this.link,this);var b;b=function(a){var b,d;return d=void 0,a.$on("$destroy",function(){return k.decrement()}),b=j.handle(a),a.ctrlType="Map",a.deferred.promise.then(function(){return u.forEach(function(a){return a.init()})}),b.getMap=function(){return a.map},d=c.extend(this,b)},this.controller=["$scope",b]}return d(i,f),i.include(h),i.prototype.restrict="EMA",i.prototype.transclude=!0,i.prototype.replace=!1,i.prototype.template='<div class="angular-google-map"><div class="angular-google-map-container">\n</div><div ng-transclude style="display: none"></div></div>',i.prototype.scope={center:"=",zoom:"=",dragging:"=",control:"=",options:"=",events:"=",eventOpts:"=",styles:"=",bounds:"=",update:"="},i.prototype.link=function(a,d,f){var h;return h=[],a.$on("$destroy",function(){if(q.removeEvents(h),"true"===f.recycleMapInstance&&a.map)return r.recycleMapInstance(a.map),a.map=null}),a.idleAndZoomChanged=!1,p.then(function(i){return function(j){var m,n,o,p,t,u,v,w,x,y,z,A,B,C,D,E,F;if(s={mapTypeId:j.MapTypeId.ROADMAP},C=k.spawn(),A=function(){return C.deferred.resolve({instance:C.instance,map:m})},!b.isDefined(a.center)&&!b.isDefined(a.bounds))return void g.error("angular-google-maps: a center or bounds property is required");if(b.isDefined(a.center)||(a.center=new google.maps.LatLngBounds(i.getCoords(a.bounds.southwest),i.getCoords(a.bounds.northeast)).getCenter()),b.isDefined(a.zoom)||(a.zoom=10),t=b.element(d),t.addClass("angular-google-map"),y={options:{}},f.options&&(y.options=a.options),f.styles&&(y.styles=a.styles),f.type&&(D=f.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(D)?y.mapTypeId=google.maps.MapTypeId[f.type.toUpperCase()]:g.error("angular-google-maps: invalid map type '"+f.type+"'")),w=b.extend({},s,y,{center:i.getCoords(a.center),zoom:a.zoom,bounds:a.bounds}),m="true"===f.recycleMapInstance?r.createMapInstance(t.find("div")[1],w):new google.maps.Map(t.find("div")[1],w),m.uiGmap_id=l.generate(),p=!1,h.push(google.maps.event.addListenerOnce(m,"idle",function(){return a.deferred.resolve(m),A()})),o=f.events&&null!=(null!=(z=a.events)?z.blacklist:void 0)?a.events.blacklist:[],c.isString(o)&&(o=[o]),x=function(b,d,e){if(!c.includes(o,b))return e&&e(),h.push(google.maps.event.addListener(m,b,function(){var b;if(!(null!=(b=a.update)?b.lazy:void 0))return d()}))},c.includes(o,"all")||(x("dragstart",function(){return p=!0,a.$evalAsync(function(a){if(null!=a.dragging)return a.dragging=p})}),x("dragend",function(){return p=!1,a.$evalAsync(function(a){if(null!=a.dragging)return a.dragging=p})}),E=function(d,e){var f,g;if(null==d&&(d=m.center),null==e&&(e=a),!c.includes(o,"center"))if(f=d.lat(),g=d.lng(),b.isDefined(e.center.type)){if(e.center.coordinates[1]!==f&&(e.center.coordinates[1]=f),e.center.coordinates[0]!==g)return e.center.coordinates[0]=g}else if(e.center.latitude!==f&&(e.center.latitude=f),e.center.longitude!==g)return e.center.longitude=g},B=!1,x("idle",function(){var b,d,e;return b=m.getBounds(),d=b.getNorthEast(),e=b.getSouthWest(),B=!0,a.$evalAsync(function(b){return E(),c.isUndefined(b.bounds)||c.includes(o,"bounds")||(b.bounds.northeast={latitude:d.lat(),longitude:d.lng()},b.bounds.southwest={latitude:e.lat(),longitude:e.lng()}),c.includes(o,"zoom")||(b.zoom=m.zoom,a.idleAndZoomChanged=!a.idleAndZoomChanged),B=!1})})),b.isDefined(a.events)&&null!==a.events&&b.isObject(a.events)){v=function(b){return function(){return a.events[b].apply(a,[m,b,arguments])}},n=[];for(u in a.events)a.events.hasOwnProperty(u)&&b.isFunction(a.events[u])&&n.push(google.maps.event.addListener(m,u,v(u)));h.concat(n)}return m.getOptions=function(){return w},a.map=m,null!=f.control&&null!=a.control&&(a.control.refresh=function(a){var b,c,d;if(null!=m)return null!=("undefined"!=typeof google&&null!==google&&null!=(c=google.maps)&&null!=(d=c.event)?d.trigger:void 0)&&null!=m&&google.maps.event.trigger(m,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.longitude:void 0)?(b=i.getCoords(a),i.isTrue(f.pan)?m.panTo(b):m.setCenter(b)):void 0},a.control.getGMap=function(){return m},a.control.getMapOptions=function(){return w},a.control.getCustomEventListeners=function(){return n},a.control.removeEvents=function(a){return q.removeEvents(a)}),a.$watch("center",function(b,c){var d;if(b!==c&&!B&&(d=i.getCoords(a.center),d.lat()!==m.center.lat()||d.lng()!==m.center.lng()))return p?void 0:(i.validateCoords(b)||g.error("Invalid center for newValue: "+JSON.stringify(b)),i.isTrue(f.pan)&&a.zoom===m.zoom?m.panTo(d):m.setCenter(d))},!0),F=null,a.$watch("zoom",function(b,d){var f,g;if(null!=b&&!c.isEqual(b,d)&&(null!=m?m.getZoom():void 0)!==(null!=a?a.zoom:void 0)&&!B)return null!=F&&e.cancel(F),F=e(function(){return m.setZoom(b)},(null!=(f=a.eventOpts)&&null!=(g=f.debounce)?g.zoomMs:void 0)+20,!1)}),a.$watch("bounds",function(a,b){var c,d,e,f,h,i,j;if(a!==b)return null==(null!=a&&null!=(e=a.northeast)?e.latitude:void 0)||null==(null!=a&&null!=(f=a.northeast)?f.longitude:void 0)||null==(null!=a&&null!=(h=a.southwest)?h.latitude:void 0)||null==(null!=a&&null!=(i=a.southwest)?i.longitude:void 0)?void g.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),j=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(j,d),m.fitBounds(c))}),["options","styles"].forEach(function(b){return a.$watch(b,function(a,d){if(!c.isEqual(a,d))return"options"===b?y.options=a:y.options[b]=a,null!=m?m.setOptions(y):void 0},!0)})}}(this))},i}(i)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarker",["uiGmapIMarker","uiGmapMarkerChildModel","uiGmapMarkerManager","uiGmapLogger",function(b,d,e,f){var g;return g=function(g){function h(){h.__super__.constructor.call(this),this.template='<span class="angular-google-map-marker" ng-transclude></span>',f.info(this)}return a(h,g),h.prototype.controller=["$scope","$element",function(a,d){return a.ctrlType="Marker",c.extend(this,b.handle(a,d))}],h.prototype.link=function(a,f,g,h){var i;return i=b.mapPromise(a,h),i.then(function(f){var g,h,i;if(g=new e(f),h=c.object(b.keys,b.keys),i=new d({scope:a,model:a,keys:h,gMap:f,doClick:!0,gManager:g,doDrawSelf:!1,trackModel:!1}),i.deferred.promise.then(function(b){return a.deferred.resolve(b)}),null!=a.control)return a.control.getGMarkers=g.getGMarkers}),a.$on("$destroy",function(){var a;return"undefined"!=typeof a&&null!==a&&a.clear(),a=null})},h}(b)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarkers",["uiGmapIMarker","uiGmapPlural","uiGmapMarkersParentModel","uiGmap_sync","uiGmapLogger",function(b,d,e,f,g){var h;return h=function(f){function h(){h.__super__.constructor.call(this),this.template='<span class="angular-google-map-markers" ng-transclude></span>',d.extend(this,{doCluster:"=?docluster",clusterOptions:"=clusteroptions",clusterEvents:"=clusterevents",modelsByRef:"=modelsbyref",type:"=?type",typeOptions:"=?typeoptions",typeEvents:"=?typeevents",deepComparison:"=?deepcomparison"}),g.info(this)}return a(h,f),h.prototype.controller=["$scope","$element",function(a,d){return a.ctrlType="Markers",c.extend(this,b.handle(a,d))}],h.prototype.link=function(a,f,g,h){var i,j;return i=void 0,j=function(){return a.deferred.resolve()},b.mapPromise(a,h).then(function(b){var k;return k=h.getScope(),k.$watch("idleAndZoomChanged",function(){return c.defer(i.gManager.draw)}),i=new e(a,f,g,b),d.link(a,i),null!=a.control&&(a.control.getGMarkers=function(){var a;return null!=(a=i.gManager)?a.getGMarkers():void 0},a.control.getChildMarkers=function(){return i.plurals}),c.last(i.existingPieces._content).then(function(){return j()})})},h}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapPlural",[function(){var a;return a=function(a,b){if(null!=a.control)return a.control.updateModels=function(c){return a.models=c,b.createChildScopes(!1)},a.control.newModels=function(c){return a.models=c,b.rebuildAll(a,!0,!0)},a.control.clean=function(){return b.rebuildAll(a,!1,!0)},a.control.getPlurals=function(){return b.plurals},a.control.getManager=function(){return b.gManager},a.control.hasManager=function(){return null!=b.gManager==!0},a.control.managerDraw=function(){var b;if(a.control.hasManager())return null!=(b=a.control.getManager())?b.draw():void 0}},{extend:function(a,b){return c.extend(a.scope||{},b||{},{idKey:"=idkey",doRebuildAll:"=dorebuildall",models:"=models",chunk:"=chunk",cleanchunk:"=cleanchunk",control:"=control",deepComparison:"=deepcomparison"})},link:function(b,c){return a(b,c)}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygon",["uiGmapIPolygon","$timeout","uiGmapPolygonChildModel",function(b,d,e){var f;return f=function(d){function f(){return this.link=a(this.link,this),f.__super__.constructor.apply(this,arguments)}return c(f,d),f.prototype.link=function(a,c,d,f){var g,h;return g=[],h=b.mapPromise(a,f),null!=a.control&&(a.control.getInstance=this,a.control.polygons=g,a.control.promise=h),h.then(function(b){return function(c){return g.push(new e({scope:a,attrs:d,gMap:c,defaults:b.DEFAULTS}))}}(this))},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygons",["uiGmapIPolygon","$timeout","uiGmapPolygonsParentModel","uiGmapPlural",function(d,e,f,g){var h;return h=function(d){function e(){this.link=a(this.link,this),e.__super__.constructor.call(this),g.extend(this),this.$log.info(this)}return c(e,d),e.prototype.link=function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return function(h){return(b.isUndefined(a.path)||null===a.path)&&e.$log.warn("polygons: no valid path attribute found"),a.models||e.$log.warn("polygons: no models found to create from"),g.link(a,new f(a,c,d,h,e.DEFAULTS))}}(this))},e}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolyline",["uiGmapIPolyline","$timeout","uiGmapPolylineChildModel",function(d,e,f){var g;return g=function(e){function g(){return this.link=a(this.link,this),g.__super__.constructor.apply(this,arguments)}return c(g,e),g.prototype.link=function(a,c,e,g){return d.mapPromise(a,g).then(function(c){return function(d){return!b.isUndefined(a.path)&&null!==a.path&&c.validatePath(a.path)||c.$log.warn("polyline: no valid path attribute found"),new f({scope:a,attrs:e,gMap:d,defaults:c.DEFAULTS})}}(this))},g}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolylines",["uiGmapIPolyline","$timeout","uiGmapPolylinesParentModel","uiGmapPlural",function(d,e,f,g){var h;return h=function(d){function e(){this.link=a(this.link,this),e.__super__.constructor.call(this),g.extend(this),this.$log.info(this)}return c(e,d),e.prototype.link=function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return function(h){return(b.isUndefined(a.path)||null===a.path)&&e.$log.warn("polylines: no valid path attribute found"),a.models||e.$log.warn("polylines: no models found to create from"),g.link(a,new f(a,c,d,h,e.DEFAULTS))}}(this))},e}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapRectangle",["uiGmapLogger","uiGmapGmapUtil","uiGmapIRectangle","uiGmapRectangleParentModel",function(a,b,d,e){return c.extend(d,{link:function(a,b,c,d){return d.getScope().deferred.promise.then(function(d){return new e(a,b,c,d)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindow",["uiGmapIWindow","uiGmapGmapUtil","uiGmapWindowChildModel","uiGmapLodash","uiGmapLogger",function(d,e,f,g,h){var i;return i=function(i){function j(){this.link=a(this.link,this),j.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarker"],this.template='<span class="angular-google-maps-window" ng-transclude></span>',h.debug(this),this.childWindows=[]}return c(j,i),j.include(e),j.prototype.link=function(a,c,e,f){var g,h;return g=f.length>1&&null!=f[1]?f[1]:void 0,h=null!=g?g.getScope():void 0,this.mapPromise=d.mapPromise(a,f[0]),this.mapPromise.then(function(d){return function(f){var i;return i=!0,b.isDefined(e.isiconvisibleonclick)&&(i=a.isIconVisibleOnClick),g?h.deferred.promise.then(function(b){return d.init(a,c,i,f,h)}):void d.init(a,c,i,f)}}(this))},j.prototype.init=function(a,b,c,d,e){var h,i,j,k,l;if(i=null!=a.options?a.options:{},k=null!=a&&this.validateCoords(a.coords),null!=(null!=e?e.getGMarker:void 0)&&(j=e.getGMarker()),l=k?this.createWindowOptions(j,a,b.html(),i):i,null!=d&&(h=new f({scope:a,opts:l,isIconVisibleOnClick:c,gMap:d,markerScope:e,element:b}),this.childWindows.push(h),a.$on("$destroy",function(a){return function(){return a.childWindows=g.withoutObjects(a.childWindows,[h],function(a,b){return a.scope.$id===b.scope.$id}),a.childWindows.length=0}}(this))),null!=a.control&&(a.control.getGWindows=function(a){return function(){return a.childWindows.map(function(a){return a.gObject})}}(this),a.control.getChildWindows=function(a){return function(){return a.childWindows}}(this),a.control.getPlurals=a.control.getChildWindows,a.control.showWindow=function(a){return function(){return a.childWindows.map(function(a){return a.showWindow()})}}(this),a.control.hideWindow=function(a){return function(){return a.childWindows.map(function(a){return a.hideWindow()})}}(this)),null!=this.onChildCreation&&null!=h)return this.onChildCreation(h)},j}(d)}])}.call(this),function(){var a=function(a,b){return function(){
10
return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindows",["uiGmapIWindow","uiGmapPlural","uiGmapWindowsParentModel","uiGmapPromise","uiGmapLogger",function(b,d,e,f,g){var h;return h=function(b){function h(){this.link=a(this.link,this),h.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarkers"],this.template='<span class="angular-google-maps-windows" ng-transclude></span>',d.extend(this),g.debug(this)}return c(h,b),h.prototype.link=function(a,b,c,d){var e,g,h;return e=d[0].getScope(),g=d.length>1&&null!=d[1]?d[1]:void 0,h=null!=g?g.getScope():void 0,e.deferred.promise.then(function(e){return function(g){var i,j;return i=(null!=h&&null!=(j=h.deferred)?j.promise:void 0)||f.resolve(),i.then(function(){var f,i;return f=null!=(i=e.parentModel)?i.existingPieces:void 0,f?f.then(function(){return e.init(a,b,c,d,g,h)}):e.init(a,b,c,d,g,h)})}}(this))},h.prototype.init=function(a,b,c,f,g,h){var i;if(i=new e(a,b,c,f,g,h),d.link(a,i),null!=a.control)return a.control.getGWindows=function(){return i.plurals.map(function(a){return a.gObject})},a.control.getChildWindows=function(){return i.plurals}},h}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapGoogleMap",["uiGmapMap",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMarker",["$timeout","uiGmapMarker",function(a,b){return new b(a)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMarkers",["$timeout","uiGmapMarkers",function(a,b){return new b(a)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolygon",["uiGmapPolygon",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapCircle",["uiGmapCircle",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolyline",["uiGmapPolyline",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolylines",["uiGmapPolylines",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapRectangle",["uiGmapLogger","uiGmapRectangle",function(a,b){return b}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapWindow",["$timeout","$compile","$http","$templateCache","uiGmapWindow",function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapWindows",["$timeout","$compile","$http","$templateCache","$interpolate","uiGmapWindows",function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapLayer",["$timeout","uiGmapLogger","uiGmapLayerParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template="<span class='angular-google-map-layer' ng-transclude></span>",this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return null!=a.onCreated?new d(a,b,c,e,a.onCreated):new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMapControl",["uiGmapControl",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapDragZoom",["uiGmapDragZoom",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapDrawingManager",["uiGmapDrawingManager",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapFreeDrawPolygons",["uiGmapApiFreeDrawPolygons",function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapMapType",["$timeout","uiGmapLogger","uiGmapMapTypeParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template='<span class="angular-google-map-layer" ng-transclude></span>',this.replace=!0,this.scope={show:"=show",options:"=options",refresh:"=refresh",id:"@"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapMapTypes",["$timeout","uiGmapLogger","uiGmapMapTypesParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template='<span class="angular-google-map-layers" ng-transclude></span>',this.scope={mapTypes:"=mapTypes",show:"=show",options:"=options",refresh:"=refresh",id:"=idKey"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolygons",["uiGmapPolygons",function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapSearchBox",["uiGmapGoogleMapApi","uiGmapLogger","uiGmapSearchBoxParentModel","$http","$templateCache","$compile",function(c,d,e,f,g,h){var i;return new(i=function(){function i(){this.link=a(this.link,this),this.$log=d,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template="<span class='angular-google-map-search' ng-transclude></span>",this.replace=!0,this.scope={template:"=template",events:"=events",position:"=?position",options:"=?options",parentdiv:"=?parentdiv",ngModel:"=?"}}return i.prototype.require="ngModel",i.prototype.link=function(a,d,i,j){return c.then(function(c){return function(k){return null==a.template&&(g.put("uigmap-searchbox-default.tpl.html",'<input type="text">'),a.template="uigmap-searchbox-default.tpl.html"),f.get(a.template,{cache:g}).then(function(f){var g;return g=f.data,b.isUndefined(a.events)?void c.$log.error("searchBox: the events property is required"):j.getScope().deferred.promise.then(function(f){var j;return j=b.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_LEFT",k.ControlPosition[j]?new e(a,d,i,f,j,h(g)(a)):void c.$log.error("searchBox: invalid position property")})})}}(this))},i}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapShow",["$animate","uiGmapLogger",function(a,c){return{scope:{uiGmapShow:"=",uiGmapAfterShow:"&",uiGmapAfterHide:"&"},link:function(d,e){var f,g,h;return f=function(b,c){return a[b](e,"ng-hide").then(function(){return c()})},g=function(b,c){return a[b](e,"ng-hide",c)},h=function(a,d){return b.version.major>1?c.error("uiGmapShow is not supported for Angular Major greater than 1.\nYour Major is "+b.version.major+'"'):1===b.version.major&&b.version.minor<3?g(a,d):f(a,d)},d.$watch("uiGmapShow",function(a){if(a&&h("removeClass",d.uiGmapAfterShow),!a)return h("addClass",d.uiGmapAfterHide)})}}}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapStreetViewPanorama",["uiGmapGoogleMapApi","uiGmapLogger","uiGmapGmapUtil","uiGmapEventsHelper",function(a,c,d,e){var f;return f="uiGmapStreetViewPanorama",{restrict:"EMA",template:'<div class="angular-google-map-street-view-panorama"></div>',replace:!0,scope:{focalcoord:"=",radius:"=?",events:"=?",options:"=?",control:"=?",povoptions:"=?",imagestatus:"="},link:function(g,h,i){return a.then(function(a){return function(a){var i,j,k,l,m,n,o,p,q,r;return p=void 0,r=void 0,k=!1,n=void 0,o=null,q=null,i=function(){if(e.removeEvents(n),null!=p&&(p.unbind("position"),p.setVisible(!1)),null!=r)return null!=(null!=r?r.setVisible:void 0)&&r.setVisible(!1),r=void 0},m=function(a,c){var d;return d=google.maps.geometry.spherical.computeHeading(a,c),k=!0,g.radius=g.radius||50,q=b.extend({heading:d,zoom:1,pitch:0},g.povoptions||{}),o=o=b.extend({navigationControl:!1,addressControl:!1,linksControl:!1,position:a,pov:q,visible:!0},g.options||{}),k=!1},j=function(){var a;return g.focalcoord?g.radius?(i(),null==r&&(r=new google.maps.StreetViewService),g.events&&(n=e.setEvents(r,g,g)),a=d.getCoords(g.focalcoord),r.getPanoramaByLocation(a,g.radius,function(b,c){var d,e,f;if(null!=g.imagestatus&&(g.imagestatus=c),null!=(null!=(f=g.events)?f.image_status_changed:void 0)&&g.events.image_status_changed(r,"image_status_changed",g,c),"OK"===c)return e=b.location.latLng,m(e,a),d=h[0],p=new google.maps.StreetViewPanorama(d,o)})):void c.error(f+": needs a radius to set the camera view from its focal target."):void c.error(f+": focalCoord needs to be defined")},null!=g.control&&(g.control.getOptions=function(){return o},g.control.getPovOptions=function(){return q},g.control.getGObject=function(){return r},g.control.getGPano=function(){return p}),g.$watch("options",function(a,b){if(a!==b&&a!==o&&!k)return j()}),l=!0,g.$watch("focalcoord",function(a,b){if((a!==b||l)&&null!=a)return l=!1,j()}),g.$on("$destroy",function(){return i()})}}(this))}}}])}.call(this),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapuuid",function(){function a(){}return a.generate=function(){var b=a._gri,c=a._ha;return c(b(32),8)+"-"+c(b(16),4)+"-"+c(16384|b(12),4)+"-"+c(32768|b(14),4)+"-"+c(b(48),12)},a._gri=function(a){return 0>a?NaN:30>=a?0|Math.random()*(1<<a):53>=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<<a-30)):NaN},a._ha=function(a,b){for(var c=a.toString(16),d=b-c.length,e="0";0<d;d>>>=1,e+=e)1&d&&(c=e+c);return c},a}),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapGoogleMapsUtilV3",function(){return{init:c.once(function(){+function(){function b(a,c){a.getMarkerClusterer().extend(b,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function c(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.hideLabel_=a.getHideLabel(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new b(this,a.getStyles())}function e(a,b,c){this.extend(e,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.hideLabel_=!1,void 0!==c.hideLabel&&(this.hideLabel_=c.hideLabel),this.imagePath_=c.imagePath||e.IMAGE_PATH,this.imageExtension_=c.imageExtension||e.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||e.IMAGE_SIZES,this.calculator_=c.calculator||e.CALCULATOR,this.batchSize_=c.batchSize||e.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||e.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function f(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&("undefined"==typeof a.isHidden?a.visible=!0:a.visible=!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function g(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function h(a,b,c){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=h.getSharedCross(b)}function i(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new h(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}function j(a){var b=a||{};this.ready_=!1,this.dragging_=!1,a.visible==d&&(a.visible=!0),a.shadow==d&&(a.shadow="7px -3px 5px rgba(88,88,88,0.7)"),a.anchor==d&&(a.anchor=k.BOTTOM),this.setValues(b)}b.prototype.onAdd=function(){var a,b,c=this;this.div_=document.createElement("div"),this.div_.className=this.className_,this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){b=a}),google.maps.event.addDomListener(this.div_,"mousedown",function(){a=!0,b=!1}),google.maps.event.addDomListener(this.div_,"click",function(d){if(a=!1,!b){var e,f,g=c.cluster_.getMarkerClusterer();google.maps.event.trigger(g,"click",c.cluster_),google.maps.event.trigger(g,"clusterclick",c.cluster_),g.getZoomOnClick()&&(f=g.getMaxZoom(),e=c.cluster_.getBounds(),g.getMap().fitBounds(e),setTimeout(function(){g.getMap().fitBounds(e),null!==f&&g.getMap().getZoom()>f&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},b.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},b.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},b.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},b.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="<img src='"+this.url_+"' style='position: absolute; top: "+d+"px; left: "+c+"px; ",a+=this.cluster_.getMarkerClusterer().enableRetinaIcons_?"width: "+this.width_+"px;height: "+this.height_+"px;":"clip: rect("+-1*d+"px, "+(-1*c+this.width_)+"px, "+(-1*d+this.height_)+"px, "+-1*c+"px);",a+="'>",this.div_.innerHTML=a+"<div style='position: absolute;top: "+this.anchorText_[0]+"px;left: "+this.anchorText_[1]+"px;color: "+this.textColor_+";font-size: "+this.textSize_+"px;font-family: "+this.fontFamily_+";font-weight: "+this.fontWeight_+";font-style: "+this.fontStyle_+";text-decoration: "+this.textDecoration_+";text-align: center;width: "+this.width_+"px;line-height:"+this.height_+"px;'>"+(this.cluster_.hideLabel_?" ":this.sums_.text)+"</div>",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display=""}this.visible_=!0},b.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},b.prototype.setCenter=function(a){this.center_=a},b.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.join("")},b.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},c.prototype.getSize=function(){return this.markers_.length},c.prototype.getMarkers=function(){return this.markers_},c.prototype.getCenter=function(){return this.center_},c.prototype.getMap=function(){return this.map_},c.prototype.getMarkerClusterer=function(){return this.markerClusterer_},c.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;a<c.length;a++)b.extend(c[a].getPosition());return b},c.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},c.prototype.addMarker=function(a){var b,c,d;if(this.isMarkerAlreadyAdded_(a))return!1;if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,f=(this.center_.lat()*(e-1)+a.getPosition().lat())/e,g=(this.center_.lng()*(e-1)+a.getPosition().lng())/e;this.center_=new google.maps.LatLng(f,g),this.calculateBounds_()}}else this.center_=a.getPosition(),this.calculateBounds_();if(a.isAdded=!0,this.markers_.push(a),c=this.markers_.length,d=this.markerClusterer_.getMaxZoom(),null!==d&&this.map_.getZoom()>d)a.getMap()!==this.map_&&a.setMap(this.map_);else if(c<this.minClusterSize_)a.getMap()!==this.map_&&a.setMap(this.map_);else if(c===this.minClusterSize_)for(b=0;c>b;b++)this.markers_[b].setMap(null);else a.setMap(null);return!0},c.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},c.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},c.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(a<this.minClusterSize_)return void this.clusterIcon_.hide();var c=this.markerClusterer_.getStyles().length,d=this.markerClusterer_.getCalculator()(this.markers_,c);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(d),this.clusterIcon_.show()},c.prototype.isMarkerAlreadyAdded_=function(a){for(var b=0,c=this.markers_.length;c>b;b++)if(a===this.markers_[b])return!0;return!1},e.prototype.onAdd=function(){var a=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){a.resetViewport_(!1),(this.getZoom()===(this.get("minZoom")||0)||this.getZoom()===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")}),google.maps.event.addListener(this.getMap(),"idle",function(){a.redraw_()})]},e.prototype.onRemove=function(){var a;for(a=0;a<this.markers_.length;a++)this.markers_[a].getMap()!==this.activeMap_&&this.markers_[a].setMap(this.activeMap_);for(a=0;a<this.clusters_.length;a++)this.clusters_[a].remove();for(this.clusters_=[],a=0;a<this.listeners_.length;a++)google.maps.event.removeListener(this.listeners_[a]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},e.prototype.draw=function(){},e.prototype.setupStyles_=function(){var a,b;if(!(this.styles_.length>0))for(a=0;a<this.imageSizes_.length;a++)b=this.imageSizes_[a],this.styles_.push({url:this.imagePath_+(a+1)+"."+this.imageExtension_,height:b,width:b})},e.prototype.fitMapToMarkers=function(){var a,b=this.getMarkers(),c=new google.maps.LatLngBounds;for(a=0;a<b.length;a++)c.extend(b[a].getPosition());this.getMap().fitBounds(c)},e.prototype.getGridSize=function(){return this.gridSize_},e.prototype.setGridSize=function(a){this.gridSize_=a},e.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},e.prototype.setMinimumClusterSize=function(a){this.minClusterSize_=a},e.prototype.getMaxZoom=function(){return this.maxZoom_},e.prototype.setMaxZoom=function(a){this.maxZoom_=a},e.prototype.getStyles=function(){return this.styles_},e.prototype.setStyles=function(a){this.styles_=a},e.prototype.getTitle=function(){return this.title_},e.prototype.setTitle=function(a){this.title_=a},e.prototype.getZoomOnClick=function(){return this.zoomOnClick_},e.prototype.setZoomOnClick=function(a){this.zoomOnClick_=a},e.prototype.getAverageCenter=function(){return this.averageCenter_},e.prototype.setAverageCenter=function(a){this.averageCenter_=a},e.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},e.prototype.setIgnoreHidden=function(a){this.ignoreHidden_=a},e.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},e.prototype.setEnableRetinaIcons=function(a){this.enableRetinaIcons_=a},e.prototype.getImageExtension=function(){return this.imageExtension_},e.prototype.setImageExtension=function(a){this.imageExtension_=a},e.prototype.getImagePath=function(){return this.imagePath_},e.prototype.setImagePath=function(a){this.imagePath_=a},e.prototype.getImageSizes=function(){return this.imageSizes_},e.prototype.setImageSizes=function(a){this.imageSizes_=a},e.prototype.getCalculator=function(){return this.calculator_},e.prototype.setCalculator=function(a){this.calculator_=a},e.prototype.setHideLabel=function(a){this.hideLabel_=a},e.prototype.getHideLabel=function(){return this.hideLabel_},e.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},e.prototype.setBatchSizeIE=function(a){this.batchSizeIE_=a},e.prototype.getClusterClass=function(){return this.clusterClass_},e.prototype.setClusterClass=function(a){this.clusterClass_=a},e.prototype.getMarkers=function(){return this.markers_},e.prototype.getTotalMarkers=function(){return this.markers_.length},e.prototype.getClusters=function(){return this.clusters_},e.prototype.getTotalClusters=function(){return this.clusters_.length},e.prototype.addMarker=function(a,b){this.pushMarkerTo_(a),b||this.redraw_()},e.prototype.addMarkers=function(a,b){var c;for(c in a)a.hasOwnProperty(c)&&this.pushMarkerTo_(a[c]);b||this.redraw_()},e.prototype.pushMarkerTo_=function(a){if(a.getDraggable()){var b=this;google.maps.event.addListener(a,"dragend",function(){b.ready_&&(this.isAdded=!1,b.repaint())})}a.isAdded=!1,this.markers_.push(a)},e.prototype.removeMarker=function(a,b,c){var d=!c,e=this.removeMarker_(a,d);return!b&&e&&this.repaint(),e},e.prototype.removeMarkers=function(a,b,c){var d,e,f=!1,g=!c;for(d=0;d<a.length;d++)e=this.removeMarker_(a[d],g),f=f||e;return!b&&f&&this.repaint(),f},e.prototype.removeMarker_=function(a,b){var c,d=-1;if(this.markers_.indexOf)d=this.markers_.indexOf(a);else for(c=0;c<this.markers_.length;c++)if(a===this.markers_[c]){d=c;break}return-1!==d&&(b&&a.setMap(null),this.markers_.splice(d,1),!0)},e.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},e.prototype.repaint=function(){var a=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout(function(){var b;for(b=0;b<a.length;b++)a[b].remove()},0)},e.prototype.getExtendedBounds=function(a){var b=this.getProjection(),c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng()),d=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),e=b.fromLatLngToDivPixel(c);e.x+=this.gridSize_,e.y-=this.gridSize_;var f=b.fromLatLngToDivPixel(d);f.x-=this.gridSize_,f.y+=this.gridSize_;var g=b.fromDivPixelToLatLng(e),h=b.fromDivPixelToLatLng(f);return a.extend(g),a.extend(h),a},e.prototype.redraw_=function(){this.createClusters_(0)},e.prototype.resetViewport_=function(a){var b,c;for(b=0;b<this.clusters_.length;b++)this.clusters_[b].remove();for(this.clusters_=[],b=0;b<this.markers_.length;b++)c=this.markers_[b],c.isAdded=!1,a&&c.setMap(null)},e.prototype.distanceBetweenPoints_=function(a,b){var c=6371,d=(b.lat()-a.lat())*Math.PI/180,e=(b.lng()-a.lng())*Math.PI/180,f=Math.sin(d/2)*Math.sin(d/2)+Math.cos(a.lat()*Math.PI/180)*Math.cos(b.lat()*Math.PI/180)*Math.sin(e/2)*Math.sin(e/2),g=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),h=c*g;return h},e.prototype.isMarkerInBounds_=function(a,b){return b.contains(a.getPosition())},e.prototype.addToClosestCluster_=function(a){var b,d,e,f,g=4e4,h=null;for(b=0;b<this.clusters_.length;b++)e=this.clusters_[b],f=e.getCenter(),f&&(d=this.distanceBetweenPoints_(f,a.getPosition()),g>d&&(g=d,h=e));h&&h.isMarkerInClusterBounds(a)?h.addMarker(a):(e=new c(this),e.addMarker(a),this.clusters_.push(e))},e.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);if(g<this.markers_.length)this.timerRefStatic=setTimeout(function(){e.createClusters_(g)},0);else for(delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this),b=0;b<this.clusters_.length;b++)this.clusters_[b].updateIcon_()}},e.prototype.extend=function(a,b){return function(a){var b;for(b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])},e.CALCULATOR=function(a,b){for(var c=0,d="",e=a.length.toString(),f=e;0!==f;)f=parseInt(f/10,10),c++;return c=Math.min(c,b),{text:e,index:c,title:d}},e.BATCH_SIZE=2e3,e.BATCH_SIZE_IE=500,e.IMAGE_PATH="//cdn.rawgit.com/mahnunchik/markerclustererplus/master/images/m",e.IMAGE_EXTENSION="png",e.IMAGE_SIZES=[53,56,66,78,90],"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),f.prototype=new google.maps.OverlayView,f.prototype.createInfoBoxDiv_=function(){var a,b,c,d=this,e=function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},f=function(a){a.returnValue=!1,a.preventDefault&&a.preventDefault(),d.enableEventPropagation_||e(a)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),"undefined"==typeof this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;a<b.length;a++)this.eventListeners_.push(google.maps.event.addDomListener(this.div_,b[a],e));this.eventListeners_.push(google.maps.event.addDomListener(this.div_,"mouseover",function(a){this.style.cursor="default"}))}this.contextListener_=google.maps.event.addDomListener(this.div_,"contextmenu",f),google.maps.event.trigger(this,"domready")}},f.prototype.getCloseBoxImg_=function(){var a="";return""!==this.closeBoxURL_&&(a="<img",a+=" src='"+this.closeBoxURL_+"'",a+=" align=right",a+=" style='",a+=" position: relative;",a+=" cursor: pointer;",a+=" margin: "+this.closeBoxMargin_+";",a+="'>"),a},f.prototype.addClickHandler_=function(){var a;""!==this.closeBoxURL_?(a=this.div_.firstChild,this.closeListener_=google.maps.event.addDomListener(a,"click",this.getCloseClickHandler_())):this.closeListener_=null},f.prototype.getCloseClickHandler_=function(){var a=this;return function(b){b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation(),google.maps.event.trigger(a,"closeclick"),a.close()}},f.prototype.panBox_=function(a){var b,c,d=0,e=0;if(!a&&(b=this.getMap(),b instanceof google.maps.Map)){b.getBounds().contains(this.position_)||b.setCenter(this.position_),c=b.getBounds();var f=b.getDiv(),g=f.offsetWidth,h=f.offsetHeight,i=this.pixelOffset_.width,j=this.pixelOffset_.height,k=this.div_.offsetWidth,l=this.div_.offsetHeight,m=this.infoBoxClearance_.width,n=this.infoBoxClearance_.height,o=this.getProjection().fromLatLngToContainerPixel(this.position_);if(o.x<-i+m?d=o.x+i-m:o.x+k+i+m>g&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){b.getCenter();b.panBy(d,e)}}},f.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);this.div_.style.WebkitTransform="translateZ(0)","undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*this.div_.style.opacity+')"',this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},f.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""),
11
a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},f.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},f.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.isHidden_?this.div_.style.visibility="hidden":this.div_.style.visibility="visible"},f.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},f.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},f.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},f.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},f.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},f.prototype.getContent=function(){return this.content_},f.prototype.getPosition=function(){return this.position_},f.prototype.getZIndex=function(){return this.zIndex_},f.prototype.getVisible=function(){var a;return a="undefined"!=typeof this.getMap()&&null!==this.getMap()&&!this.isHidden_},f.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},f.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},f.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},f.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;a<this.eventListeners_.length;a++)google.maps.event.removeListener(this.eventListeners_[a]);this.eventListeners_=null}this.moveListener_&&(google.maps.event.removeListener(this.moveListener_),this.moveListener_=null),this.contextListener_&&(google.maps.event.removeListener(this.contextListener_),this.contextListener_=null),this.setMap(null)},function(){function b(a,b){var c=this,d=new google.maps.OverlayView;d.onAdd=function(){c.init_(a,b)},d.draw=function(){},d.onRemove=function(){},d.setMap(a),this.prjov_=d}var c=function(a){var b;switch(a){case"thin":b="2px";break;case"medium":b="4px";break;case"thick":b="6px";break;default:b=a}return b},d=function(a){var b,d={};if(document.defaultView&&document.defaultView.getComputedStyle){if(b=a.ownerDocument.defaultView.getComputedStyle(a,""))return d.top=parseInt(b.borderTopWidth,10)||0,d.bottom=parseInt(b.borderBottomWidth,10)||0,d.left=parseInt(b.borderLeftWidth,10)||0,d.right=parseInt(b.borderRightWidth,10)||0,d}else if(document.documentElement.currentStyle&&a.currentStyle)return d.top=parseInt(c(a.currentStyle.borderTopWidth),10)||0,d.bottom=parseInt(c(a.currentStyle.borderBottomWidth),10)||0,d.left=parseInt(c(a.currentStyle.borderLeftWidth),10)||0,d.right=parseInt(c(a.currentStyle.borderRightWidth),10)||0,d;return d.top=parseInt(a.style["border-top-width"],10)||0,d.bottom=parseInt(a.style["border-bottom-width"],10)||0,d.left=parseInt(a.style["border-left-width"],10)||0,d.right=parseInt(a.style["border-right-width"],10)||0,d},e={x:0,y:0},f=function(a){e.x="undefined"!=typeof document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,e.y="undefined"!=typeof document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop};f();var g=function(b){var c=0,d=0;return b=b||a.event,"undefined"!=typeof b.pageX?(c=b.pageX,d=b.pageY):"undefined"!=typeof b.clientX&&(c=b.clientX+e.x,d=b.clientY+e.y),{left:c,top:d}},h=function(b){for(var c=b.offsetLeft,d=b.offsetTop,e=b.offsetParent;null!==e;){e!==document.body&&e!==document.documentElement&&(c-=e.scrollLeft,d-=e.scrollTop);var f=e,g=f.offsetLeft,h=f.offsetTop;if(!g&&!h&&a.getComputedStyle){var i=document.defaultView.getComputedStyle(f,null).MozTransform||document.defaultView.getComputedStyle(f,null).WebkitTransform;if(i&&"string"==typeof i){var j=i.split(",");g+=parseInt(j[4],10)||0,h+=parseInt(j[5],10)||0}}c+=g,d+=h,e=e.offsetParent}return{left:c,top:d}},i=function(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},j=function(a,b){"undefined"!=typeof b&&(a.style.opacity=b),"undefined"!=typeof a.style.opacity&&""!==a.style.opacity&&(a.style.filter="alpha(opacity="+100*a.style.opacity+")")};b.prototype.init_=function(b,c){var e,g=this;for(this.map_=b,c=c||{},this.key_=c.key||"shift",this.key_=this.key_.toLowerCase(),this.borderWidths_=d(this.map_.getDiv()),this.veilDiv_=[],e=0;e<4;e++)this.veilDiv_[e]=document.createElement("div"),this.veilDiv_[e].onselectstart=function(){return!1},i(this.veilDiv_[e].style,{backgroundColor:"gray",opacity:.25,cursor:"crosshair"}),i(this.veilDiv_[e].style,c.paneStyle),i(this.veilDiv_[e].style,c.veilStyle),i(this.veilDiv_[e].style,{position:"absolute",overflow:"hidden",display:"none"}),"shift"===this.key_&&(this.veilDiv_[e].style.MozUserSelect="none"),j(this.veilDiv_[e]),"transparent"===this.veilDiv_[e].style.backgroundColor&&(this.veilDiv_[e].style.backgroundColor="white",j(this.veilDiv_[e],0)),this.map_.getDiv().appendChild(this.veilDiv_[e]);this.noZoom_=c.noZoom||!1,this.visualEnabled_=c.visualEnabled||!1,this.visualClass_=c.visualClass||"",this.visualPosition_=c.visualPosition||google.maps.ControlPosition.LEFT_TOP,this.visualPositionOffset_=c.visualPositionOffset||new google.maps.Size(35,0),this.visualPositionIndex_=c.visualPositionIndex||null,this.visualSprite_=c.visualSprite||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/mapfiles/ftr/controls/dragzoom_btn.png",this.visualSize_=c.visualSize||new google.maps.Size(20,20),this.visualTips_=c.visualTips||{},this.visualTips_.off=this.visualTips_.off||"Turn on drag zoom mode",this.visualTips_.on=this.visualTips_.on||"Turn off drag zoom mode",this.boxDiv_=document.createElement("div"),i(this.boxDiv_.style,{border:"4px solid #736AFF"}),i(this.boxDiv_.style,c.boxStyle),i(this.boxDiv_.style,{position:"absolute",display:"none"}),j(this.boxDiv_),this.map_.getDiv().appendChild(this.boxDiv_),this.boxBorderWidths_=d(this.boxDiv_),this.listeners_=[google.maps.event.addDomListener(document,"keydown",function(a){g.onKeyDown_(a)}),google.maps.event.addDomListener(document,"keyup",function(a){g.onKeyUp_(a)}),google.maps.event.addDomListener(this.veilDiv_[0],"mousedown",function(a){g.onMouseDown_(a)}),google.maps.event.addDomListener(this.veilDiv_[1],"mousedown",function(a){g.onMouseDown_(a)}),google.maps.event.addDomListener(this.veilDiv_[2],"mousedown",function(a){g.onMouseDown_(a)}),google.maps.event.addDomListener(this.veilDiv_[3],"mousedown",function(a){g.onMouseDown_(a)}),google.maps.event.addDomListener(document,"mousedown",function(a){g.onMouseDownDocument_(a)}),google.maps.event.addDomListener(document,"mousemove",function(a){g.onMouseMove_(a)}),google.maps.event.addDomListener(document,"mouseup",function(a){g.onMouseUp_(a)}),google.maps.event.addDomListener(a,"scroll",f)],this.hotKeyDown_=!1,this.mouseDown_=!1,this.dragging_=!1,this.startPt_=null,this.endPt_=null,this.mapWidth_=null,this.mapHeight_=null,this.mousePosn_=null,this.mapPosn_=null,this.visualEnabled_&&(this.buttonDiv_=this.initControl_(this.visualPositionOffset_),null!==this.visualPositionIndex_&&(this.buttonDiv_.index=this.visualPositionIndex_),this.map_.controls[this.visualPosition_].push(this.buttonDiv_),this.controlIndex_=this.map_.controls[this.visualPosition_].length-1)},b.prototype.initControl_=function(a){var b,c,d=this;return b=document.createElement("div"),b.className=this.visualClass_,b.style.position="relative",b.style.overflow="hidden",b.style.height=this.visualSize_.height+"px",b.style.width=this.visualSize_.width+"px",b.title=this.visualTips_.off,c=document.createElement("img"),c.src=this.visualSprite_,c.style.position="absolute",c.style.left=-(2*this.visualSize_.width)+"px",c.style.top="0px",b.appendChild(c),b.onclick=function(a){d.hotKeyDown_=!d.hotKeyDown_,d.hotKeyDown_?(d.buttonDiv_.firstChild.style.left=-(0*d.visualSize_.width)+"px",d.buttonDiv_.title=d.visualTips_.on,d.activatedByControl_=!0,google.maps.event.trigger(d,"activate")):(d.buttonDiv_.firstChild.style.left=-(2*d.visualSize_.width)+"px",d.buttonDiv_.title=d.visualTips_.off,google.maps.event.trigger(d,"deactivate")),d.onMouseMove_(a)},b.onmouseover=function(){d.buttonDiv_.firstChild.style.left=-(1*d.visualSize_.width)+"px"},b.onmouseout=function(){d.hotKeyDown_?(d.buttonDiv_.firstChild.style.left=-(0*d.visualSize_.width)+"px",d.buttonDiv_.title=d.visualTips_.on):(d.buttonDiv_.firstChild.style.left=-(2*d.visualSize_.width)+"px",d.buttonDiv_.title=d.visualTips_.off)},b.ondragstart=function(){return!1},i(b.style,{cursor:"pointer",marginTop:a.height+"px",marginLeft:a.width+"px"}),b},b.prototype.isHotKeyDown_=function(b){var c;if(b=b||a.event,c=b.shiftKey&&"shift"===this.key_||b.altKey&&"alt"===this.key_||b.ctrlKey&&"ctrl"===this.key_,!c)switch(b.keyCode){case 16:"shift"===this.key_&&(c=!0);break;case 17:"ctrl"===this.key_&&(c=!0);break;case 18:"alt"===this.key_&&(c=!0)}return c},b.prototype.isMouseOnMap_=function(){var a=this.mousePosn_;if(a){var b=this.mapPosn_,c=this.map_.getDiv();return a.left>b.left&&a.left<b.left+c.offsetWidth&&a.top>b.top&&a.top<b.top+c.offsetHeight}return!1},b.prototype.setVeilVisibility_=function(){var a;if(this.map_&&this.hotKeyDown_&&this.isMouseOnMap_()){var b=this.map_.getDiv();if(this.mapWidth_=b.offsetWidth-(this.borderWidths_.left+this.borderWidths_.right),this.mapHeight_=b.offsetHeight-(this.borderWidths_.top+this.borderWidths_.bottom),this.activatedByControl_){var c=parseInt(this.buttonDiv_.style.left,10)+this.visualPositionOffset_.width,d=parseInt(this.buttonDiv_.style.top,10)+this.visualPositionOffset_.height,e=this.visualSize_.width,f=this.visualSize_.height;for(this.veilDiv_[0].style.top="0px",this.veilDiv_[0].style.left="0px",this.veilDiv_[0].style.width=c+"px",this.veilDiv_[0].style.height=this.mapHeight_+"px",this.veilDiv_[1].style.top="0px",this.veilDiv_[1].style.left=c+e+"px",this.veilDiv_[1].style.width=this.mapWidth_-(c+e)+"px",this.veilDiv_[1].style.height=this.mapHeight_+"px",this.veilDiv_[2].style.top="0px",this.veilDiv_[2].style.left=c+"px",this.veilDiv_[2].style.width=e+"px",this.veilDiv_[2].style.height=d+"px",this.veilDiv_[3].style.top=d+f+"px",this.veilDiv_[3].style.left=c+"px",this.veilDiv_[3].style.width=e+"px",this.veilDiv_[3].style.height=this.mapHeight_-(d+f)+"px",a=0;a<this.veilDiv_.length;a++)this.veilDiv_[a].style.display="block"}else{for(this.veilDiv_[0].style.left="0px",this.veilDiv_[0].style.top="0px",this.veilDiv_[0].style.width=this.mapWidth_+"px",this.veilDiv_[0].style.height=this.mapHeight_+"px",a=1;a<this.veilDiv_.length;a++)this.veilDiv_[a].style.width="0px",this.veilDiv_[a].style.height="0px";for(a=0;a<this.veilDiv_.length;a++)this.veilDiv_[a].style.display="block"}}else for(a=0;a<this.veilDiv_.length;a++)this.veilDiv_[a].style.display="none"},b.prototype.onKeyDown_=function(a){this.map_&&!this.hotKeyDown_&&this.isHotKeyDown_(a)&&(this.mapPosn_=h(this.map_.getDiv()),this.hotKeyDown_=!0,this.activatedByControl_=!1,this.setVeilVisibility_(),google.maps.event.trigger(this,"activate"))},b.prototype.getMousePoint_=function(a){var b=g(a),c=new google.maps.Point;return c.x=b.left-this.mapPosn_.left-this.borderWidths_.left,c.y=b.top-this.mapPosn_.top-this.borderWidths_.top,c.x=Math.min(c.x,this.mapWidth_),c.y=Math.min(c.y,this.mapHeight_),c.x=Math.max(c.x,0),c.y=Math.max(c.y,0),c},b.prototype.onMouseDown_=function(a){if(this.map_&&this.hotKeyDown_){this.mapPosn_=h(this.map_.getDiv()),this.dragging_=!0,this.startPt_=this.endPt_=this.getMousePoint_(a),this.boxDiv_.style.width=this.boxDiv_.style.height="0px";var b=this.prjov_.getProjection(),c=b.fromContainerPixelToLatLng(this.startPt_);google.maps.event.trigger(this,"dragstart",c)}},b.prototype.onMouseDownDocument_=function(a){this.mouseDown_=!0},b.prototype.onMouseMove_=function(a){if(this.mousePosn_=g(a),this.dragging_){this.endPt_=this.getMousePoint_(a);var b=Math.min(this.startPt_.x,this.endPt_.x),c=Math.min(this.startPt_.y,this.endPt_.y),d=Math.abs(this.startPt_.x-this.endPt_.x),e=Math.abs(this.startPt_.y-this.endPt_.y),f=Math.max(0,d-(this.boxBorderWidths_.left+this.boxBorderWidths_.right)),i=Math.max(0,e-(this.boxBorderWidths_.top+this.boxBorderWidths_.bottom));this.veilDiv_[0].style.top="0px",this.veilDiv_[0].style.left="0px",this.veilDiv_[0].style.width=b+"px",this.veilDiv_[0].style.height=this.mapHeight_+"px",this.veilDiv_[1].style.top="0px",this.veilDiv_[1].style.left=b+d+"px",this.veilDiv_[1].style.width=this.mapWidth_-(b+d)+"px",this.veilDiv_[1].style.height=this.mapHeight_+"px",this.veilDiv_[2].style.top="0px",this.veilDiv_[2].style.left=b+"px",this.veilDiv_[2].style.width=d+"px",this.veilDiv_[2].style.height=c+"px",this.veilDiv_[3].style.top=c+e+"px",this.veilDiv_[3].style.left=b+"px",this.veilDiv_[3].style.width=d+"px",this.veilDiv_[3].style.height=this.mapHeight_-(c+e)+"px",this.boxDiv_.style.top=c+"px",this.boxDiv_.style.left=b+"px",this.boxDiv_.style.width=f+"px",this.boxDiv_.style.height=i+"px",this.boxDiv_.style.display="block",google.maps.event.trigger(this,"drag",new google.maps.Point(b,c+e),new google.maps.Point(b+d,c),this.prjov_.getProjection())}else this.mouseDown_||(this.mapPosn_=h(this.map_.getDiv()),this.setVeilVisibility_())},b.prototype.onMouseUp_=function(a){var b,c=this;if(this.mouseDown_=!1,this.dragging_){if(this.getMousePoint_(a).x===this.startPt_.x&&this.getMousePoint_(a).y===this.startPt_.y)return void this.onKeyUp_(a);var d=Math.min(this.startPt_.x,this.endPt_.x),e=Math.min(this.startPt_.y,this.endPt_.y),f=Math.abs(this.startPt_.x-this.endPt_.x),g=Math.abs(this.startPt_.y-this.endPt_.y),h=!0;h&&(d+=this.borderWidths_.left,e+=this.borderWidths_.top);var i=this.prjov_.getProjection(),j=i.fromContainerPixelToLatLng(new google.maps.Point(d,e+g)),k=i.fromContainerPixelToLatLng(new google.maps.Point(d+f,e)),l=new google.maps.LatLngBounds(j,k);if(this.noZoom_)this.boxDiv_.style.display="none";else{b=this.map_.getZoom(),this.map_.fitBounds(l),this.map_.getZoom()<b&&this.map_.setZoom(b);var m=i.fromLatLngToContainerPixel(j),n=i.fromLatLngToContainerPixel(k);h&&(m.x-=this.borderWidths_.left,m.y-=this.borderWidths_.top,n.x-=this.borderWidths_.left,n.y-=this.borderWidths_.top),this.boxDiv_.style.left=m.x+"px",this.boxDiv_.style.top=n.y+"px",this.boxDiv_.style.width=Math.abs(n.x-m.x)-(this.boxBorderWidths_.left+this.boxBorderWidths_.right)+"px",this.boxDiv_.style.height=Math.abs(n.y-m.y)-(this.boxBorderWidths_.top+this.boxBorderWidths_.bottom)+"px",setTimeout(function(){c.boxDiv_.style.display="none"},1e3)}this.dragging_=!1,this.onMouseMove_(a),google.maps.event.trigger(this,"dragend",l),this.isHotKeyDown_(a)||this.onKeyUp_(a)}},b.prototype.onKeyUp_=function(a){var b,c,d,e,f,g,h,i,j=null;if(this.map_&&this.hotKeyDown_){for(this.hotKeyDown_=!1,this.dragging_&&(this.boxDiv_.style.display="none",this.dragging_=!1,c=Math.min(this.startPt_.x,this.endPt_.x),d=Math.min(this.startPt_.y,this.endPt_.y),e=Math.abs(this.startPt_.x-this.endPt_.x),f=Math.abs(this.startPt_.y-this.endPt_.y),g=this.prjov_.getProjection(),h=g.fromContainerPixelToLatLng(new google.maps.Point(c,d+f)),i=g.fromContainerPixelToLatLng(new google.maps.Point(c+e,d)),j=new google.maps.LatLngBounds(h,i)),b=0;b<this.veilDiv_.length;b++)this.veilDiv_[b].style.display="none";this.visualEnabled_&&(this.buttonDiv_.firstChild.style.left=-(2*this.visualSize_.width)+"px",this.buttonDiv_.title=this.visualTips_.off,this.buttonDiv_.style.display=""),google.maps.event.trigger(this,"deactivate",j)}},google.maps.Map.prototype.enableKeyDragZoom=function(a){this.dragZoom_=new b(this,a)},google.maps.Map.prototype.disableKeyDragZoom=function(){var a,b=this.dragZoom_;if(b){for(a=0;a<b.listeners_.length;++a)google.maps.event.removeListener(b.listeners_[a]);for(this.getDiv().removeChild(b.boxDiv_),a=0;a<b.veilDiv_.length;a++)this.getDiv().removeChild(b.veilDiv_[a]);b.visualEnabled_&&this.controls[b.visualPosition_].removeAt(b.controlIndex_),b.prjov_.setMap(null),this.dragZoom_=null}},google.maps.Map.prototype.keyDragZoomEnabled=function(){return null!==this.dragZoom_},google.maps.Map.prototype.getDragZoomObject=function(){return this.dragZoom_}}(),g(h,google.maps.OverlayView),h.getSharedCross=function(a){var b;return"undefined"==typeof h.getSharedCross.crossDiv&&(b=document.createElement("img"),b.style.cssText="position: absolute; z-index: 1000002; display: none;",b.style.marginLeft="-8px",b.style.marginTop="-9px",b.src=a,h.getSharedCross.crossDiv=b),h.getSharedCross.crossDiv},h.prototype.onAdd=function(){var a,b,c,d,e,f,g,i=this,j=!1,k=!1,l=20,m="url("+this.handCursorURL_+")",n=function(a){a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},o=function(){i.marker_.setAnimation(null)};this.getPanes().overlayImage.appendChild(this.labelDiv_),this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_),"undefined"==typeof h.getSharedCross.processed&&(this.getPanes().overlayImage.appendChild(this.crossDiv_),h.getSharedCross.processed=!0),this.listeners_=[google.maps.event.addDomListener(this.eventDiv_,"mouseover",function(a){(i.marker_.getDraggable()||i.marker_.getClickable())&&(this.style.cursor="pointer",google.maps.event.trigger(i.marker_,"mouseover",a))}),google.maps.event.addDomListener(this.eventDiv_,"mouseout",function(a){!i.marker_.getDraggable()&&!i.marker_.getClickable()||k||(this.style.cursor=i.marker_.getCursor(),google.maps.event.trigger(i.marker_,"mouseout",a))}),google.maps.event.addDomListener(this.eventDiv_,"mousedown",function(a){k=!1,i.marker_.getDraggable()&&(j=!0,this.style.cursor=m),(i.marker_.getDraggable()||i.marker_.getClickable())&&(google.maps.event.trigger(i.marker_,"mousedown",a),n(a))}),google.maps.event.addDomListener(document,"mouseup",function(b){var c;if(j&&(j=!1,i.eventDiv_.style.cursor="pointer",google.maps.event.trigger(i.marker_,"mouseup",b)),k){if(e){c=i.getProjection().fromLatLngToDivPixel(i.marker_.getPosition()),c.y+=l,i.marker_.setPosition(i.getProjection().fromDivPixelToLatLng(c));try{i.marker_.setAnimation(google.maps.Animation.BOUNCE),setTimeout(o,1406)}catch(f){}}i.crossDiv_.style.display="none",i.marker_.setZIndex(a),d=!0,k=!1,b.latLng=i.marker_.getPosition(),google.maps.event.trigger(i.marker_,"dragend",b)}}),google.maps.event.addListener(i.marker_.getMap(),"mousemove",function(d){var h;j&&(k?(d.latLng=new google.maps.LatLng(d.latLng.lat()-b,d.latLng.lng()-c),h=i.getProjection().fromLatLngToDivPixel(d.latLng),e&&(i.crossDiv_.style.left=h.x+"px",i.crossDiv_.style.top=h.y+"px",i.crossDiv_.style.display="",h.y-=l),i.marker_.setPosition(i.getProjection().fromDivPixelToLatLng(h)),e&&(i.eventDiv_.style.top=h.y+l+"px"),google.maps.event.trigger(i.marker_,"drag",d)):(b=d.latLng.lat()-i.marker_.getPosition().lat(),c=d.latLng.lng()-i.marker_.getPosition().lng(),a=i.marker_.getZIndex(),f=i.marker_.getPosition(),g=i.marker_.getMap().getCenter(),e=i.marker_.get("raiseOnDrag"),k=!0,i.marker_.setZIndex(1e6),d.latLng=i.marker_.getPosition(),google.maps.event.trigger(i.marker_,"dragstart",d)))}),google.maps.event.addDomListener(document,"keydown",function(a){k&&27===a.keyCode&&(e=!1,i.marker_.setPosition(f),i.marker_.getMap().setCenter(g),google.maps.event.trigger(document,"mouseup",a))}),google.maps.event.addDomListener(this.eventDiv_,"click",function(a){(i.marker_.getDraggable()||i.marker_.getClickable())&&(d?d=!1:(google.maps.event.trigger(i.marker_,"click",a),n(a)))}),google.maps.event.addDomListener(this.eventDiv_,"dblclick",function(a){(i.marker_.getDraggable()||i.marker_.getClickable())&&(google.maps.event.trigger(i.marker_,"dblclick",a),n(a))}),google.maps.event.addListener(this.marker_,"dragstart",function(a){k||(e=this.get("raiseOnDrag"))}),google.maps.event.addListener(this.marker_,"drag",function(a){k||e&&(i.setPosition(l),i.labelDiv_.style.zIndex=1e6+(this.get("labelInBackground")?-1:1))}),google.maps.event.addListener(this.marker_,"dragend",function(a){k||e&&i.setPosition(0)}),google.maps.event.addListener(this.marker_,"position_changed",function(){i.setPosition()}),google.maps.event.addListener(this.marker_,"zindex_changed",function(){i.setZIndex()}),google.maps.event.addListener(this.marker_,"visible_changed",function(){i.setVisible()}),google.maps.event.addListener(this.marker_,"labelvisible_changed",function(){i.setVisible()}),google.maps.event.addListener(this.marker_,"title_changed",function(){i.setTitle()}),google.maps.event.addListener(this.marker_,"labelcontent_changed",function(){i.setContent()}),google.maps.event.addListener(this.marker_,"labelanchor_changed",function(){i.setAnchor()}),google.maps.event.addListener(this.marker_,"labelclass_changed",function(){i.setStyles()}),google.maps.event.addListener(this.marker_,"labelstyle_changed",function(){i.setStyles()})]},h.prototype.onRemove=function(){var a;for(this.labelDiv_.parentNode.removeChild(this.labelDiv_),this.eventDiv_.parentNode.removeChild(this.eventDiv_),a=0;a<this.listeners_.length;a++)google.maps.event.removeListener(this.listeners_[a])},h.prototype.draw=function(){this.setContent(),this.setTitle(),this.setStyles()},h.prototype.setContent=function(){var a=this.marker_.get("labelContent");"undefined"==typeof a.nodeType?(this.labelDiv_.innerHTML=a,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(a),a=a.cloneNode(!0),this.eventDiv_.innerHTML="",this.eventDiv_.appendChild(a))},h.prototype.setTitle=function(){this.eventDiv_.title=this.marker_.getTitle()||""},h.prototype.setStyles=function(){var a,b;this.labelDiv_.className=this.marker_.get("labelClass"),this.eventDiv_.className=this.labelDiv_.className,this.labelDiv_.style.cssText="",this.eventDiv_.style.cssText="",b=this.marker_.get("labelStyle");for(a in b)b.hasOwnProperty(a)&&(this.labelDiv_.style[a]=b[a],this.eventDiv_.style[a]=b[a]);this.setMandatoryStyles()},h.prototype.setMandatoryStyles=function(){this.labelDiv_.style.position="absolute",this.labelDiv_.style.overflow="hidden","undefined"!=typeof this.labelDiv_.style.opacity&&""!==this.labelDiv_.style.opacity&&(this.labelDiv_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(opacity='+100*this.labelDiv_.style.opacity+')"',this.labelDiv_.style.filter="alpha(opacity="+100*this.labelDiv_.style.opacity+")"),this.eventDiv_.style.position=this.labelDiv_.style.position,this.eventDiv_.style.overflow=this.labelDiv_.style.overflow,this.eventDiv_.style.opacity=.01,this.eventDiv_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(opacity=1)"',this.eventDiv_.style.filter="alpha(opacity=1)",this.setAnchor(),this.setPosition(),this.setVisible()},h.prototype.setAnchor=function(){var a=this.marker_.get("labelAnchor");this.labelDiv_.style.marginLeft=-a.x+"px",this.labelDiv_.style.marginTop=-a.y+"px",this.eventDiv_.style.marginLeft=-a.x+"px",this.eventDiv_.style.marginTop=-a.y+"px"},h.prototype.setPosition=function(a){var b=this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());"undefined"==typeof a&&(a=0),this.labelDiv_.style.left=Math.round(b.x)+"px",this.labelDiv_.style.top=Math.round(b.y-a)+"px",this.eventDiv_.style.left=this.labelDiv_.style.left,this.eventDiv_.style.top=this.labelDiv_.style.top,this.setZIndex()},h.prototype.setZIndex=function(){var a=this.marker_.get("labelInBackground")?-1:1;"undefined"==typeof this.marker_.getZIndex()?(this.labelDiv_.style.zIndex=parseInt(this.labelDiv_.style.top,10)+a,this.eventDiv_.style.zIndex=this.labelDiv_.style.zIndex):(this.labelDiv_.style.zIndex=this.marker_.getZIndex()+a,this.eventDiv_.style.zIndex=this.labelDiv_.style.zIndex)},h.prototype.setVisible=function(){this.marker_.get("labelVisible")?this.labelDiv_.style.display=this.marker_.getVisible()?"block":"none":this.labelDiv_.style.display="none",this.eventDiv_.style.display=this.labelDiv_.style.display},g(i,google.maps.Marker),i.prototype.setMap=function(a){google.maps.Marker.prototype.setMap.apply(this,arguments),this.label.setMap(a)},j.prototype=new google.maps.OverlayView,a.RichMarker=j,j.prototype.getVisible=function(){return this.get("visible")},j.prototype.getVisible=j.prototype.getVisible,j.prototype.setVisible=function(a){this.set("visible",a)},j.prototype.setVisible=j.prototype.setVisible,j.prototype.visible_changed=function(){this.ready_&&(this.markerWrapper_.style.display=this.getVisible()?"":"none",this.draw())},j.prototype.visible_changed=j.prototype.visible_changed,j.prototype.setFlat=function(a){this.set("flat",!!a)},j.prototype.setFlat=j.prototype.setFlat,j.prototype.getFlat=function(){return this.get("flat")},j.prototype.getFlat=j.prototype.getFlat,j.prototype.getWidth=function(){return this.get("width")},j.prototype.getWidth=j.prototype.getWidth,j.prototype.getHeight=function(){return this.get("height")},j.prototype.getHeight=j.prototype.getHeight,j.prototype.setShadow=function(a){this.set("shadow",a),this.flat_changed()},j.prototype.setShadow=j.prototype.setShadow,j.prototype.getShadow=function(){return this.get("shadow")},j.prototype.getShadow=j.prototype.getShadow,j.prototype.flat_changed=function(){this.ready_&&(this.markerWrapper_.style.boxShadow=this.markerWrapper_.style.webkitBoxShadow=this.markerWrapper_.style.MozBoxShadow=this.getFlat()?"":this.getShadow())},j.prototype.flat_changed=j.prototype.flat_changed,j.prototype.setZIndex=function(a){this.set("zIndex",a)},j.prototype.setZIndex=j.prototype.setZIndex,j.prototype.getZIndex=function(){return this.get("zIndex")},j.prototype.getZIndex=j.prototype.getZIndex,j.prototype.zIndex_changed=function(){this.getZIndex()&&this.ready_&&(this.markerWrapper_.style.zIndex=this.getZIndex())},j.prototype.zIndex_changed=j.prototype.zIndex_changed,j.prototype.getDraggable=function(){return this.get("draggable")},j.prototype.getDraggable=j.prototype.getDraggable,j.prototype.setDraggable=function(a){this.set("draggable",!!a)},j.prototype.setDraggable=j.prototype.setDraggable,j.prototype.draggable_changed=function(){this.ready_&&(this.getDraggable()?this.addDragging_(this.markerWrapper_):this.removeDragListeners_())},j.prototype.draggable_changed=j.prototype.draggable_changed,j.prototype.getPosition=function(){return this.get("position")},j.prototype.getPosition=j.prototype.getPosition,j.prototype.setPosition=function(a){this.set("position",a)},j.prototype.setPosition=j.prototype.setPosition,j.prototype.position_changed=function(){this.draw()},j.prototype.position_changed=j.prototype.position_changed,j.prototype.getAnchor=function(){return this.get("anchor")},j.prototype.getAnchor=j.prototype.getAnchor,j.prototype.setAnchor=function(a){this.set("anchor",a)},j.prototype.setAnchor=j.prototype.setAnchor,j.prototype.anchor_changed=function(){this.draw()},j.prototype.anchor_changed=j.prototype.anchor_changed,j.prototype.htmlToDocumentFragment_=function(a){var b=document.createElement("DIV");if(b.innerHTML=a,1==b.childNodes.length)return b.removeChild(b.firstChild);for(var c=document.createDocumentFragment();b.firstChild;)c.appendChild(b.firstChild);return c},j.prototype.removeChildren_=function(a){if(a)for(var b;b=a.firstChild;)a.removeChild(b)},j.prototype.setContent=function(a){this.set("content",a)},j.prototype.setContent=j.prototype.setContent,j.prototype.getContent=function(){return this.get("content")},j.prototype.getContent=j.prototype.getContent,j.prototype.content_changed=function(){if(this.markerContent_){this.removeChildren_(this.markerContent_);var a=this.getContent();if(a){"string"==typeof a&&(a=a.replace(/^\s*([\S\s]*)\b\s*$/,"$1"),a=this.htmlToDocumentFragment_(a)),this.markerContent_.appendChild(a);for(var b,c=this,d=this.markerContent_.getElementsByTagName("IMG"),e=0;b=d[e];e++)google.maps.event.addDomListener(b,"mousedown",function(a){c.getDraggable()&&(a.preventDefault&&a.preventDefault(),a.returnValue=!1)}),google.maps.event.addDomListener(b,"load",function(){c.draw()});google.maps.event.trigger(this,"domready")}this.ready_&&this.draw()}},j.prototype.content_changed=j.prototype.content_changed,j.prototype.setCursor_=function(a){if(this.ready_){var b="";navigator.userAgent.indexOf("Gecko/")!==-1?("dragging"==a&&(b="-moz-grabbing"),"dragready"==a&&(b="-moz-grab"),"draggable"==a&&(b="pointer")):("dragging"!=a&&"dragready"!=a||(b="move"),"draggable"==a&&(b="pointer")),this.markerWrapper_.style.cursor!=b&&(this.markerWrapper_.style.cursor=b)}},j.prototype.startDrag=function(a){if(this.getDraggable()&&!this.dragging_){this.dragging_=!0;var b=this.getMap();this.mapDraggable_=b.get("draggable"),b.set("draggable",!1),this.mouseX_=a.clientX,this.mouseY_=a.clientY,this.setCursor_("dragready"),this.markerWrapper_.style.MozUserSelect="none",this.markerWrapper_.style.KhtmlUserSelect="none",this.markerWrapper_.style.WebkitUserSelect="none",this.markerWrapper_.unselectable="on",this.markerWrapper_.onselectstart=function(){return!1},this.addDraggingListeners_(),google.maps.event.trigger(this,"dragstart")}},j.prototype.stopDrag=function(){this.getDraggable()&&this.dragging_&&(this.dragging_=!1,this.getMap().set("draggable",this.mapDraggable_),this.mouseX_=this.mouseY_=this.mapDraggable_=null,this.markerWrapper_.style.MozUserSelect="",this.markerWrapper_.style.KhtmlUserSelect="",this.markerWrapper_.style.WebkitUserSelect="",this.markerWrapper_.unselectable="off",this.markerWrapper_.onselectstart=function(){},this.removeDraggingListeners_(),this.setCursor_("draggable"),google.maps.event.trigger(this,"dragend"),this.draw())},j.prototype.drag=function(a){if(!this.getDraggable()||!this.dragging_)return void this.stopDrag();var b=this.mouseX_-a.clientX,c=this.mouseY_-a.clientY;this.mouseX_=a.clientX,
12
this.mouseY_=a.clientY;var d=parseInt(this.markerWrapper_.style.left,10)-b,e=parseInt(this.markerWrapper_.style.top,10)-c;this.markerWrapper_.style.left=d+"px",this.markerWrapper_.style.top=e+"px";var f=this.getOffset_(),g=new google.maps.Point(d-f.width,e-f.height),h=this.getProjection();this.setPosition(h.fromDivPixelToLatLng(g)),this.setCursor_("dragging"),google.maps.event.trigger(this,"drag")},j.prototype.removeDragListeners_=function(){this.draggableListener_&&(google.maps.event.removeListener(this.draggableListener_),delete this.draggableListener_),this.setCursor_("")},j.prototype.addDragging_=function(a){if(a){var b=this;this.draggableListener_=google.maps.event.addDomListener(a,"mousedown",function(a){b.startDrag(a)}),this.setCursor_("draggable")}},j.prototype.addDraggingListeners_=function(){var b=this;this.markerWrapper_.setCapture?(this.markerWrapper_.setCapture(!0),this.draggingListeners_=[google.maps.event.addDomListener(this.markerWrapper_,"mousemove",function(a){b.drag(a)},!0),google.maps.event.addDomListener(this.markerWrapper_,"mouseup",function(){b.stopDrag(),b.markerWrapper_.releaseCapture()},!0)]):this.draggingListeners_=[google.maps.event.addDomListener(a,"mousemove",function(a){b.drag(a)},!0),google.maps.event.addDomListener(a,"mouseup",function(){b.stopDrag()},!0)]},j.prototype.removeDraggingListeners_=function(){if(this.draggingListeners_){for(var a,b=0;a=this.draggingListeners_[b];b++)google.maps.event.removeListener(a);this.draggingListeners_.length=0}},j.prototype.getOffset_=function(){var a=this.getAnchor();if("object"==typeof a)return a;var b=new google.maps.Size(0,0);if(!this.markerContent_)return b;var c=this.markerContent_.offsetWidth,d=this.markerContent_.offsetHeight;switch(a){case k.TOP_LEFT:break;case k.TOP:b.width=-c/2;break;case k.TOP_RIGHT:b.width=-c;break;case k.LEFT:b.height=-d/2;break;case k.MIDDLE:b.width=-c/2,b.height=-d/2;break;case k.RIGHT:b.width=-c,b.height=-d/2;break;case k.BOTTOM_LEFT:b.height=-d;break;case k.BOTTOM:b.width=-c/2,b.height=-d;break;case k.BOTTOM_RIGHT:b.width=-c,b.height=-d}return b},j.prototype.onAdd=function(){if(this.markerWrapper_||(this.markerWrapper_=document.createElement("DIV"),this.markerWrapper_.style.position="absolute"),this.getZIndex()&&(this.markerWrapper_.style.zIndex=this.getZIndex()),this.markerWrapper_.style.display=this.getVisible()?"":"none",!this.markerContent_){this.markerContent_=document.createElement("DIV"),this.markerWrapper_.appendChild(this.markerContent_);var a=this;google.maps.event.addDomListener(this.markerContent_,"click",function(b){google.maps.event.trigger(a,"click")}),google.maps.event.addDomListener(this.markerContent_,"mouseover",function(b){google.maps.event.trigger(a,"mouseover")}),google.maps.event.addDomListener(this.markerContent_,"mouseout",function(b){google.maps.event.trigger(a,"mouseout")})}this.ready_=!0,this.content_changed(),this.flat_changed(),this.draggable_changed();var b=this.getPanes();b&&b.overlayMouseTarget.appendChild(this.markerWrapper_),google.maps.event.trigger(this,"ready")},j.prototype.onAdd=j.prototype.onAdd,j.prototype.draw=function(){if(this.ready_&&!this.dragging_){var a=this.getProjection();if(a){var b=this.get("position"),c=a.fromLatLngToDivPixel(b),d=this.getOffset_();this.markerWrapper_.style.top=c.y+d.height+"px",this.markerWrapper_.style.left=c.x+d.width+"px";var e=this.markerContent_.offsetHeight,f=this.markerContent_.offsetWidth;f!=this.get("width")&&this.set("width",f),e!=this.get("height")&&this.set("height",e)}}},j.prototype.draw=j.prototype.draw,j.prototype.onRemove=function(){this.markerWrapper_&&this.markerWrapper_.parentNode&&this.markerWrapper_.parentNode.removeChild(this.markerWrapper_),this.removeDragListeners_()},j.prototype.onRemove=j.prototype.onRemove;var k={TOP_LEFT:1,TOP:2,TOP_RIGHT:3,LEFT:4,MIDDLE:5,RIGHT:6,BOTTOM_LEFT:7,BOTTOM:8,BOTTOM_RIGHT:9};a.RichMarkerPosition=k,a.InfoBox=f,a.Cluster=c,a.ClusterIcon=b,a.MarkerClusterer=e,a.MarkerLabel_=h,a.MarkerWithLabel=i,a.RichMarker=j}()})}}),function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,c,d){b.module("uiGmapgoogle-maps.wrapped").service("uiGmapDataStructures",function(){return{Graph:d(1).Graph,Queue:d(1).Queue}})},function(a,b,c){(function(){a.exports={Graph:c(2),Heap:c(3),LinkedList:c(4),Map:c(5),Queue:c(6),RedBlackTree:c(7),Trie:c(8)}}).call(this)},function(a,b){(function(){var b,c={}.hasOwnProperty;b=function(){function a(){this._nodes={},this.nodeSize=0,this.edgeSize=0}return a.prototype.addNode=function(a){if(!this._nodes[a])return this.nodeSize++,this._nodes[a]={_outEdges:{},_inEdges:{}}},a.prototype.getNode=function(a){return this._nodes[a]},a.prototype.removeNode=function(a){var b,d,e,f,g;if(d=this._nodes[a]){f=d._outEdges;for(e in f)c.call(f,e)&&this.removeEdge(a,e);g=d._inEdges;for(b in g)c.call(g,b)&&this.removeEdge(b,a);return this.nodeSize--,delete this._nodes[a],d}},a.prototype.addEdge=function(a,b,c){var d,e,f;if(null==c&&(c=1),!this.getEdge(a,b)&&(e=this._nodes[a],f=this._nodes[b],e&&f))return d={weight:c},e._outEdges[b]=d,f._inEdges[a]=d,this.edgeSize++,d},a.prototype.getEdge=function(a,b){var c,d;if(c=this._nodes[a],d=this._nodes[b],c&&d)return c._outEdges[b]},a.prototype.removeEdge=function(a,b){var c,d,e;if(d=this._nodes[a],e=this._nodes[b],c=this.getEdge(a,b))return delete d._outEdges[b],delete e._inEdges[a],this.edgeSize--,c},a.prototype.getInEdgesOf=function(a){var b,d,e,f;e=this._nodes[a],d=[],f=null!=e?e._inEdges:void 0;for(b in f)c.call(f,b)&&d.push(this.getEdge(b,a));return d},a.prototype.getOutEdgesOf=function(a){var b,d,e,f;b=this._nodes[a],d=[],f=null!=b?b._outEdges:void 0;for(e in f)c.call(f,e)&&d.push(this.getEdge(a,e));return d},a.prototype.getAllEdgesOf=function(a){var b,c,d,e,f,g,h;if(c=this.getInEdgesOf(a),d=this.getOutEdgesOf(a),0===c.length)return d;for(e=this.getEdge(a,a),b=f=0,g=c.length;0<=g?f<g:f>g;b=0<=g?++f:--f)if(c[b]===e){h=[c[c.length-1],c[b]],c[b]=h[0],c[c.length-1]=h[1],c.pop();break}return c.concat(d)},a.prototype.forEachNode=function(a){var b,d,e;e=this._nodes;for(b in e)c.call(e,b)&&(d=e[b],a(d,b))},a.prototype.forEachEdge=function(a){var b,d,e,f,g,h;g=this._nodes;for(d in g)if(c.call(g,d)){e=g[d],h=e._outEdges;for(f in h)c.call(h,f)&&(b=h[f],a(b))}},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e;b=function(){function a(a){var b,c,d,e,f,g;for(null==a&&(a=[]),this._data=[void 0],d=0,f=a.length;d<f;d++)c=a[d],null!=c&&this._data.push(c);if(this._data.length>1)for(b=e=2,g=this._data.length;2<=g?e<g:e>g;b=2<=g?++e:--e)this._upHeap(b);this.size=this._data.length-1}return a.prototype.add=function(a){if(null!=a)return this._data.push(a),this._upHeap(this._data.length-1),this.size++,a},a.prototype.removeMin=function(){var a;if(1!==this._data.length)return this.size--,2===this._data.length?this._data.pop():(a=this._data[1],this._data[1]=this._data.pop(),this._downHeap(),a)},a.prototype.peekMin=function(){return this._data[1]},a.prototype._upHeap=function(a){var b,c;for(b=this._data[a];this._data[a]<this._data[d(a)]&&a>1;)c=[this._data[d(a)],this._data[a]],this._data[a]=c[0],this._data[d(a)]=c[1],a=d(a)},a.prototype._downHeap=function(){var a,b,d;for(a=1;c(a<this._data.length)&&(b=c(a),b<this._data.length-1&&this._data[e(a)]<this._data[b]&&(b=e(a)),this._data[b]<this._data[a]);)d=[this._data[a],this._data[b]],this._data[b]=d[0],this._data[a]=d[1],a=b},a}(),d=function(a){return a>>1},c=function(a){return a<<1},e=function(a){return(a<<1)+1},a.exports=b}).call(this)},function(a,b){(function(){var b;b=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this.head={prev:void 0,value:void 0,next:void 0},this.tail={prev:void 0,value:void 0,next:void 0},this.size=0,c=0,d=a.length;c<d;c++)b=a[c],this.add(b)}return a.prototype.at=function(a){var b,c,d,e,f;if(-this.size<=a&&a<this.size){if(a=this._adjust(a),2*a<this.size)for(b=this.head,c=d=1;d<=a;c=d+=1)b=b.next;else for(b=this.tail,c=e=1,f=this.size-a-1;e<=f;c=e+=1)b=b.prev;return b}},a.prototype.add=function(a,b){var c,d,e,f,g;if(null==b&&(b=this.size),-this.size<=b&&b<=this.size)return d={value:a},b=this._adjust(b),0===this.size?this.head=d:0===b?(e=[d,this.head,d],this.head.prev=e[0],d.next=e[1],this.head=e[2]):(c=this.at(b-1),f=[c.next,d,d,c],d.next=f[0],null!=(g=c.next)?g.prev=f[1]:void 0,c.next=f[2],d.prev=f[3]),b===this.size&&(this.tail=d),this.size++,a},a.prototype.removeAt=function(a){var b,c,d;if(null==a&&(a=this.size-1),-this.size<=a&&a<this.size&&0!==this.size)return a=this._adjust(a),1===this.size?(c=this.head.value,this.head.value=this.tail.value=void 0):0===a?(c=this.head.value,this.head=this.head.next,this.head.prev=void 0):(b=this.at(a),c=b.value,b.prev.next=b.next,null!=(d=b.next)&&(d.prev=b.prev),a===this.size-1&&(this.tail=b.prev)),this.size--,c},a.prototype.remove=function(a){var b;if(null!=a){for(b=this.head;b&&b.value!==a;)b=b.next;if(b)return 1===this.size?this.head.value=this.tail.value=void 0:b===this.head?(this.head=this.head.next,this.head.prev=void 0):b===this.tail?(this.tail=this.tail.prev,this.tail.next=void 0):(b.prev.next=b.next,b.next.prev=b.prev),this.size--,a}},a.prototype.indexOf=function(a,b){var c,d;if(null==b&&(b=0),null==this.head.value&&!this.head.next||b>=this.size)return-1;for(b=Math.max(0,this._adjust(b)),c=this.at(b),d=b;c&&c.value!==a;)c=c.next,d++;return d===this.size?-1:d},a.prototype._adjust=function(a){return a<0?this.size+a:a},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e,f={}.hasOwnProperty;c="_mapId_",b=function(){function a(b){var c,d;this._content={},this._itemId=0,this._id=a._newMapId(),this.size=0;for(c in b)f.call(b,c)&&(d=b[c],this.set(c,d))}return a._mapIdTracker=0,a._newMapId=function(){return this._mapIdTracker++},a.prototype.hash=function(a,b){var f,g;return null==b&&(b=!1),g=d(a),e(a)?(f=c+this._id,b&&!a[f]&&(a[f]=this._itemId++),f+"_"+a[f]):g+"_"+a},a.prototype.set=function(a,b){return this.has(a)||this.size++,this._content[this.hash(a,!0)]=[b,a],b},a.prototype.get=function(a){var b;return null!=(b=this._content[this.hash(a)])?b[0]:void 0},a.prototype.has=function(a){return this.hash(a)in this._content},a.prototype.delete=function(a){var b;return b=this.hash(a),b in this._content&&(delete this._content[b],e(a)&&delete a[c+this._id],this.size--,!0)},a.prototype.forEach=function(a){var b,c,d;d=this._content;for(b in d)f.call(d,b)&&(c=d[b],a(c[1],c[0]))},a}(),e=function(a){var b,c,e,f,g;for(b=["Boolean","Number","String","Undefined","Null","RegExp","Function"],e=d(a),f=0,g=b.length;f<g;f++)if(c=b[f],e===c)return!1;return!0},d=function(a){return Object.prototype.toString.apply(a).match(/\[object (.+)\]/)[1]},a.exports=b}).call(this)},function(a,b){(function(){var b;b=function(){function a(a){null==a&&(a=[]),this._content=a,this._dequeueIndex=0,this.size=this._content.length}return a.prototype.enqueue=function(a){return this.size++,this._content.push(a),a},a.prototype.dequeue=function(){var a;if(0!==this.size)return this.size--,a=this._content[this._dequeueIndex],this._dequeueIndex++,2*this._dequeueIndex>this._content.length&&(this._content=this._content.slice(this._dequeueIndex),this._dequeueIndex=0),a},a.prototype.peek=function(){return this._content[this._dequeueIndex]},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;c=0,d=1,e=2,h=3,f=1,b=2,g=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this._root,this.size=0,c=0,d=a.length;c<d;c++)b=a[c],null!=b&&this.add(b)}return a.prototype.add=function(a){var g,l,m,n;if(null!=a){if(this.size++,m={value:a,_color:f},this._root){if(l=i(this._root,function(b){return a===b.value?c:a<b.value?b._left?d:(m._parent=b,b._left=m,h):b._right?e:(m._parent=b,b._right=m,h)}),null!=l)return}else this._root=m;for(g=m;;){if(g===this._root){g._color=b;break}if(g._parent._color===b)break;{if((null!=(n=p(g))?n._color:void 0)!==f){!k(g)&&k(g._parent)?(this._rotateLeft(g._parent),g=g._left):k(g)&&!k(g._parent)&&(this._rotateRight(g._parent),g=g._right),g._parent._color=b,j(g)._color=f,k(g)?this._rotateRight(j(g)):this._rotateLeft(j(g));break}g._parent._color=b,p(g)._color=b,j(g)._color=f,g=j(g)}}return a}},a.prototype.has=function(a){var b;return b=i(this._root,function(b){return a===b.value?c:a<b.value?d:e}),!!b},a.prototype.peekMin=function(){var a;return null!=(a=n(this._root))?a.value:void 0},a.prototype.peekMax=function(){var a;return null!=(a=m(this._root))?a.value:void 0},a.prototype.remove=function(a){var b;if(b=i(this._root,function(b){return a===b.value?c:a<b.value?d:e}))return this._removeNode(this._root,b),this.size--,a},a.prototype.removeMin=function(){var a,b;if(a=n(this._root))return b=a.value,this._removeNode(this._root,a),b},a.prototype.removeMax=function(){var a,b;if(a=m(this._root))return b=a.value,this._removeNode(this._root,a),b},a.prototype._removeNode=function(a,c){var d,e,g,h,i,j,m,p,q,r;if(c._left&&c._right&&(e=n(c._right),c.value=e.value,c=e),e=c._left||c._right,e||(e={color:b,_right:void 0,_left:void 0,isLeaf:!0}),e._parent=c._parent,null!=(g=c._parent)&&(g[l(c)]=e),c._color===b)if(e._color===f)e._color=b,e._parent||(this._root=e);else for(;;){if(!e._parent){e.isLeaf?this._root=void 0:this._root=e;break}if(d=o(e),(null!=d?d._color:void 0)===f&&(e._parent._color=f,d._color=b,k(e)?this._rotateLeft(e._parent):this._rotateRight(e._parent)),d=o(e),e._parent._color!==b||d&&(d._color!==b||d._left&&d._left._color!==b||d._right&&d._right._color!==b)){if(!(e._parent._color!==f||d&&(d._color!==b||d._left&&(null!=(h=d._left)?h._color:void 0)!==b||d._right&&(null!=(i=d._right)?i._color:void 0)!==b))){null!=d&&(d._color=f),e._parent._color=b;break}if((null!=d?d._color:void 0)===b){!k(e)||d._right&&d._right._color!==b||(null!=(j=d._left)?j._color:void 0)!==f?k(e)||d._left&&d._left._color!==b||(null!=(p=d._right)?p._color:void 0)!==f||(d._color=f,null!=(q=d._right)&&(q._color=b),this._rotateLeft(d)):(d._color=f,null!=(m=d._left)&&(m._color=b),this._rotateRight(d));break}d=o(e),d._color=e._parent._color,k(e)?(d._right._color=b,this._rotateRight(e._parent)):(d._left._color=b,this._rotateLeft(e._parent))}else null!=d&&(d._color=f),e.isLeaf&&(e._parent[l(e)]=void 0),e=e._parent}if(e.isLeaf)return null!=(r=e._parent)?r[l(e)]=void 0:void 0},a.prototype._rotateLeft=function(a){var b,c;if(null!=(b=a._parent)&&(b[l(a)]=a._right),a._right._parent=a._parent,a._parent=a._right,a._right=a._right._left,a._parent._left=a,null!=(c=a._right)&&(c._parent=a),null==a._parent._parent)return this._root=a._parent},a.prototype._rotateRight=function(a){var b,c;if(null!=(b=a._parent)&&(b[l(a)]=a._left),a._left._parent=a._parent,a._parent=a._left,a._left=a._left._right,a._parent._right=a,null!=(c=a._left)&&(c._parent=a),null==a._parent._parent)return this._root=a._parent},a}(),k=function(a){return a===a._parent._left},l=function(a){return k(a)?"_left":"_right"},i=function(a,b){var f,g,i;for(g=a,i=void 0;g;){if(f=b(g),f===c){i=g;break}if(f===d)g=g._left;else if(f===e)g=g._right;else if(f===h)break}return i},n=function(a){return i(a,function(a){return a._left?d:c})},m=function(a){return i(a,function(a){return a._right?e:c})},j=function(a){var b;return null!=(b=a._parent)?b._parent:void 0},p=function(a){if(j(a))return k(a._parent)?j(a)._right:j(a)._left},o=function(a){return k(a)?a._parent._right:a._parent._left},a.exports=g}).call(this)},function(a,b,c){(function(){var b,d,e,f,g={}.hasOwnProperty;b=c(6),e="end",d=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this._root={},this.size=0,c=0,d=a.length;c<d;c++)b=a[c],this.add(b)}return a.prototype.add=function(a){var b,c,d,f;if(null!=a){for(this.size++,b=this._root,d=0,f=a.length;d<f;d++)c=a[d],null==b[c]&&(b[c]={}),b=b[c];return b[e]=!0,a}},a.prototype.has=function(a){var b,c,d,f;if(null==a)return!1;for(b=this._root,d=0,f=a.length;d<f;d++){if(c=a[d],null==b[c])return!1;b=b[c]}return!!b[e]},a.prototype.longestPrefixOf=function(a){var b,c,d,e,f;if(null==a)return"";for(b=this._root,d="",e=0,f=a.length;e<f&&(c=a[e],null!=b[c]);e++)d+=c,b=b[c];return d},a.prototype.wordsWithPrefix=function(a){var c,d,f,h,i,j,k,l,m,n;if(null==a)return[];for(null!=a||(a=""),k=[],d=this._root,l=0,m=a.length;l<m;l++)if(f=a[l],d=d[f],null==d)return[];for(i=new b,i.enqueue([d,""]);0!==i.size;){n=i.dequeue(),h=n[0],c=n[1],h[e]&&k.push(a+c);for(f in h)g.call(h,f)&&(j=h[f],i.enqueue([j,c+f]))}return k},a.prototype.remove=function(a){var b,c,d,g,h,i,j,k;if(null!=a){for(b=this._root,g=[],h=0,j=a.length;h<j;h++){if(d=a[h],null==b[d])return;b=b[d],g.push([d,b])}if(b[e]){if(this.size--,delete b[e],f(b,1))return a;for(c=i=k=g.length-1;(k<=1?i<=1:i>=1)&&!f(g[c][1],1);c=k<=1?++i:--i)delete g[c-1][1][g[c][0]];return f(this._root[g[0][0]],1)||delete this._root[g[0][0]],a}}},a}(),f=function(a,b){var c,d;if(0===b)return!0;d=0;for(c in a)if(g.call(a,c)&&(d++,d>=b))return!0;return!1},a.exports=d}).call(this)}]),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapMarkerSpiderfier",["uiGmapGoogleMapApi",function(b){var c=this;return+function(){var b={}.hasOwnProperty,c=[].slice;this.OverlappingMarkerSpiderfier=function(){function d(a,c){var d,f,g,h,i,j;this.map=a,null==c&&(c={});for(f in c)b.call(c,f)&&(j=c[f],this[f]=j);for(this.projHelper=new this.constructor.ProjHelper(this.map),this.initMarkerArrays(),this.listeners={},i=["click","zoom_changed","maptypeid_changed"],g=0,h=i.length;g<h;g++)d=i[g],e.addListener(this.map,d,function(a){return function(){return a.unspiderfy()}}(this))}var e,f,g,h,i,j,k,l,m,n,o;for(l=d.prototype,m=[d,l],g=0,j=m.length;g<j;g++)o=m[g],o.VERSION="0.3.3";return f=void 0,e=void 0,k=void 0,n=2*Math.PI,l.keepSpiderfied=!1,l.markersWontHide=!1,l.markersWontMove=!1,l.nearbyDistance=20,l.circleSpiralSwitchover=9,l.circleFootSeparation=23,l.circleStartAngle=n/12,l.spiralFootSeparation=26,l.spiralLengthStart=11,l.spiralLengthFactor=4,l.spiderfiedZIndex=1e3,l.usualLegZIndex=10,l.highlightedLegZIndex=20,l.event="click",l.minZoomLevel=!1,l.legWeight=1.5,l.legColors={usual:{},highlighted:{}},i=l.legColors.usual,h=l.legColors.highlighted,d.initializeGoogleMaps=function(a){return f=a.maps,e=f.event,k=f.MapTypeId,i[k.HYBRID]=i[k.SATELLITE]="#fff",h[k.HYBRID]=h[k.SATELLITE]="#f00",i[k.TERRAIN]=i[k.ROADMAP]="#444",h[k.TERRAIN]=h[k.ROADMAP]="#f00",this.ProjHelper=function(a){return this.setMap(a)},this.ProjHelper.prototype=new f.OverlayView,this.ProjHelper.prototype.draw=function(){}},l.initMarkerArrays=function(){return this.markers=[],this.markerListenerRefs=[]},l.addMarker=function(a){var b;return null!=a._oms?this:(a._oms=!0,b=[e.addListener(a,this.event,function(b){return function(c){return b.spiderListener(a,c)}}(this))],this.markersWontHide||b.push(e.addListener(a,"visible_changed",function(b){return function(){return b.markerChangeListener(a,!1)}}(this))),this.markersWontMove||b.push(e.addListener(a,"position_changed",function(b){return function(){return b.markerChangeListener(a,!0)}}(this))),this.markerListenerRefs.push(b),this.markers.push(a),this)},l.markerChangeListener=function(a,b){if(null!=a._omsData&&(b||!a.getVisible())&&null==this.spiderfying&&null==this.unspiderfying)return this.unspiderfy(b?a:null)},l.getMarkers=function(){return this.markers.slice(0)},l.removeMarker=function(a){var b,c,d,f,g;if(null!=a._omsData&&this.unspiderfy(),b=this.arrIndexOf(this.markers,a),b<0)return this;for(g=this.markerListenerRefs.splice(b,1)[0],c=0,d=g.length;c<d;c++)f=g[c],e.removeListener(f);return delete a._oms,this.markers.splice(b,1),this},l.clearMarkers=function(){var a,b,c,d,f,g,h,i,j;for(this.unspiderfy(),j=this.markers,a=b=0,c=j.length;b<c;a=++b){for(h=j[a],g=this.markerListenerRefs[a],i=0,d=g.length;i<d;i++)f=g[i],e.removeListener(f);delete h._oms}return this.initMarkerArrays(),this},l.addListener=function(a,b){var c;return(null!=(c=this.listeners)[a]?c[a]:c[a]=[]).push(b),this},l.removeListener=function(a,b){var c;return c=this.arrIndexOf(this.listeners[a],b),c<0||this.listeners[a].splice(c,1),this},l.clearListeners=function(a){return this.listeners[a]=[],this},l.trigger=function(){var a,b,d,e,f,g,h,i;for(b=arguments[0],a=2<=arguments.length?c.call(arguments,1):[],h=null!=(g=this.listeners[b])?g:[],i=[],e=0,f=h.length;e<f;e++)d=h[e],i.push(d.apply(null,a));return i},l.generatePtsCircle=function(a,b){var c,d,e,g,h,i,j,k;for(e=this.circleFootSeparation*(2+a),i=e/n,d=n/a,k=[],g=h=0,j=a;0<=j?h<j:h>j;g=0<=j?++h:--h)c=this.circleStartAngle+g*d,k.push(new f.Point(b.x+i*Math.cos(c),b.y+i*Math.sin(c)));return k},l.generatePtsSpiral=function(a,b){var c,d,e,g,h,i,j;for(g=this.spiralLengthStart,c=0,j=[],d=e=0,i=a;0<=i?e<i:e>i;d=0<=i?++e:--e)c+=this.spiralFootSeparation/g+5e-4*d,h=new f.Point(b.x+g*Math.cos(c),b.y+g*Math.sin(c)),g+=n*this.spiralLengthFactor/c,j.push(h);return j},l.spiderListener=function(b,c){var d,e,f,g,h,i,j,k,m,n,o,p,q;if(k=null!=b._omsData,k&&this.keepSpiderfied||("mouseover"===this.event?(d=this,e=function(){return d.unspiderfy()},a.clearTimeout(l.timeout),l.timeout=setTimeout(e,3e3)):this.unspiderfy()),k||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",b,c);for(n=[],o=[],m=this.nearbyDistance,p=m*m,j=this.llToPt(b.position),q=this.markers,f=0,g=q.length;f<g;f++)h=q[f],null!=h.map&&h.getVisible()&&(i=this.llToPt(h.position),this.ptDistanceSq(i,j)<p?n.push({marker:h,markerPt:i}):o.push(h));return 1===n.length?this.trigger("click",b,c):this.spiderfy(n,o)},l.markersNearMarker=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;if(null==b&&(b=!1),null==this.projHelper.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";for(i=this.nearbyDistance,j=i*i,g=this.llToPt(a.position),h=[],k=this.markers,c=0,d=k.length;c<d&&(e=k[c],!(e!==a&&null!=e.map&&e.getVisible()&&(f=this.llToPt(null!=(l=null!=(m=e._omsData)?m.usualPosition:void 0)?l:e.position),this.ptDistanceSq(f,g)<j&&(h.push(e),b))));c++);return h},l.markersNearAnyOtherMarker=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;if(null==this.projHelper.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";for(o=this.nearbyDistance,p=o*o,m=function(){var a,b,c,d,e,f;for(c=this.markers,f=[],a=0,b=c.length;a<b;a++)h=c[a],f.push({pt:this.llToPt(null!=(d=null!=(e=h._omsData)?e.usualPosition:void 0)?d:h.position),willSpiderfy:!1});return f}.call(this),r=this.markers,b=d=0,e=r.length;d<e;b=++d)if(i=r[b],null!=i.map&&i.getVisible()&&(j=m[b],!j.willSpiderfy))for(s=this.markers,c=n=0,f=s.length;n<f;c=++n)if(k=s[c],c!==b&&null!=k.map&&k.getVisible()&&(l=m[c],(!(c<b)||l.willSpiderfy)&&this.ptDistanceSq(j.pt,l.pt)<p)){j.willSpiderfy=l.willSpiderfy=!0;break}for(t=this.markers,u=[],a=q=0,g=t.length;q<g;a=++q)h=t[a],m[a].willSpiderfy&&u.push(h);return u},l.makeHighlightListenerFuncs=function(a){return{highlight:function(b){return function(){return a._omsData.leg.setOptions({strokeColor:b.legColors.highlighted[b.map.mapTypeId],zIndex:b.highlightedLegZIndex})}}(this),unhighlight:function(b){return function(){return a._omsData.leg.setOptions({strokeColor:b.legColors.usual[b.map.mapTypeId],zIndex:b.usualLegZIndex})}}(this)}},l.spiderfy=function(a,b){var c,d,g,h,i,j,k,l,m,n,o;return!(this.minZoomLevel&&this.map.getZoom()<this.minZoomLevel)&&(this.spiderfying=!0,n=a.length,c=this.ptAverage(function(){var b,c,d;for(d=[],b=0,c=a.length;b<c;b++)l=a[b],d.push(l.markerPt);return d}()),h=n>=this.circleSpiralSwitchover?this.generatePtsSpiral(n,c).reverse():this.generatePtsCircle(n,c),o=function(){var b,c,l;for(l=[],b=0,c=h.length;b<c;b++)g=h[b],d=this.ptToLl(g),m=this.minExtract(a,function(a){return function(b){return a.ptDistanceSq(b.markerPt,g)}}(this)),k=m.marker,j=new f.Polyline({map:this.map,path:[k.position,d],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,zIndex:this.usualLegZIndex}),k._omsData={usualPosition:k.position,leg:j},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(i=this.makeHighlightListenerFuncs(k),k._omsData.hightlightListeners={highlight:e.addListener(k,"mouseover",i.highlight),unhighlight:e.addListener(k,"mouseout",i.unhighlight)}),k.setPosition(d),k.setZIndex(Math.round(this.spiderfiedZIndex+g.y)),l.push(k);return l}.call(this),delete this.spiderfying,this.spiderfied=!0,this.trigger("spiderfy",o,b))},l.unspiderfy=function(a){var b,c,d,f,g,h,i;if(null==a&&(a=null),null==this.spiderfied)return this;for(this.unspiderfying=!0,i=[],g=[],h=this.markers,b=0,c=h.length;b<c;b++)f=h[b],null!=f._omsData?(f._omsData.leg.setMap(null),f!==a&&f.setPosition(f._omsData.usualPosition),f.setZIndex(null),d=f._omsData.hightlightListeners,null!=d&&(e.removeListener(d.highlight),e.removeListener(d.unhighlight)),delete f._omsData,i.push(f)):g.push(f);return delete this.unspiderfying,delete this.spiderfied,this.trigger("unspiderfy",i,g),this},l.ptDistanceSq=function(a,b){var c,d;return c=a.x-b.x,d=a.y-b.y,c*c+d*d},l.ptAverage=function(a){var b,c,d,e,g,h;for(g=h=0,b=0,c=a.length;b<c;b++)e=a[b],g+=e.x,h+=e.y;return d=a.length,new f.Point(g/d,h/d)},l.llToPt=function(a){return this.projHelper.getProjection().fromLatLngToDivPixel(a)},l.ptToLl=function(a){return this.projHelper.getProjection().fromDivPixelToLatLng(a)},l.minExtract=function(a,b){var c,d,e,f,g,h,i;for(e=g=0,h=a.length;g<h;e=++g)f=a[e],i=b(f),("undefined"==typeof c||null===c||i<d)&&(d=i,c=e);return a.splice(c,1)[0]},l.arrIndexOf=function(a,b){var c,d,e,f;if(null!=a.indexOf)return a.indexOf(b);for(c=d=0,e=a.length;d<e;c=++d)if(f=a[c],f===b)return c;return-1},d}()}.apply(c),b.then(function(){c.OverlappingMarkerSpiderfier.initializeGoogleMaps(a.google)}),this.OverlappingMarkerSpiderfier}]),b.module("uiGmapgoogle-maps.extensions").service("uiGmapExtendMarkerClusterer",["uiGmapLodash","uiGmapPropMap",function(b,d){return{init:c.once(function(){(function(){var c={}.hasOwnProperty,e=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};a.NgMapCluster=function(a){function c(a){c.__super__.constructor.call(this,a),this.markers_=new d}return e(c,a),c.prototype.addMarker=function(a){var b,c;if(this.isMarkerAlreadyAdded_(a)){var d=this.markers_.get(a.key);if(d.getPosition().lat()==a.getPosition().lat()&&d.getPosition().lon()==a.getPosition().lon())return!1}if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,f=(this.center_.lat()*(e-1)+a.getPosition().lat())/e,g=(this.center_.lng()*(e-1)+a.getPosition().lng())/e;this.center_=new google.maps.LatLng(f,g),this.calculateBounds_()}}else this.center_=a.getPosition(),this.calculateBounds_();return a.isAdded=!0,this.markers_.push(a),b=this.markers_.length,c=this.markerClusterer_.getMaxZoom(),null!==c&&this.map_.getZoom()>c?a.getMap()!==this.map_&&a.setMap(this.map_):b<this.minClusterSize_?a.getMap()!==this.map_&&a.setMap(this.map_):b===this.minClusterSize_?this.markers_.each(function(a){a.setMap(null)}):a.setMap(null),!0},c.prototype.isMarkerAlreadyAdded_=function(a){return b.isNullOrUndefined(this.markers_.get(a.key))},c.prototype.getBounds=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);return this.getMarkers().each(function(b){a.extend(b.getPosition())}),a},c.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=new d,delete this.markers_},c}(Cluster),a.NgMapMarkerClusterer=function(a){function b(a,c,e){b.__super__.constructor.call(this,a,c,e),this.markers_=new d}return e(b,a),b.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=new d},b.prototype.removeMarker_=function(a){return!!this.markers_.get(a.key)&&(a.setMap(null),this.markers_.remove(a.key),!0)},b.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length),h=this.markers_.values();for(b=a;b<g;b++)c=h[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);if(g<this.markers_.length)this.timerRefStatic=setTimeout(function(){e.createClusters_(g)},0);else{for(b=0;b<this.clusters_.length;b++)this.clusters_[b].updateIcon_();delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this)}}},b.prototype.addToClosestCluster_=function(a){var b,c,d,e,f=4e4,g=null;for(b=0;b<this.clusters_.length;b++)d=this.clusters_[b],e=d.getCenter(),e&&(c=this.distanceBetweenPoints_(e,a.getPosition()),c<f&&(f=c,g=d));g&&g.isMarkerInClusterBounds(a)?g.addMarker(a):(d=new NgMapCluster(this),d.addMarker(a),this.clusters_.push(d))},b.prototype.redraw_=function(){this.createClusters_(0)},b.prototype.resetViewport_=function(a){var b;for(b=0;b<this.clusters_.length;b++)this.clusters_[b].remove();this.clusters_=[],this.markers_.each(function(b){b.isAdded=!1,a&&b.setMap(null)})},b.prototype.extend=function(a,b){return function(a){var b;for(b in a.prototype)"constructor"!==b&&(this.prototype[b]=a.prototype[b]);return this}.apply(a,[b])},ClusterIcon.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="<img src='"+this.url_+"' style='position: absolute; top: "+d+"px; left: "+c+"px; ",a+=this.cluster_.getMarkerClusterer().enableRetinaIcons_?"width: "+this.width_+"px;height: "+this.height_+"px;":"clip: rect("+-1*d+"px, "+(-1*c+this.width_)+"px, "+(-1*d+this.height_)+"px, "+-1*c+"px);",a+="'>",this.div_.innerHTML=a+"<div style='position: absolute;top: "+this.anchorText_[0]+"px;left: "+this.anchorText_[1]+"px;color: "+this.textColor_+";font-size: "+this.textSize_+"px;font-family: "+this.fontFamily_+";font-weight: "+this.fontWeight_+";font-style: "+this.fontStyle_+";text-decoration: "+this.textDecoration_+";text-align: center;width: "+this.width_+"px;line-height:"+this.height_+"px;'>"+this.sums_.text+"</div>","undefined"==typeof this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""}this.visible_=!0},b}(MarkerClusterer)}).call(this)})}}])}(window,angular,_);
13
//# sourceMappingURL=angular-google-maps-street-view_dev_mapped.min.js.map

+ 4 - 0
client/js/jquery-3.1.1.min.js

@ -0,0 +1,4 @@
1
/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
2
!function(a,b){"use strict";"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){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.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||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},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?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;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;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=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={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.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=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$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("fieldset");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=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;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 function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(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 qa(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},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=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),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){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.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===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(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,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):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(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!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&&C.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.escape=function(a){return(a+"").replace(ba,ca)},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:V,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(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===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 V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.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(_,aa).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("(^|"+K+")"+a+"("+K+"|$)"))&&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(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},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,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/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=I(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(P,"$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(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).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:oa(!1),disabled:oa(!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 X.test(a.nodeName)},input:function(a){return W.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:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?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 ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,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=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[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 sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(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 va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(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?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(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}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};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=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return 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){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),
3
a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;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},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.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=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),$(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.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 V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.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=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=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};function ea(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&aa.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ca(this)?r(this).show():r(this).hide()})}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={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,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),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),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==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,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ua:va,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(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=va),this.each(function(){r.event.remove(this,a,c,b)})}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.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 Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(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&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",qa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,qa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.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 Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,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=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.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=aa.exec(c))&&e[1]&&(c=ea(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.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=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,function(){return Xa(a,b,d)})},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}}),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.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):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ca(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],_a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done(function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.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 hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Za||cb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Za||cb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.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;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.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)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=hb(this,r.extend({},a),f);(e||V.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=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.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||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.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;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(db(b,!0),a,d,e)}}),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)),
4
void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.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){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.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 Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.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 Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(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}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(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}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,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"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(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 r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=mb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.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),r.isFunction(b)&&(b=b.call(a,c,r.extend({},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)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({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)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});

+ 95 - 0
client/js/main.js

@ -0,0 +1,95 @@
1
var app = angular.module('satTrackApp', ['ngMap']);
2
var socket = io();
3
4
app.controller('satTrack-ctrl', function($scope, NgMap) {
5
  $scope.places = [];
6
  $scope.passes = [];
7
  $scope.isGettingPasses = false;
8
9
  var elevator;
10
  var numGetPasses = 0;
11
12
  $scope.removePoint = function(id) {
13
    $scope.places[id].marker.setMap(null);
14
    $scope.places[id].marker = null;
15
    $scope.places.splice(id, 1);
16
    for(var i = 0; i < $scope.places.length; i++) {
17
      $scope.places[i].marker.setLabel((i + 1).toString());
18
    }
19
  }
20
21
  NgMap.getMap().then(function(map) {
22
23
    google.maps.event.addListener(map, 'click', function(event) {
24
      var marker = new google.maps.Marker({
25
          position: event.latLng,
26
          map: map,
27
          label: ($scope.places.length + 1).toString(),
28
          draggable: true
29
      });
30
31
      elevator = new google.maps.ElevationService;
32
33
      google.maps.event.addListener(marker, 'dragend', function () {
34
        $scope.$apply();
35
      });
36
37
      $scope.places.push({marker: marker, angle: 10});
38
      $scope.$apply();
39
    });
40
  });
41
42
  $scope.getPasses = function() {
43
    $scope.isGettingPasses = true;
44
    callsRemaining = $scope.places.length;
45
    for(var i = 0; i < $scope.places.length; i++) {
46
      let place = $scope.places[i];
47
      elevator.getElevationForLocations({locations: [$scope.places[i].marker.position]}, function(results, status) {
48
        if(status === 'OK' && results[0]) {
49
          place.height = Math.max(results[0].elevation / 1000, 0);
50
          callsRemaining--;
51
          if(callsRemaining <= 0) sendCoords();
52
        } else {
53
          alert('Something went very wrong');
54
        }
55
      });
56
    }
57
    var sendCoords = function() {
58
    var coords = $scope.places.map(function(a) {
59
      return {
60
        lat: a.marker.position.lat(),
61
        lng: a.marker.position.lng(),
62
        height: a.height,
63
        angle: a.angle};
64
      });
65
      numGetPasses++;
66
      socket.emit('getPasses', {coords: coords, checksum: numGetPasses});
67
    }
68
  }
69
70
  $scope.getDate = function(date) {
71
    //console.log(date);
72
    return moment(date).format("MMM D");
73
  }
74
75
  $scope.getTime = function(date) {
76
    return moment(date).format("HH:mm:ss");
77
  }
78
79
  $scope.getDifferenceInMinutes = function(a, b) {
80
    var d = moment.duration(moment(a).diff(moment(b)));
81
    return (d / 60000) + " minutes";
82
  }
83
84
  socket.on('passes', function(data) {
85
    if(data.checksum == numGetPasses) {
86
      $scope.passes = data.passes;
87
      $scope.isGettingPasses = false;
88
      $scope.$apply();
89
    }
90
  });
91
92
  socket.on('satList', function(data) {
93
    console.log(data);
94
  });
95
});

+ 107 - 0
client/js/main_old.js

@ -0,0 +1,107 @@
1
function initMap() {
2
  var f_coords = {lat: 44.648862, lng: -63.575320};
3
  var s_coords = {lat: 51.165691, lng: 10.451526};
4
  var map = new google.maps.Map(document.getElementById('map'), {
5
    zoom: 4,
6
    center: f_coords
7
  });
8
  var f_marker = new google.maps.Marker({
9
    position: f_coords,
10
    map: map
11
  });
12
  var s_marker = new google.maps.Marker({
13
    position: s_coords,
14
    map: map
15
  });
16
17
  google.maps.event.addListener(map, 'mousemove', function (event) {
18
    var lat = event.latLng.lat();
19
    var long = event.latLng.lng();
20
    console.log(latLongToCartesian({lat: lat, lng: long}));
21
  });
22
23
  var f = latLongToCartesian(f_coords);
24
  f.ang = 10;
25
  var s = latLongToCartesian(s_coords);
26
  s.ang = 10;
27
  slopes = getSlopes(f, s);
28
  heatmap_data = [];
29
  for(var lat = -90; lat < 90; lat++) {
30
    for(var long = -180; long < 180; long++) {
31
      var coordsToCheck = latLongToCartesian({lat: lat, lng: long}, 6000);
32
      var y = coordsToCheck.x;
33
      var x = coordsToCheck.y;
34
      coordsToCheck.y = y;
35
      coordsToCheck.x = x;
36
      if(checkIfPointValid(coordsToCheck, slopes, f, s))
37
      {
38
        console.log("Lat:" + lat + " Long: " + long + " works");
39
        heatmap_data.push(new google.maps.LatLng(lat, long));
40
      }
41
    }
42
  }
43
  var heatmap = new google.maps.visualization.HeatmapLayer({
44
    data: heatmap_data,
45
    dissipating: false,
46
    map: map
47
  });
48
}
49
50
var getSlopes = function(f, s) {
51
  var fAng = f.ang * (Math.PI / 180);
52
  var sAng = s.ang * (Math.PI / 180);
53
  var fNorthernHemi = true;
54
  var sNorthernHemi = true;
55
56
  //Fix for southern hemisphere
57
  if(f.y < 0) {
58
    fAng *= -1;
59
    fNorthernHemi = false;
60
  }
61
  if(s.y < 0) {
62
    sAng *= -1;
63
    sNorthernHemi = false;
64
    console.log("boop" + s.y);
65
  }
66
67
  return {
68
    h: Math.tan(fAng + Math.atan(-f.x/f.y)),
69
    i: Math.tan(-sAng + Math.atan(-s.x/s.y)),
70
    j: Math.tan(fAng + Math.atan(-f.z/f.y)),
71
    k: Math.tan(-sAng + Math.atan(-s.z/s.y)),
72
    fNHemi: fNorthernHemi,
73
    sNHemi: sNorthernHemi
74
  };
75
}
76
77
var checkIfPointValid = function(p, m, f, s) { //Point, slopes, first point, second point
78
  var yh = m.h * (p.x - f.x) + f.y;
79
  var yi = m.i * (p.x - s.x) + s.y;
80
  var yj = m.j * (p.z - f.z) + f.y;
81
  var yk = m.k * (p.z - s.z) + s.y;
82
  if ((m.fNHemi && p.y >= yh && p.y >= yj) || (!m.fNHemi && p.y <= yh && p.y <= yj)) {
83
    /*console.log(p.z + " " + s.z + " " + s.y + " " + m.k);
84
    console.log(yk);
85
    console.log(p.y);*/
86
    if ((m.sNHemi && p.y >= yi && p.y >= yk) || (!m.sNHemi && p.y <= yi && p.y <= yk)) {
87
      return true; //Yay!
88
    }
89
  }
90
  return false;
91
}
92
93
var latLongToCartesian = function(point, height = 0) {
94
  var earthRadius = 6371; //KM
95
96
  var nRadius = earthRadius + height;
97
  var nLat = (Math.PI/180) * point.lat;
98
  var nLong = (Math.PI/180) * point.lng;
99
  return {
100
    /*x: nRadius * Math.cos(nLat) * Math.cos(nLong),
101
    z: nRadius * Math.cos(nLat) * Math.sin(nLong),
102
    y: nRadius * Math.sin(nLat)*/
103
    x: nLat,
104
    y: nLong,
105
    z: height
106
  };
107
}

+ 551 - 0
client/js/moment.min.js

@ -0,0 +1,551 @@
1
//! moment.js
2
//! version : 2.17.1
3
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
//! license : MIT
5
//! momentjs.com
6
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return od.apply(null,arguments)}
7
// This is done to register the method called with moment()
8
// without creating circular dependencies.
9
function b(a){od=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){
10
// IE8 will treat undefined and null as object if it wasn't for
11
// input != null
12
return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a)
13
// even if its not own property I'd still call it non-empty
14
return!1;return!0}function f(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function g(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function h(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function i(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function j(a,b){for(var c in b)i(b,c)&&(a[c]=b[c]);return i(b,"toString")&&(a.toString=b.toString),i(b,"valueOf")&&(a.valueOf=b.valueOf),a}function k(a,b,c,d){return rb(a,b,c,d,!0).utc()}function l(){
15
// We need to deep clone this object.
16
return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function m(a){return null==a._pf&&(a._pf=l()),a._pf}function n(a){if(null==a._isValid){var b=m(a),c=qd.call(b.parsedDateParts,function(a){return null!=a}),d=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c);if(a._strict&&(d=d&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour),null!=Object.isFrozen&&Object.isFrozen(a))return d;a._isValid=d}return a._isValid}function o(a){var b=k(NaN);return null!=a?j(m(b),a):m(b).userInvalidated=!0,b}function p(a){return void 0===a}function q(a,b){var c,d,e;if(p(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),p(b._i)||(a._i=b._i),p(b._f)||(a._f=b._f),p(b._l)||(a._l=b._l),p(b._strict)||(a._strict=b._strict),p(b._tzm)||(a._tzm=b._tzm),p(b._isUTC)||(a._isUTC=b._isUTC),p(b._offset)||(a._offset=b._offset),p(b._pf)||(a._pf=m(b)),p(b._locale)||(a._locale=b._locale),rd.length>0)for(c in rd)d=rd[c],e=b[d],p(e)||(a[d]=e);return a}
17
// Moment prototype object
18
function r(b){q(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),
19
// Prevent infinite loop in case updateOffset creates new moment
20
// objects.
21
sd===!1&&(sd=!0,a.updateOffset(this),sd=!1)}function s(a){return a instanceof r||null!=a&&null!=a._isAMomentObject}function t(a){return a<0?Math.ceil(a)||0:Math.floor(a)}function u(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=t(b)),c}
22
// compare two arrays, return the number of differences
23
function v(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;d<e;d++)(c&&a[d]!==b[d]||!c&&u(a[d])!==u(b[d]))&&g++;return g+f}function w(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function x(b,c){var d=!0;return j(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,b),d){for(var e,f=[],g=0;g<arguments.length;g++){if(e="","object"==typeof arguments[g]){e+="\n["+g+"] ";for(var h in arguments[0])e+=h+": "+arguments[0][h]+", ";e=e.slice(0,-2)}else e=arguments[g];f.push(e)}w(b+"\nArguments: "+Array.prototype.slice.call(f).join("")+"\n"+(new Error).stack),d=!1}return c.apply(this,arguments)},c)}function y(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),td[b]||(w(c),td[b]=!0)}function z(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function A(a){var b,c;for(c in a)b=a[c],z(b)?this[c]=b:this["_"+c]=b;this._config=a,
24
// Lenient ordinal parsing accepts just a number in addition to
25
// number + (possibly) stuff coming from _ordinalParseLenient.
26
this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function B(a,b){var c,e=j({},a);for(c in b)i(b,c)&&(d(a[c])&&d(b[c])?(e[c]={},j(e[c],a[c]),j(e[c],b[c])):null!=b[c]?e[c]=b[c]:delete e[c]);for(c in a)i(a,c)&&!i(b,c)&&d(a[c])&&(
27
// make sure changes to properties don't modify parent config
28
e[c]=j({},e[c]));return e}function C(a){null!=a&&this.set(a)}function D(a,b,c){var d=this._calendar[a]||this._calendar.sameElse;return z(d)?d.call(b,c):d}function E(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function F(){return this._invalidDate}function G(a){return this._ordinal.replace("%d",a)}function H(a,b,c,d){var e=this._relativeTime[c];return z(e)?e(a,b,c,d):e.replace(/%d/i,a)}function I(a,b){var c=this._relativeTime[a>0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Dd[c]=Dd[c+"s"]=Dd[b]=a}function K(a){return"string"==typeof a?Dd[a]||Dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)i(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Ed[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Ed[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}
29
// MOMENTS
30
function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d<c.length;d++)this[c[d].unit](a[c[d].unit])}else if(a=K(a),z(this[a]))return this[a](b);return this}function T(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}
31
// token:    'M'
32
// padded:   ['MM', 2]
33
// ordinal:  'Mo'
34
// callback: function () { this.month() + 1 }
35
function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Id[a]=e),b&&(Id[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Id[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Fd);for(b=0,c=d.length;b<c;b++)Id[d[b]]?d[b]=Id[d[b]]:d[b]=V(d[b]);return function(b){var e,f="";for(e=0;e<c;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}}
36
// format date using native date object
37
function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}function Y(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Gd.lastIndex=0;d>=0&&Gd.test(a);)a=a.replace(Gd,c),Gd.lastIndex=0,d-=1;return a}function Z(a,b,c){$d[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return i($d,a)?$d[a](b._strict,b._locale):new RegExp(_(a))}
38
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
39
function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),f(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c<a.length;c++)_d[a[c]]=d}function ca(a,b){ba(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function da(a,b,c){null!=b&&i(_d,a)&&_d[a](b,c._a,c,a)}function ea(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function fa(a,b){return a?c(this._months)?this._months[a.month()]:this._months[(this._months.isFormat||ke).test(b)?"format":"standalone"][a.month()]:this._months}function ga(a,b){return a?c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[ke.test(b)?"format":"standalone"][a.month()]:this._monthsShort}function ha(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(
40
// this is not used
41
this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)f=k([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:null):(e=je.call(this._longMonthsParse,g),e!==-1?e:null):"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:(e=je.call(this._longMonthsParse,g),e!==-1?e:null)):(e=je.call(this._longMonthsParse,g),e!==-1?e:(e=je.call(this._shortMonthsParse,g),e!==-1?e:null))}function ia(a,b,c){var d,e,f;if(this._monthsParseExact)return ha.call(this,a,b,c);
42
// TODO: add sorting
43
// Sorting makes sure if one month (or abbr) is a prefix of another
44
// see sorting in computeMonthsParse
45
for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){
46
// test the regex
47
if(
48
// make the regex if we don't have it already
49
e=k([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}
50
// MOMENTS
51
function ja(a,b){var c;if(!a.isValid())
52
// No op
53
return a;if("string"==typeof b)if(/^\d+$/.test(b))b=u(b);else
54
// TODO: Another silent failure?
55
if(b=a.localeData().monthsParse(b),!f(b))return a;return c=Math.min(a.date(),ea(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ka(b){return null!=b?(ja(this,b),a.updateOffset(this,!0),this):P(this,"Month")}function la(){return ea(this.year(),this.month())}function ma(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ne),this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex)}function na(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=oe),this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex)}function oa(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;b<12;b++)
56
// make the regex if we don't have it already
57
c=k([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(
58
// Sorting makes sure if one month (or abbr) is a prefix of another it
59
// will match the longer piece.
60
d.sort(a),e.sort(a),f.sort(a),b=0;b<12;b++)d[b]=aa(d[b]),e[b]=aa(e[b]);for(b=0;b<24;b++)f[b]=aa(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}
61
// HELPERS
62
function pa(a){return qa(a)?366:365}function qa(a){return a%4===0&&a%100!==0||a%400===0}function ra(){return qa(this.year())}function sa(a,b,c,d,e,f,g){
63
//can't just apply() to create a date:
64
//http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
65
var h=new Date(a,b,c,d,e,f,g);
66
//the date constructor remaps years 0-99 to 1900-1999
67
return a<100&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments));
68
//the Date.UTC function remaps years 0-99 to 1900-1999
69
return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}
70
// start-of-first-week - start-of-year
71
function ua(a,b,c){var// first-week day -- which january is always in the first week (4 for iso, 1 for other)
72
d=7+b-c,
73
// first-week day local weekday -- which local weekday is fwd
74
e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1}
75
//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
76
function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7}
77
// HELPERS
78
// LOCALES
79
function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy}
80
// MOMENTS
81
function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}
82
// HELPERS
83
function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:this._weekdays}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=k([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){
84
// test the regex
85
if(
86
// make the regex if we don't have it already
87
e=k([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}
88
// MOMENTS
89
function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN;
90
// behaves the same as moment#day except
91
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
92
// as a setter, sunday should belong to the previous week.
93
if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=ue),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ve),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=we),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++)
94
// make the regex if we don't have it already
95
c=k([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for(
96
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
97
// will match the longer piece.
98
g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}
99
// FORMATTING
100
function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}
101
// PARSING
102
function Ua(a,b){return b._meridiemParse}
103
// LOCALES
104
function Va(a){
105
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
106
// Using charAt should be more compatible.
107
return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a}
108
// pick the locale from the array
109
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
110
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
111
function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split("-"),b=e.length,c=Xa(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)
112
//the next array item is better than a shallower substring of this one
113
break;b--}f++}return null}function Za(a){var b=null;
114
// TODO: Find a better way to register and load all the locales in Node
115
if(!Be[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=xe._abbr,require("./locale/"+a),
116
// because defineLocale currently also sets the global locale, we
117
// want to undo that for lazy loaded locales
118
$a(b)}catch(a){}return Be[a]}
119
// This function will load locale and then set the global locale.  If
120
// no arguments are passed in, it will simply return the current global
121
// locale key.
122
function $a(a,b){var c;
123
// moment.duration._locale = moment._locale = data;
124
return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}function _a(a,b){if(null!==b){var c=Ae;if(b.abbr=a,null!=Be[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Be[a]._config;else if(null!=b.parentLocale){if(null==Be[b.parentLocale])return Ce[b.parentLocale]||(Ce[b.parentLocale]=[]),Ce[b.parentLocale].push({name:a,config:b}),null;c=Be[b.parentLocale]._config}
125
// backwards compat for now: also set the locale
126
// make sure we set the locale AFTER all child locales have been
127
// created, so we won't end up with the child locale set.
128
return Be[a]=new C(B(c,b)),Ce[a]&&Ce[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Be[a]}
129
// useful for testing
130
return delete Be[a],null}function ab(a,b){if(null!=b){var c,d=Ae;
131
// MERGE
132
null!=Be[a]&&(d=Be[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Be[a],Be[a]=c,
133
// backwards compat for now: also set the locale
134
$a(a)}else
135
// pass null for config to unupdate, useful for tests
136
null!=Be[a]&&(null!=Be[a].parentLocale?Be[a]=Be[a].parentLocale:null!=Be[a]&&delete Be[a]);return Be[a]}
137
// returns locale data
138
function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return xe;if(!c(a)){if(
139
//short-circuit everything else
140
b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return wd(Be)}function db(a){var b,c=a._a;return c&&m(a).overflow===-2&&(b=c[be]<0||c[be]>11?be:c[ce]<1||c[ce]>ea(c[ae],c[be])?ce:c[de]<0||c[de]>24||24===c[de]&&(0!==c[ee]||0!==c[fe]||0!==c[ge])?de:c[ee]<0||c[ee]>59?ee:c[fe]<0||c[fe]>59?fe:c[ge]<0||c[ge]>999?ge:-1,m(a)._overflowDayOfYear&&(b<ae||b>ce)&&(b=ce),m(a)._overflowWeeks&&b===-1&&(b=he),m(a)._overflowWeekday&&b===-1&&(b=ie),m(a).overflow=b),a}
141
// date from iso format
142
function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){
143
// match[2] should be 'T' or space
144
f=(i[2]||" ")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),kb(a)}else a._isValid=!1}
145
// date from iso format or fallback
146
function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}
147
// Pick the first defined of two or three arguments.
148
function gb(a,b,c){return null!=a?a:null!=b?b:c}function hb(b){
149
// hooks is actually the exported moment object
150
var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}
151
// convert an array to a date.
152
// the array should mirror the parameters below
153
// note: all values past the year are optional and will default to the lowest possible value.
154
// [year, month, day , hour, minute, second, millisecond]
155
function ib(a){var b,c,d,e,f=[];if(!a._d){
156
// Default to current date.
157
// * if no year, month, day of month are given, default to today
158
// * if day of month is given, default month and year
159
// * if month is given, default only year
160
// * if year is given, don't default anything
161
for(d=hb(a),
162
//compute day of the year from weeks and weekdays
163
a._w&&null==a._a[ce]&&null==a._a[be]&&jb(a),
164
//if the day of the year is set, figure out what it is
165
a._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];
166
// Zero out whatever was not defaulted, including time
167
for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];
168
// Check for 24:00:00.000
169
24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f),
170
// Apply timezone offset from input. The actual utcOffset can be changed
171
// with parseZone.
172
null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}function jb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4,
173
// TODO: We need to take the current isoWeekYear, but that depends on
174
// how we interpret now (local, utc, fixed offset). So create
175
// a now version of current config (take local/utc/offset flags, and
176
// create now).
177
c=gb(b.GG,a._a[ae],wa(sb(),1,4).year),d=gb(b.W,1),e=gb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(sb(),f,g);c=gb(b.gg,a._a[ae],j.year),
178
// Default to current week.
179
d=gb(b.w,j.week),null!=b.d?(
180
// weekday -- low day numbers are considered next week
181
e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?(
182
// local weekday -- counting starts from begining of week
183
e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):
184
// default to begining of week
185
e=f}d<1||d>xa(c,f,g)?m(a)._overflowWeeks=!0:null!=i?m(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ae]=h.year,a._dayOfYear=h.dayOfYear)}
186
// date from string and format string
187
function kb(b){
188
// TODO: Move this to another part of the creation flow to prevent circular deps
189
if(b._f===a.ISO_8601)return void eb(b);b._a=[],m(b).empty=!0;
190
// This array is used to make a Date, either with `new Date` or `Date.UTC`
191
var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Fd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match($(f,b))||[])[0],
192
// console.log('token', token, 'parsedInput', parsedInput,
193
//         'regex', getParseRegexForToken(token, config));
194
d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&m(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),
195
// don't parse if it's not a known token
196
Id[f]?(d?m(b).empty=!1:m(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&m(b).unusedTokens.push(f);
197
// add remaining unparsed input length to the string
198
m(b).charsLeftOver=i-j,h.length>0&&m(b).unusedInput.push(h),
199
// clear _12h flag if hour is <= 12
200
b._a[de]<=12&&m(b).bigHour===!0&&b._a[de]>0&&(m(b).bigHour=void 0),m(b).parsedDateParts=b._a.slice(0),m(b).meridiem=b._meridiem,
201
// handle meridiem
202
b._a[de]=lb(b._locale,b._a[de],b._meridiem),ib(b),db(b)}function lb(a,b,c){var d;
203
// Fallback
204
return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b}
205
// date from string and array of format strings
206
function mb(a){var b,c,d,e,f;if(0===a._f.length)return m(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],kb(b),n(b)&&(
207
// if there is any input that was not parsed add a penalty for that format
208
f+=m(b).charsLeftOver,
209
//or tokens
210
f+=10*m(b).unusedTokens.length,m(b).score=f,(null==d||f<d)&&(d=f,c=b));j(a,c||b)}function nb(a){if(!a._d){var b=L(a._i);a._a=h([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ib(a)}}function ob(a){var b=new r(db(pb(a)));
211
// Adding is smart enough around DST
212
return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function pb(a){var b=a._i,d=a._f;return a._locale=a._locale||bb(a._l),null===b||void 0===d&&""===b?o({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),s(b)?new r(db(b)):(g(b)?a._d=b:c(d)?mb(a):d?kb(a):qb(a),n(a)||(a._d=null),a))}function qb(b){var d=b._i;void 0===d?b._d=new Date(a.now()):g(d)?b._d=new Date(d.valueOf()):"string"==typeof d?fb(b):c(d)?(b._a=h(d.slice(0),function(a){return parseInt(a,10)}),ib(b)):"object"==typeof d?nb(b):f(d)?
213
// from milliseconds
214
b._d=new Date(d):a.createFromInputFallback(b)}function rb(a,b,f,g,h){var i={};
215
// object construction must be done this way.
216
// https://github.com/moment/moment/issues/1423
217
return f!==!0&&f!==!1||(g=f,f=void 0),(d(a)&&e(a)||c(a)&&0===a.length)&&(a=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=h,i._l=f,i._i=a,i._f=b,i._strict=g,ob(i)}function sb(a,b,c,d){return rb(a,b,c,d,!1)}
218
// Pick a moment m from moments so that m[fn](other) is true for all
219
// other. This relies on the function fn to be transitive.
220
//
221
// moments should either be an array of moment objects or an array, whose
222
// first element is an array of moment objects.
223
function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}
224
// TODO: Use [].sort instead?
225
function ub(){var a=[].slice.call(arguments,0);return tb("isBefore",a)}function vb(){var a=[].slice.call(arguments,0);return tb("isAfter",a)}function wb(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;
226
// representation for dateAddRemove
227
this._milliseconds=+k+1e3*j+// 1000
228
6e4*i+// 1000 * 60
229
1e3*h*60*60,//using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
230
// Because of dateAddRemove treats 24 hours as different from a
231
// day when working around DST, we need to store them separately
232
this._days=+g+7*f,
233
// It is impossible translate months into days without knowing
234
// which months you are are talking about, so we have to store
235
// it separately.
236
this._months=+e+3*d+12*c,this._data={},this._locale=bb(),this._bubble()}function xb(a){return a instanceof wb}function yb(a){return a<0?Math.round(-1*a)*-1:Math.round(a)}
237
// FORMATTING
238
function zb(a,b){U(a,0,0,function(){var a=this.utcOffset(),c="+";return a<0&&(a=-a,c="-"),c+T(~~(a/60),2)+b+T(~~a%60,2)})}function Ab(a,b){var c=(b||"").match(a);if(null===c)return null;var d=c[c.length-1]||[],e=(d+"").match(Me)||["-",0,0],f=+(60*e[1])+u(e[2]);return 0===f?0:"+"===e[0]?f:-f}
239
// Return a moment from input, that is local/utc/zone equivalent to model.
240
function Bb(b,c){var d,e;
241
// Use low-level api, because this fn is low-level api.
242
return c._isUTC?(d=c.clone(),e=(s(b)||g(b)?b.valueOf():sb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):sb(b).local()}function Cb(a){
243
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
244
// https://github.com/moment/moment/pull/1871
245
return 15*-Math.round(a._d.getTimezoneOffset()/15)}
246
// MOMENTS
247
// keepLocalTime = true means only change the timezone, without
248
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
249
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
250
// +0200, so we adjust the time as needed, to be valid.
251
//
252
// Keeping the time actually adds/subtracts (one hour)
253
// from the actual represented time. That is why we call updateOffset
254
// a second time. In case it wants us to change the offset again
255
// _changeInProgress == true case, then we have to adjust, because
256
// there is no such time in the given timezone.
257
function Db(b,c){var d,e=this._offset||0;if(!this.isValid())return null!=b?this:NaN;if(null!=b){if("string"==typeof b){if(b=Ab(Xd,b),null===b)return this}else Math.abs(b)<16&&(b=60*b);return!this._isUTC&&c&&(d=Cb(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?Tb(this,Ob(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?e:Cb(this)}function Eb(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Fb(a){return this.utcOffset(0,a)}function Gb(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Cb(this),"m")),this}function Hb(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var a=Ab(Wd,this._i);null!=a?this.utcOffset(a):this.utcOffset(0,!0)}return this}function Ib(a){return!!this.isValid()&&(a=a?sb(a).utcOffset():0,(this.utcOffset()-a)%60===0)}function Jb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Kb(){if(!p(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=pb(a),a._a){var b=a._isUTC?k(a._a):sb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lb(){return!!this.isValid()&&!this._isUTC}function Mb(){return!!this.isValid()&&this._isUTC}function Nb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ob(a,b){var c,d,e,g=a,
258
// matching against regexp is expensive, do it on demand
259
h=null;// checks for null or undefined
260
return xb(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:f(a)?(g={},b?g[b]=a:g.milliseconds=a):(h=Ne.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:u(h[ce])*c,h:u(h[de])*c,m:u(h[ee])*c,s:u(h[fe])*c,ms:u(yb(1e3*h[ge]))*c}):(h=Oe.exec(a))?(c="-"===h[1]?-1:1,g={y:Pb(h[2],c),M:Pb(h[3],c),w:Pb(h[4],c),d:Pb(h[5],c),h:Pb(h[6],c),m:Pb(h[7],c),s:Pb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Rb(sb(g.from),sb(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new wb(g),xb(a)&&i(a,"_locale")&&(d._locale=a._locale),d}function Pb(a,b){
261
// We'd normally use ~~inp for this, but unfortunately it also
262
// converts floats to ints.
263
// inp may be undefined, so careful calling replace on it.
264
var c=a&&parseFloat(a.replace(",","."));
265
// apply sign while we're at it
266
return(isNaN(c)?0:c)*b}function Qb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Rb(a,b){var c;return a.isValid()&&b.isValid()?(b=Bb(b,a),a.isBefore(b)?c=Qb(a,b):(c=Qb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}
267
// TODO: remove 'name' arg after deprecation is removed
268
function Sb(a,b){return function(c,d){var e,f;
269
//invert the arguments, but complain about it
270
return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}function Tb(b,c,d,e){var f=c._milliseconds,g=yb(c._days),h=yb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Ub(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Vb(b,c){
271
// We want to compare the start of today, vs this.
272
// Getting start-of-today depends on whether we're local/utc/offset or not.
273
var d=b||sb(),e=Bb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,sb(d)))}function Wb(){return new r(this)}function Xb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf())}function Yb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf())}function Zb(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function $b(a,b){var c,d=s(a)?a:sb(a);return!(!this.isValid()||!d.isValid())&&(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf()))}function _b(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function ac(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function bc(a,b,c){var d,e,f,g;// 1000