[
  {
    "path": "ChatGPT/.gitattributes",
    "content": "*.js linguist-vendored\n*.tsx linguist-vendored\n*.scss linguist-vendored\nsrc/**/*.ts linguist-vendored"
  },
  {
    "path": "ChatGPT/.gitignore",
    "content": "package-lock.json\nnode_modules/\n\n.yarn/*\n.pnp.*\n\n# rust\ntarget/\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n"
  },
  {
    "path": "ChatGPT/.husky/pre-commit",
    "content": "#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpm run pretty-quick\ncargo fmt\ngit add ."
  },
  {
    "path": "ChatGPT/.npmrc",
    "content": "registry=https://registry.npmjs.org/\nengine-strict=true"
  },
  {
    "path": "ChatGPT/.prettierignore",
    "content": "package-lock.json\nnode_modules/\nyarn.lock\n*.lock\n\ncasks/\n\n# rust\nsrc-tauri/\ntarget/\nCargo.lock\n*.toml\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\nassets/**\npublic/**\n\n.gitattributes\n.gitignore\n.prettierignore\n\nLICENSE"
  },
  {
    "path": "ChatGPT/.prettierrc",
    "content": "{\n  \"trailingComma\": \"all\",\n  \"singleQuote\": true,\n  \"semi\": true,\n  \"tabWidth\": 2,\n  \"printWidth\": 100\n}\n"
  },
  {
    "path": "ChatGPT/.vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\"tauri-apps.tauri-vscode\", \"rust-lang.rust-analyzer\"]\n}\n"
  },
  {
    "path": "ChatGPT/Cargo.toml",
    "content": "[workspace]\nmembers = [\"src-tauri\"]\n\n# fix: mac v1.2.0 can not copy/paste\n# https://github.com/tauri-apps/tauri/issues/5669\n[profile.release]\nstrip = true\nlto = true\nopt-level = \"s\"\n"
  },
  {
    "path": "ChatGPT/LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>."
  },
  {
    "path": "ChatGPT/README-ZH_CN.md",
    "content": "<p align=\"center\">\n  <img width=\"180\" src=\"./public/logo.png\" alt=\"ChatGPT\">\n  <h1 align=\"center\">ChatGPT</h1>\n  <p align=\"center\">ChatGPT 桌面应用（Mac, Windows and Linux）</p>\n</p>\n\n[![English badge](https://img.shields.io/badge/%E8%8B%B1%E6%96%87-English-blue)](./README.md)\n[![简体中文 badge](https://img.shields.io/badge/%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-Simplified%20Chinese-blue)](./README-ZH_CN.md)\\\n[![ChatGPT downloads](https://img.shields.io/github/downloads/lencx/ChatGPT/total.svg?style=flat-square)](https://github.com/lencx/ChatGPT/releases)\n[![chat](https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord)](https://discord.gg/aPhCRf4zZr)\n[![lencx](https://img.shields.io/badge/follow-lencx__-blue?style=flat&logo=Twitter)](https://twitter.com/lencx_)\n\n<!-- [![lencx](https://img.shields.io/twitter/follow/lencx_.svg?style=social)](https://twitter.com/lencx_) -->\n\n<a href=\"https://www.buymeacoffee.com/lencx\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\" alt=\"Buy Me A Coffee\" style=\"height: 40px !important;width: 145px !important;\" ></a>\n\n**它是一个非官方项目，仅供个人学习研究。ChatGPT 桌面应用开源的这段时间，受到了很多关注，谢谢大家的支持。随着事情的发展，有两个问题严重影响了项目的下一步开发计划:**\n\n- **有人利用它进行二次打包销售，谋取私利**\n- **ChatGPT 因名称和图标问题可能会涉及侵权**\n\n**新仓库：https://github.com/lencx/nofwl**\n\n---\n\n## 📦 安装\n\n- [📝 更新日志](./UPDATE_LOG.md)\n- [🕒 历史版本...](https://github.com/lencx/ChatGPT/releases)\n\n<!-- tr-download-start -->\n\n### Windows\n\n- [ChatGPT_0.12.0_windows_x86_64.msi](https://github.com/lencx/ChatGPT/releases/download/v0.12.0/ChatGPT_0.12.0_windows_x86_64.msi)\n- 使用 [winget](https://winstall.app/apps/lencx.ChatGPT):\n\n  ```bash\n  # install the latest version\n  winget install --id=lencx.ChatGPT -e\n\n  # install the specified version\n  winget install --id=lencx.ChatGPT -e --version 0.10.0\n  ```\n\n**注意：如果安装路径和应用名称相同，会导致冲突 ([#142](https://github.com/lencx/ChatGPT/issues/142#issuecomment-0.12.0))**\n\n### Mac\n\n- [ChatGPT_0.12.0_macos_aarch64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.12.0/ChatGPT_0.12.0_macos_aarch64.dmg)\n- [ChatGPT_0.12.0_macos_x86_64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.12.0/ChatGPT_0.12.0_macos_x86_64.dmg)\n- Homebrew \\\n  _[Homebrew 快捷安装](https://brew.sh) ([Cask](https://docs.brew.sh/Cask-Cookbook)):_\n  ```sh\n  brew tap lencx/chatgpt https://github.com/lencx/ChatGPT.git\n  brew install --cask chatgpt --no-quarantine\n  ```\n  如果你坚持使用 _[Brewfile](https://github.com/Homebrew/homebrew-bundle#usage)_ ，则需要添加以下配置:\n  ```rb\n  repo = \"lencx/chatgpt\"\n  tap repo, \"https://github.com/#{repo}.git\"\n  cask \"chatgpt\", args: { \"no-quarantine\": true }\n  ```\n\n如果在 macOS 上安装软件时遇到 `“ChatGPT” is damaged and can't be opened. You should move it to the Trash.` 错误消息，可能是由于 macOS 安全设置的限制导致的。为了解决此问题，请在终端尝试以下命令：\n\n```bash\nsudo xattr -r -d com.apple.quarantine /YOUR_PATH/ChatGPT.app\n```\n\n### Linux\n\n- [ChatGPT_0.12.0_linux_x86_64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.12.0/ChatGPT_0.12.0_linux_x86_64.deb)\n- [ChatGPT_0.12.0_linux_x86_64.AppImage.tar.gz](https://github.com/lencx/ChatGPT/releases/download/v0.12.0/ChatGPT_0.12.0_linux_x86_64.AppImage.tar.gz): **工作可靠，`.deb` 运行失败时可以尝试它**\n\n<!-- tr-download-end -->\n\n## 📢 公告\n\n这是一个令人兴奋的重大更新。像 `Telegram 机器人指令` 那样工作，帮助你快速填充自定模型，来让 ChatGPT 按照你想要的方式去工作。这个项目倾注了我大量业余时间，如果它对你有所帮助，宣传转发，或者 star 都是对我的巨大鼓励。我希望我可以持续更新下去，加入更多有趣的功能。\n\n### 如何使用指令？\n\n你可以从 [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) 来寻找有趣的功能来导入到应用。也可以使用 `Sync Prompts`，来一键同步所有，如果你不想让某些提示出现在你的斜杠命令，你可以禁用它们。\n\n![chatgpt cmd](./assets/chatgpt-cmd.png)\n![chatgpt sync prompts](./assets/chatgpt-sync-prompts.png)\n\n<!-- 数据导入完成后，可以重新启动应用来使配置生效（`Menu -> Preferences -> Restart ChatGPT`）。 -->\n\n在 ChatGPT 文本输入区域，键入 `/` 开头的字符，则会弹出指令提示，按下空格键，它会默认将命令关联的文本填充到输入区域（注意：如果包含多个指令提示，它只会选择第一个作为填充，你可以持续输入，直到第一个提示命令为你想要时，再按下空格键。或者使用鼠标来点击多条指令中的某一个）。填充完成后，你只需要按下回车键即可。斜杠命令下，使用 TAB 键修改 `{q}` 标签内容（仅支持单个修改 [#54](https://github.com/lencx/ChatGPT/issues/54)）。使用键盘 `⇧` 和 `⇩`（上下键）来选择斜杠指令。\n\n![chatgpt](assets/chatgpt.gif)\n![chatgpt-cmd](assets/chatgpt-cmd.gif)\n\n## ✨ 功能概览\n\n- 跨平台: `macOS` `Linux` `Windows`\n- 导出 ChatGPT 聊天记录 (支持 PNG, PDF 和生成分享链接)\n- 主窗口和系统托盘支持自定义 URL，将任意网站包装成一个桌面应用\n- 应用自动升级通知\n- 丰富的快捷键\n- 系统托盘悬浮窗\n- 应用菜单功能强大\n- 支持斜杠命令及其配置（可手动配置或从文件同步 [#55](https://github.com/lencx/ChatGPT/issues/55)）\n- 自定义全局快捷键 ([#108](https://github.com/lencx/ChatGPT/issues/108))\n- 划词搜索 ([#122](https://github.com/lencx/ChatGPT/issues/122) 鼠标选中文本，不超过 400 个字符)：应用使用 Tauri 构建，因其安全限制，会导致部分操作按钮无效，建议前往浏览器操作。\n\n### #️⃣ 菜单项\n\n- **Preferences (喜好)**\n  - `Theme` - `Light`, `Dark`, `System` (仅支持 macOS 和 Windows)\n  - `Stay On Top`: 窗口置顶\n  - `Titlebar`: 是否显示 `Titlebar`，仅 macOS 支持\n  - `Inject Script`: 用于修改网站的用户自定义脚本\n  - `Hide Dock Icon` ([#35](https://github.com/lencx/ChatGPT/issues/35)): 隐藏 Dock 中的应用图标 (仅 macOS 支持)\n    - 系统图盘右键单击打开菜单，然后在菜单项中点击 `Show Dock Icon` 可以重新将应用图标显示在 Dock（`SystemTrayMenu -> Show Dock Icon`）\n  - `Control Center`: ChatGPT 应用的控制中心，它将为应用提供无限的可能\n    - 设置 `Theme`，`Stay On Top`，`Titlebar` 等\n    - `User Agent` ([#17](https://github.com/lencx/ChatGPT/issues/17)): 自定义 `user agent` 防止网站安全检测，默认值为空\n    - `Switch Origin` ([#14](https://github.com/lencx/ChatGPT/issues/14)): 切换网站源地址，默认为 `https://chat.openai.com`。需要注意的是镜像网站的 UI 需要和原网站一致，否则可能会导致某些功能不工作\n  - `Go to Config`: 打开 ChatGPT 配置目录 (`path: ~/.chatgpt/*`)\n  - `Clear Config`: 清除 ChatGPT 配置数据 (`path: ~/.chatgpt/*`), 这是危险操作，请提前备份数据\n  - `Restart ChatGPT`: 重启应用。如果注入脚本编辑完成，或者应用可卡死可以通过此菜单重新启动应用\n  - `Awesome ChatGPT`: 一个很棒的 ChatGPT 推荐列表\n- **Edit** - `Undo`, `Redo`, `Cut`, `Copy`, `SelectAll`, ...\n- **View** - `Go Back`, `Go Forward`, `Scroll to Top of Screen`, `Scroll to Bottom of Screen`, `Refresh the Screen`, ...\n- **Help**\n  - `Update Log`: ChatGPT 应用更新日志\n  - `Report Bug`: 报告 BUG 或反馈建议\n  - `Toggle Developer Tools`: 网站调试工具，调试页面或脚本可能需要\n\n## ⚙️ 应用配置\n\n| 平台    | 路径                      |\n| ------- | ------------------------- |\n| Linux   | `/home/lencx/.chatgpt`    |\n| macOS   | `/Users/lencx/.chatgpt`   |\n| Windows | `C:\\Users\\lencx\\.chatgpt` |\n\n- `[.chatgpt]` - 应用配置根路径\n  - `chat.conf.json` - 应用喜好配置\n  - `chat.awesome.json` - 自定义 URL 列表，类似于浏览器书签。可以将任意 URL 作为主窗口或托盘窗口 (**Control Conter -> Awesome**)\n  - `chat.model.json` - ChatGPT 输入提示，通过斜杠命令来快速完成输入，主要包含三部分:\n    - `user_custom` - 需要手动录入 (**Control Conter -> Language Model -> User Custom**)\n    - `sync_prompts` - 从 [f/awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) 同步数据 (**Control Conter -> Language Model -> Sync Prompts**)\n    - `sync_custom` - 同步自定义的 json 或 csv 文件数据，支持本地和远程 (**Control Conter -> Language Model -> Sync Custom**)\n  - `chat.model.cmd.json` - 过滤（是否启用）和排序处理后的斜杠命令数据\n  - `[cache_model]` - 缓存同步或录入的数据\n    - `chatgpt_prompts.json` - 缓存 `sync_prompts` 数据\n    - `user_custom.json` - 缓存 `user_custom` 数据\n    - `ae6cf32a6f8541b499d6bfe549dbfca3.json` - 随机生成的文件名，缓存 `sync_custom` 数据\n    - `4f695d3cfbf8491e9b1f3fab6d85715c.json` - 随机生成的文件名，缓存 `sync_custom` 数据\n    - `bd1b96f15a1644f7bd647cc53073ff8f.json` - 随机生成的文件名，缓存 `sync_custom` 数据\n\n### 客户端信息同步\n\n目前同步自定文件仅支持 json 和 csv，且需要满足以下格式，否则会导致应用异常：\n\n`JSON 格式`\n\n```json\n[\n  {\n    \"cmd\": \"a\",\n    \"act\": \"aa\",\n    \"prompt\": \"aaa aaa aaa\"\n  },\n  {\n    \"cmd\": \"b\",\n    \"act\": \"bb\",\n    \"prompt\": \"bbb bbb bbb\"\n  }\n]\n```\n\n`CSV 格式`\n\n```csv\n\"cmd\",\"act\",\"prompt\"\n\"a\",\"aa\",\"aaa aaa aaa\"\n\"b\",\"bb\",\"bbb bbb bbb\"\n```\n\n## 👀 预览\n\n<img width=\"320\" src=\"./assets/install.png\" alt=\"install\"> <img width=\"320\" src=\"./assets/chatgpt-control-center-general.png\" alt=\"control center\">\n<img width=\"320\" src=\"./assets/chatgpt-export.png\" alt=\"export\"> <img width=\"320\" src=\"./assets/chatgpt-dalle2-tray.png\" alt=\"dalle2 tray\">\n<img width=\"320\" src=\"./assets/auto-update.png\" alt=\"auto update\">\n\n## ❓ 常见问题\n\n### 不能打开 ChatGPT\n\n如果升级应用后无法打开，请尝试清除配置，它位于此目录 `~/.chatgpt/*`。\n\n### 主窗口已经登录，但是系统托盘窗口显示未登录\n\n可通过菜单项里的 `Restart ChatGPT` 重启应用来修复这个问题（`Menu -> Preferences -> Restart ChatGPT`）。\n\n### 它是否安全？\n\n它是安全的，仅仅只是对 [OpenAI ChatGPT](https://chat.openai.com) 网站的包装，注入了一些额外功能（均在本地，未发起网络请求），如果存疑，可以检查源代码。\n\n### 开发者未验证?\n\nMac 上无法安装，提示开发者未验证，具体可以查看下面给出的解决方案（它是开源的，很安全）。\n\n- [Open a Mac app from an unidentified developer](https://support.apple.com/en-sg/guide/mac-help/mh40616/mac)\n\n---\n\n### 我想自己构建它？\n\n#### 预安装\n\n- [Rust (必须)](https://www.rust-lang.org/)\n- [Node.js (必须)](https://nodejs.org/)\n- [VS Code (可选)](https://code.visualstudio.com/)\n  - [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)\n  - [tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode)\n\n#### 开始\n\n```bash\n# step1: 克隆仓库\ngit clone https://github.com/lencx/ChatGPT.git\n\n# step2: 进入目录\ncd ChatGPT\n\n# step3: 安装依赖\nyarn\n\n# step4: 开发启动\nyarn dev\n\n# step5: 构建应用\n# 构建后的安装包位置: src-tauri/target/release/bundle\nyarn build\n```\n\n- [The distDir configuration is set to \"../dist\" but this path doesn't exist](https://github.com/lencx/ChatGPT/discussions/180)\n- [Error A public key has been found, but no private key. Make sure to set TAURI_PRIVATE_KEY environment variable.](https://github.com/lencx/ChatGPT/discussions/182)\n\n## ❤️ 感谢\n\n- 分享按钮的代码从 [@liady](https://github.com/liady) 的插件获得，并做了一些本地化修改\n- 感谢 [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) 项目为这个应用自定义指令功能所带来的启发\n\n---\n\n[![Star History Chart](https://api.star-history.com/svg?repos=lencx/chatgpt&type=Timeline)](https://star-history.com/#lencx/chatgpt&Timeline)\n\n## 中国用户\n\n国内用户如果遇到使用问题或者想交流 ChatGPT 技巧，可以关注公众号“浮之静”，发送 “chat” 进群参与讨论。公众号会更新[《Tauri 系列》](https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzIzNjE2NTI3NQ==&action=getalbum&album_id=2593843659863752704)文章，技术思考等等，如果对 tauri 开发应用感兴趣可以关注公众号后回复 “tauri” 进技术开发群（想私聊的也可以关注公众号，来添加微信）。开源不易，如果这个项目对你有帮助可以分享给更多人，或者微信扫码打赏。\n\n<img width=\"180\" src=\"https://user-images.githubusercontent.com/16164244/207228300-ea5c4688-c916-4c55-a8c3-7f862888f351.png\"> <img width=\"200\" src=\"https://user-images.githubusercontent.com/16164244/207228025-117b5f77-c5d2-48c2-a070-774b7a1596f2.png\">\n\n<a href=\"https://t.zsxq.com/0bQikmcVw\"><img width=\"360\" src=\"./assets/zsxq.png\"></a>\n\n## License\n\nAGPL-3.0 License\n"
  },
  {
    "path": "ChatGPT/README.md",
    "content": "adapted from [ChatGPT桌面版](https://github.com/lencx/ChatGPT)\n"
  },
  {
    "path": "ChatGPT/UPDATE_LOG.md",
    "content": "# UPDATE LOG\n\n**🛑 URGENT NOTICE: A hacker has been found to take advantage of the heat of `lencx/ChatGPT` to plant a Trojan horse after the fork project and rebuild the installer. If you have friends around you who are using this desktop application, please remind them not to download unknown links freely. Now the project will remove other installation ways and only provide this download link https://github.com/lencx/ChatGPT/releases**\n\n**🛑 紧急通知：目前发现有黑客利用 `lencx/ChatGPT` 的热度，在 fork 项目后植入木马，重新构建安装程序。如果你身边有朋友正在使用此桌面应用，请提醒 TA 们不要随意下载不明链接。现在项目将删除其他安装途径，仅提供此下载链接 https://github.com/lencx/ChatGPT/releases**\n\n---\n\n**It is an unofficial project intended for personal learning and research purposes only. During the time that the ChatGPT desktop application was open-sourced, it received a lot of attention, and I would like to thank everyone for their support. However, as things have developed, there are two issues that seriously affect the project's next development plan:**\n\n- **Some people have used it for repackaging and selling for profit.**\n- **The name and icon of ChatGPT may be involved in infringement issues.**\n\n**New repository: https://github.com/lencx/nofwl**\n\n## v0.12.0\n\nFeat:\n\n- Add refresh button\n- Add text-to-speech (`Control Center -> Settings -> General -> Set Speech Language`) (https://github.com/lencx/ChatGPT/issues/534)\n- Automatically focus input field (https://github.com/lencx/ChatGPT/issues/550)\n\n## v0.11.1\n\nFix:\n\n- Export button blinks (https://github.com/lencx/ChatGPT/issues/541)\n- System tray supports sending with Enter key, for text line breaks please use the shortcut key `Shift + Enter` (https://github.com/lencx/ChatGPT/issues/533)\n\n## v0.11.0\n\nFix:\n\n- User-defined close button behavior (exit or minimize) (`Control Center -> Settings -> Main Window -> Close Exit`). (https://github.com/lencx/ChatGPT/issues/359)\n- Markdown content layout (https://github.com/lencx/ChatGPT/issues/378)\n\nFeat:\n\n- Set the main window and tray window size (https://github.com/lencx/ChatGPT/issues/405)\n- Save window positions and sizes and restore them when the app is reopened (`Control Center -> Settings -> General -> Save Window State`)\n- macOS support for aarch64 installer (https://github.com/lencx/ChatGPT/issues/380)\n\n## v0.10.3\n\n> Note: As of now the ChatGPT desktop app has added a lot of exciting features and it continues to improve, as the app grows it has gone far beyond what ChatGPT was intended for. I want to make it the ultimate goal that any website can be easily wrapped to the desktop through user customization. So it needed an international user guide to guide users to use it more professionally. And https://app.nofwl.com is the manual for the app, which will be built into the app (`Menu -> Window -> ChatGPT User's Guide`) so you can access it anytime. It's just starting at the moment, so stay tuned.\n\nFix:\n\n- Incompatible configuration data causes program crashes (https://github.com/lencx/ChatGPT/issues/295)\n\nFeat:\n\n- Silent copy text\n- Markdown export support distinguishes between users and bots (https://github.com/lencx/ChatGPT/issues/233)\n\n## v0.10.2\n\nFix:\n\n- PNG and PDF buttons do not work (https://github.com/lencx/ChatGPT/issues/274)\n- Change the window size and the Send button is obscured by the Export button (https://github.com/lencx/ChatGPT/issues/286)\n- Change forward and backward shortcuts (https://github.com/lencx/ChatGPT/issues/254)\n  - MacOS: `Cmd [`, `Cmd ]`\n  - Windows and Linux: `Ctrl [`, `Ctrl ]`\n\nFeat:\n\n- Copy a single record to the clipboard (https://github.com/lencx/ChatGPT/issues/191)\n\n## v0.10.1\n\nFix:\n\n- Program exception when `Awesome` data is empty (https://github.com/lencx/ChatGPT/issues/248)\n\nFeat:\n\n- New shortcut key to change zoom level (30% - 200%), `+` or `-` 10% each time, `0` will be reset to 100% (https://github.com/lencx/ChatGPT/issues/202)\n  - Windows: `Ctrl +`, `Ctrl -`, `Ctrl 0`\n  - MacOS: `Cmd +`, `Cmd -`, `Cmd 0`\n\n## v0.10.0\n\nFix:\n\n- After exporting a file in Windows, open an empty file explorer (https://github.com/lencx/ChatGPT/issues/242)\n\nFeat:\n\n- Markdown files support editing and live preview\n- Add `Awesome` menu to the `Control Center` (similar to bookmarks, but it's just a start, more possibilities in the future), custom URL support for the home and tray windows (if you're tired of ChatGPT as your home screen).\n\n## v0.9.2\n\nFix: Slash command does not work\n\n## v0.9.1\n\nFix: Slash command does not work\n\n## v0.9.0\n\nFix:\n\n- Export button does not work\n\nFeat:\n\n- Add an export markdown button\n- `Control Center` adds `Notes` and `Download` menus for managing exported chat files (Markdown, PNG, PDF). `Notes` supports markdown previews.\n\n## v0.8.1\n\nFix:\n\n- Export button keeps blinking\n- Export button in the old chat does not work\n- Disable export sharing links because it is a security risk\n\n## v0.8.0\n\nFeat:\n\n- Theme enhancement (Light, Dark, System)\n- Automatic updates support `silent` settings\n- Pop-up search: select the ChatGPT content with the mouse, the `DALL·E 2` button appears, and click to jump (note: because the search content filled by the script cannot trigger the event directly, you need to enter a space in the input box to make the button clickable).\n\nFix:\n\n- Close the main window and hide it in the tray (windows systems)\n\n## v0.7.4\n\nFix:\n\n- Trying to resolve linux errors: `error while loading shared libraries`\n- Customize global shortcuts (`Menu -> Preferences -> Control Center -> General -> Global Shortcut`)\n\n## v0.7.3\n\nChore:\n\n- Optimize slash command style\n- Optimize tray menu icon and button icons\n- Global shortcuts to the chatgpt app (mac: `Command + Shift + O`, windows: `Ctrl + Shift + O`)\n\n## v0.7.2\n\nFix: Some windows systems cannot start the application\n\n## v0.7.1\n\nFix:\n\n- Some windows systems cannot start the application\n- Windows and linux add about menu (show version information)\n- The tray icon is indistinguishable from the background in dark mode on window and linux\n\n## v0.7.0\n\nFix:\n\n- Mac m1 copy/paste does not work on some system versions\n- Optimize the save chat log button to a small icon, the tray window no longer provides a save chat log button (the buttons causes the input area to become larger and the content area to become smaller)\n\nFeat:\n\n- Use the keyboard `⇧` (arrow up) and `⇩` (arrow down) keys to select the slash command\n<!-- - global shortcuts to the chatgpt app (mac: command+shift+o, windows: ctrl+shift+o) -->\n\n## v0.6.10\n\nFix: Sync failure on windows\n\n## v0.6.4\n\nFix: Path not allowed on the configured scope\n\nFeat:\n\n- Optimize the generated pdf file size\n- Menu added `Sync Prompts`\n- `Control Center` added `Sync Custom`\n- The slash command is triggered by the enter key\n- Under the slash command, use the tab key to modify the contents of the `{q}` tag (only single changes are supported (https://github.com/lencx/ChatGPT/issues/54)\n\n## v0.6.0\n\nFix:\n\n- Windows show Chinese when upgrading\n\n## v0.5.1\n\nSome optimization\n\n## v0.5.0\n\nFeat: `Control Center` added `chatgpt-prompts` synchronization\n\n## v0.4.2\n\nAdd chatgpt log (path: `~/.chatgpt/chatgpt.log`)\n\n## v0.4.1\n\nFix:\n\n- Tray window style optimization\n\n## v0.4.0\n\nFeat:\n\n- Customize the ChatGPT prompts command (https://github.com/lencx/ChatGPT#-announcement)\n- Menu enhancement: hide application icons from the Dock (support macOS only)\n\n## v0.3.0\n\nFix: Can't open ChatGPT\n\nFeat: Menu enhancement\n\n- The control center of ChatGPT application\n- Open the configuration file directory\n\n## v0.2.2\n\nFeat:\n\n- Menu: go to config\n\n## v0.2.1\n\nFeat: Menu optimization\n\n## v0.2.0\n\nFeat: Menu enhancement\n\n- Customize user-agent to prevent security detection interception\n- Clear all chatgpt configuration files\n\n## v0.1.8\n\nFeat:\n\n- Menu enhancement: theme, titlebar\n- Modify website address\n\n## v0.1.7\n\nFeat: Tray window\n\n## v0.1.6\n\nFeat:\n\n- Stay on top\n- Export ChatGPT history\n\n## v0.1.5\n\nFix: Mac can't use shortcut keys\n\n## v0.1.4\n\nFeat:\n\n- Beautify icons\n- Add system tray menu\n\n## v0.1.3\n\nFix: Only mac supports `TitleBarStyle`\n\n## v0.1.2\n\nInitialization\n\n## v0.1.1\n\nInitialization\n\n## v0.1.0\n\nInitialization\n"
  },
  {
    "path": "ChatGPT/casks/chatgpt.rb",
    "content": "cask \"chatgpt\" do\n  version \"0.12.0\"\n  arch = Hardware::CPU.arch.to_s\n  sha256s = {\n    \"x86_64\" => \"d7f32d11f86ad8ac073dd451452124324e1c9154c318f15b77b5cd254000a3c4\",\n    \"aarch64\" => \"c4c10eeb4a2c9a885da13047340372f461d411711c20472fc673fbf958bf6378\"\n  }\n  if arch == \"arm64\" then arch = \"aarch64\" end\n  url \"https://github.com/lencx/ChatGPT/releases/download/v#{version}/ChatGPT_#{version}_macos_#{arch}.dmg\"\n  sha256 sha256s[arch]\n\n  name \"ChatGPT\"\n  desc \"Desktop wrapper for OpenAI ChatGPT\"\n  homepage \"https://github.com/lencx/ChatGPT#readme\"\n\n  app \"ChatGPT.app\"\n\n  uninstall quit: \"com.lencx.chatgpt\"\n\n  zap trash: [\n    \"~/.chatgpt\",\n    \"~/Library/Caches/com.lencx.chatgpt\",\n    \"~/Library/HTTPStorages/com.lencx.chatgpt.binarycookies\",\n    \"~/Library/Preferences/com.lencx.chatgpt.plist\",\n    \"~/Library/Saved Application State/com.lencx.chatgpt.savedState\",\n    \"~/Library/WebKit/com.lencx.chatgpt\",\n  ]\nend\n"
  },
  {
    "path": "ChatGPT/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>ChatGPT</title>\n  </head>\n\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.tsx\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "ChatGPT/package.json",
    "content": "{\n  \"name\": \"chatgpt\",\n  \"version\": \"0.0.0\",\n  \"scripts\": {\n    \"dev:fe\": \"vite\",\n    \"build:fe\": \"tsc && vite build\",\n    \"dev\": \"tauri dev\",\n    \"build\": \"tauri build\",\n    \"updater\": \"tr updater\",\n    \"release\": \"tr release --git\",\n    \"fix:conf\": \"tr override --json.tauri_updater_active=false\",\n    \"fix:tray\": \"tr override --json.tauri_systemTray_iconPath=\\\"icons/tray-icon-light.png\\\" --json.tauri_systemTray_iconAsTemplate=false\",\n    \"fix:tray:mac\": \"tr override --json.tauri_systemTray_iconPath=\\\"icons/tray-icon.png\\\" --json.tauri_systemTray_iconAsTemplate=true\",\n    \"download\": \"tr download --mdfile=README.md,README-ZH_CN.md --f1=52 --f2=43\",\n    \"fmt:rs\": \"cargo fmt\",\n    \"tr\": \"tr\",\n    \"tauri\": \"tauri\",\n    \"prettier\": \"prettier -c --write '**/*.{js,md,ts,tsx,yml}'\",\n    \"pretty-quick\": \"pretty-quick --staged\",\n    \"prepare\": \"husky install\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"lencx <cxin1314@gmail.com>\",\n  \"keywords\": [\n    \"chatgpt\",\n    \"app\",\n    \"desktop\",\n    \"tauri\",\n    \"macos\",\n    \"linux\",\n    \"windows\"\n  ],\n  \"homepage\": \"https://github.com/lencx/ChatGPT\",\n  \"bugs\": \"https://github.com/lencx/ChatGPT/issues\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/lencx/ChatGPT\"\n  },\n  \"dependencies\": {\n    \"@ant-design/icons\": \"^4.8.0\",\n    \"@monaco-editor/react\": \"^4.4.6\",\n    \"@tauri-apps/api\": \"^1.2.0\",\n    \"antd\": \"^5.1.0\",\n    \"clsx\": \"^1.2.1\",\n    \"dayjs\": \"^1.11.7\",\n    \"github-markdown-css\": \"^5.1.0\",\n    \"lodash\": \"^4.17.21\",\n    \"monaco-editor\": \"^0.34.1\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-markdown\": \"^8.0.4\",\n    \"react-resizable-panels\": \"^0.0.33\",\n    \"react-router-dom\": \"^6.4.5\",\n    \"react-syntax-highlighter\": \"^15.5.0\",\n    \"rehype-raw\": \"^6.1.1\",\n    \"remark-comment-config\": \"^7.0.1\",\n    \"remark-gfm\": \"^3.0.1\",\n    \"uuid\": \"^9.0.0\"\n  },\n  \"devDependencies\": {\n    \"@tauri-apps/cli\": \"^1.2.2\",\n    \"@tauri-release/cli\": \"^0.2.5\",\n    \"@types/lodash\": \"^4.14.191\",\n    \"@types/node\": \"^18.7.10\",\n    \"@types/react\": \"^18.0.15\",\n    \"@types/react-dom\": \"^18.0.6\",\n    \"@types/react-syntax-highlighter\": \"^15.5.6\",\n    \"@types/uuid\": \"^9.0.0\",\n    \"@vitejs/plugin-react\": \"^3.0.0\",\n    \"husky\": \"^8.0.3\",\n    \"prettier\": \"^2.8.3\",\n    \"pretty-quick\": \"^3.1.3\",\n    \"sass\": \"^1.56.2\",\n    \"typescript\": \"^4.9.4\",\n    \"vite\": \"^4.0.0\",\n    \"vite-plugin-commonjs\": \"^0.6.2\",\n    \"vite-tsconfig-paths\": \"^4.0.2\"\n  },\n  \"engines\": {\n    \"node\": \"^14.18.0 || ^16.0.0 || ^18.0.0\"\n  }\n}\n"
  },
  {
    "path": "ChatGPT/rustfmt.toml",
    "content": "max_width = 100\nhard_tabs = false\ntab_spaces = 2\nnewline_style = \"Auto\"\nuse_small_heuristics = \"Default\"\nreorder_imports = true\nreorder_modules = true\nremove_nested_parens = true\nedition = \"2021\"\nmerge_derives = true\nuse_try_shorthand = false\nuse_field_init_shorthand = false\nforce_explicit_abi = true\n# imports_granularity = \"Crate\""
  },
  {
    "path": "ChatGPT/src/components/FilePath/index.tsx",
    "content": "import { FC, useEffect, useState } from 'react';\nimport clsx from 'clsx';\nimport { path, shell } from '@tauri-apps/api';\n\nimport { chatRoot } from '@/utils';\n\ninterface FilePathProps {\n  paths?: string;\n  label?: string;\n  className?: string;\n  content?: string;\n  url?: string;\n}\n\nconst FilePath: FC<FilePathProps> = ({ className, label = 'PATH', paths = '', url, content }) => {\n  const [filePath, setPath] = useState('');\n\n  useEffect(() => {\n    if (!path && !url) return;\n    (async () => {\n      if (url) {\n        setPath(url);\n        return;\n      }\n      setPath(await path.join(await chatRoot(), ...paths.split('/').filter((i) => !!i)));\n    })();\n  }, [url, paths]);\n\n  return (\n    <div className={clsx(className, 'chat-file-path')}>\n      <div>\n        {label}:{' '}\n        <a onClick={() => shell.open(filePath)} title={filePath}>\n          {content ? content : filePath}\n        </a>\n      </div>\n    </div>\n  );\n};\n\nexport default FilePath;\n"
  },
  {
    "path": "ChatGPT/src/components/Markdown/Editor.tsx",
    "content": "import { FC, useEffect, useState } from 'react';\nimport Editor from '@monaco-editor/react';\nimport { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';\n\nimport Markdown from '@/components/Markdown';\nimport './index.scss';\n\ninterface MarkdownEditorProps {\n  value?: string;\n  onChange?: (v: string) => void;\n  mode?: string;\n}\n\nconst MarkdownEditor: FC<MarkdownEditorProps> = ({ value = '', onChange, mode = 'split' }) => {\n  const [content, setContent] = useState(value);\n\n  useEffect(() => {\n    setContent(value);\n    onChange && onChange(value);\n  }, [value]);\n\n  const handleEdit = (e: any) => {\n    setContent(e);\n    onChange && onChange(e);\n  };\n\n  const isSplit = mode === 'split';\n\n  return (\n    <div className=\"md-main\">\n      <PanelGroup direction=\"horizontal\">\n        {['md', 'split'].includes(mode) && (\n          <Panel>\n            <Editor language=\"markdown\" value={content} onChange={handleEdit} />\n          </Panel>\n        )}\n        {isSplit && <PanelResizeHandle className=\"resize-handle\" />}\n        {['doc', 'split'].includes(mode) && (\n          <Panel>\n            <Markdown className=\"edit-preview\">{content}</Markdown>\n          </Panel>\n        )}\n      </PanelGroup>\n    </div>\n  );\n};\n\nexport default MarkdownEditor;\n"
  },
  {
    "path": "ChatGPT/src/components/Markdown/index.scss",
    "content": ".markdown-body {\n  height: 100%;\n  overflow: auto;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial,\n    sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';\n\n  &.edit-preview {\n    padding: 10px;\n    font-size: 14px;\n  }\n\n  pre,\n  code {\n    font-family: monospace, monospace;\n  }\n}\n\n.md-main {\n  height: calc(100vh - 130px);\n  overflow: hidden;\n}\n\n.resize-handle {\n  width: 0.25rem;\n  transition: 250ms linear background-color;\n  background-color: #7f8082;\n  outline: none;\n\n  &:hover,\n  &[data-resize-handle-active] {\n    background-color: #5194eb;\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/components/Markdown/index.tsx",
    "content": "import { FC } from 'react';\nimport clsx from 'clsx';\nimport ReactMarkdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport rehypeRaw from 'rehype-raw';\nimport SyntaxHighlighter from 'react-syntax-highlighter';\nimport agate from 'react-syntax-highlighter/dist/esm/styles/hljs/agate';\nimport 'github-markdown-css';\n\nimport './index.scss';\n\ninterface MarkdownProps {\n  children: string;\n  className?: string;\n}\n\nconst Markdown: FC<MarkdownProps> = ({ children, className }) => {\n  return (\n    <div className={clsx(className, 'markdown-body')}>\n      <div>\n        <ReactMarkdown\n          children={children}\n          linkTarget=\"_blank\"\n          remarkPlugins={[remarkGfm]}\n          rehypePlugins={[rehypeRaw]}\n          components={{\n            code({ node, inline, className, children, ...props }) {\n              const match = /language-(\\w+)/.exec(className || '');\n              return !inline && match ? (\n                <SyntaxHighlighter\n                  children={String(children).replace(/\\n$/, '')}\n                  style={agate as any}\n                  language={match[1]}\n                  showLineNumbers\n                  lineNumberStyle={{ color: '#999' }}\n                  PreTag=\"div\"\n                  {...props}\n                />\n              ) : (\n                <code className={className} {...props}>\n                  {children}\n                </code>\n              );\n            },\n          }}\n        />\n      </div>\n    </div>\n  );\n};\n\nexport default Markdown;\n"
  },
  {
    "path": "ChatGPT/src/components/SwitchOrigin/index.tsx",
    "content": "import { FC } from 'react';\nimport { Link } from 'react-router-dom';\nimport { Form, Select, Tag, Tooltip, Switch } from 'antd';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\n\nimport useJson from '@/hooks/useJson';\nimport { DISABLE_AUTO_COMPLETE, CHAT_AWESOME_JSON } from '@/utils';\ninterface SwitchOriginProps {\n  name: string;\n}\n\nconst SwitchOrigin: FC<SwitchOriginProps> = ({ name }) => {\n  const { json: list = [] } = useJson<any[]>(CHAT_AWESOME_JSON);\n  const form = Form.useFormInstance();\n\n  const labelName = `(${name === 'main' ? 'Main' : 'SystemTray'})`;\n  const dashboardName = `${name}_dashboard`;\n  const originName = `${name}_origin`;\n  const isEnable = Form.useWatch(dashboardName, form);\n\n  let urlList = [{ title: 'ChatGPT', url: 'https://chat.openai.com', init: true }];\n  if (Array.isArray(list)) {\n    urlList = urlList.concat(list);\n  }\n\n  return (\n    <>\n      <Form.Item\n        label={\n          <span>\n            Dashboard {labelName}{' '}\n            <Tooltip\n              title={\n                <div>\n                  <p>\n                    <b>Set Dashboard as the application default window.</b>\n                  </p>\n                  <p>\n                    If this is enabled, the <Tag color=\"blue\">Switch Origin {labelName}</Tag>{' '}\n                    setting will be invalid.\n                  </p>\n                  <p>\n                    If you want to add a new URL to the dashboard, add it in the{' '}\n                    <Link to=\"/awesome\">Awesome</Link> menu and make sure it is enabled.\n                  </p>\n                </div>\n              }\n            >\n              <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n            </Tooltip>\n          </span>\n        }\n        name={dashboardName}\n        valuePropName=\"checked\"\n      >\n        <Switch />\n      </Form.Item>\n      <Form.Item\n        label={\n          <span>\n            Switch Origin {labelName}{' '}\n            <Tooltip\n              title={\n                <div>\n                  <p>\n                    <b>Set a single URL as the application default window.</b>\n                  </p>\n                  <p>\n                    If you need to set a new URL as the application loading window, please add the\n                    URL in the <Link to=\"/awesome\">Awesome</Link> menu and then select it.\n                  </p>\n                </div>\n              }\n            >\n              <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n            </Tooltip>\n          </span>\n        }\n        name={originName}\n      >\n        <Select disabled={isEnable} showSearch {...DISABLE_AUTO_COMPLETE} optionLabelProp=\"url\">\n          {urlList.map((i, idx) => (\n            <Select.Option\n              key={`${idx}_${i.url}`}\n              label={i.title}\n              value={i.url}\n              title={`${i.title}${i.init ? '(Built-in)' : ''}: ${i.url}`}\n            >\n              <Tag color={i.init ? 'orange' : 'geekblue'}>{i.title}</Tag> {i.url}\n            </Select.Option>\n          ))}\n        </Select>\n      </Form.Item>\n    </>\n  );\n};\n\nexport default SwitchOrigin;\n"
  },
  {
    "path": "ChatGPT/src/components/Tags/index.tsx",
    "content": "import { FC, useEffect, useRef, useState } from 'react';\nimport { PlusOutlined } from '@ant-design/icons';\nimport { Input, Tag } from 'antd';\nimport type { InputRef } from 'antd';\n\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\ninterface TagsProps {\n  value?: string[];\n  onChange?: (v: string[]) => void;\n  addTxt?: string;\n  max?: number;\n}\n\nconst Tags: FC<TagsProps> = ({ max = 99, value = [], onChange, addTxt = 'New Tag' }) => {\n  const [tags, setTags] = useState<string[]>(value);\n  const [inputVisible, setInputVisible] = useState<boolean>(false);\n  const [inputValue, setInputValue] = useState('');\n  const inputRef = useRef<InputRef>(null);\n\n  useEffect(() => {\n    setTags(value);\n  }, [value]);\n\n  useEffect(() => {\n    if (inputVisible) {\n      inputRef.current?.focus();\n    }\n  }, [inputVisible]);\n\n  const handleClose = (removedTag: string) => {\n    const newTags = tags.filter((tag) => tag !== removedTag);\n    setTags(newTags);\n  };\n\n  const showInput = () => {\n    setInputVisible(true);\n  };\n\n  const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n    setInputValue(e.target.value);\n  };\n\n  const handleInputConfirm = () => {\n    if (inputValue && tags.indexOf(inputValue) === -1) {\n      const val = [...tags, inputValue];\n      setTags(val);\n      onChange && onChange(val);\n    }\n    setInputVisible(false);\n    setInputValue('');\n  };\n\n  const forMap = (tag: string) => {\n    const tagElem = (\n      <Tag\n        closable\n        onClose={(e) => {\n          e.preventDefault();\n          handleClose(tag);\n        }}\n      >\n        {tag}\n      </Tag>\n    );\n    return (\n      <span key={tag} style={{ display: 'inline-block' }}>\n        {tagElem}\n      </span>\n    );\n  };\n\n  const tagChild = tags.map(forMap);\n\n  return (\n    <>\n      <span style={{ marginBottom: 16 }}>{tagChild}</span>\n      {inputVisible && (\n        <Input\n          ref={inputRef}\n          type=\"text\"\n          size=\"small\"\n          style={{ width: 78 }}\n          value={inputValue}\n          onChange={handleInputChange}\n          onBlur={handleInputConfirm}\n          onPressEnter={handleInputConfirm}\n          {...DISABLE_AUTO_COMPLETE}\n        />\n      )}\n      {!inputVisible && tags.length < max && (\n        <Tag onClick={showInput} className=\"chat-tag-new\">\n          <PlusOutlined /> {addTxt}\n        </Tag>\n      )}\n    </>\n  );\n};\n\nexport default Tags;\n"
  },
  {
    "path": "ChatGPT/src/hooks/useChatModel.ts",
    "content": "import { useState, useEffect } from 'react';\nimport { clone } from 'lodash';\nimport { invoke } from '@tauri-apps/api';\n\nimport { CHAT_MODEL_JSON, CHAT_MODEL_CMD_JSON, readJSON, writeJSON } from '@/utils';\nimport useInit from '@/hooks/useInit';\n\nexport default function useChatModel(key: string, file = CHAT_MODEL_JSON) {\n  const [modelJson, setModelJson] = useState<Record<string, any>>({});\n\n  useInit(async () => {\n    const data = await readJSON(file, {\n      defaultVal: { name: 'ChatGPT Model', [key]: null },\n    });\n    setModelJson(data);\n  });\n\n  const modelSet = async (data: Record<string, any>[] | Record<string, any>) => {\n    const oData = clone(modelJson);\n    oData[key] = data;\n    await writeJSON(file, oData);\n    setModelJson(oData);\n  };\n\n  return { modelJson, modelSet, modelData: modelJson?.[key] || [] };\n}\n\nexport function useCacheModel(file = '') {\n  const [modelCacheJson, setModelCacheJson] = useState<Record<string, any>[]>([]);\n\n  useEffect(() => {\n    if (!file) return;\n    (async () => {\n      const data = await readJSON(file, { isRoot: true, isList: true });\n      setModelCacheJson(data);\n    })();\n  }, [file]);\n\n  const modelCacheSet = async (data: Record<string, any>[], newFile = '') => {\n    await writeJSON(newFile ? newFile : file, data, { isRoot: true });\n    setModelCacheJson(data);\n    await modelCacheCmd();\n  };\n\n  const modelCacheCmd = async () => {\n    // Generate the `chat.model.cmd.json` file and refresh the page for the slash command to take effect.\n    const list = await invoke('cmd_list');\n    await writeJSON(CHAT_MODEL_CMD_JSON, {\n      name: 'ChatGPT CMD',\n      last_updated: Date.now(),\n      data: list,\n    });\n    await invoke('window_reload', { label: 'core' });\n    await invoke('window_reload', { label: 'tray' });\n  };\n\n  return { modelCacheJson, modelCacheSet, modelCacheCmd };\n}\n"
  },
  {
    "path": "ChatGPT/src/hooks/useColumns.tsx",
    "content": "import { FC, useState, useCallback } from 'react';\nimport { Input } from 'antd';\n\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\nexport default function useColumns(columns: any[] = []) {\n  const [opType, setOpType] = useState('');\n  const [opRecord, setRecord] = useState<Record<string | symbol, any> | null>(null);\n  const [opTime, setNow] = useState<number | null>(null);\n  const [opExtra, setExtra] = useState<any>(null);\n\n  const handleRecord = useCallback((row: Record<string, any> | null, type: string) => {\n    setOpType(type);\n    setRecord(row);\n    setNow(Date.now());\n  }, []);\n\n  const resetRecord = useCallback(() => {\n    setRecord(null);\n    setOpType('');\n    setNow(Date.now());\n  }, []);\n\n  const opNew = useCallback(() => handleRecord(null, 'new'), [handleRecord]);\n\n  const cols = columns.map((i: any) => {\n    if (i.render) {\n      const opRender = i.render;\n      i.render = (text: string, row: Record<string, any>) => {\n        return opRender(text, row, { setRecord: handleRecord, setExtra });\n      };\n    }\n    return i;\n  });\n\n  return {\n    opTime,\n    opType,\n    opNew,\n    columns: cols,\n    opRecord,\n    setRecord: handleRecord,\n    resetRecord,\n    setExtra,\n    opExtra,\n  };\n}\n\ninterface EditRowProps {\n  rowKey: string;\n  row: Record<string, any>;\n  actions: any;\n}\nexport const EditRow: FC<EditRowProps> = ({ rowKey, row, actions }) => {\n  const [isEdit, setEdit] = useState(false);\n  const [val, setVal] = useState(row[rowKey] || '');\n  const handleEdit = () => {\n    setEdit(true);\n  };\n  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n    setVal(e.target.value);\n  };\n\n  const handleSave = () => {\n    setEdit(false);\n    row[rowKey] = val?.trim();\n    actions?.setRecord(row, 'rowedit');\n  };\n\n  return isEdit ? (\n    <Input\n      value={val}\n      autoFocus\n      onChange={handleChange}\n      {...DISABLE_AUTO_COMPLETE}\n      onPressEnter={handleSave}\n    />\n  ) : (\n    <div className=\"rowedit\" onClick={handleEdit}>\n      {val}\n    </div>\n  );\n};\n"
  },
  {
    "path": "ChatGPT/src/hooks/useData.ts",
    "content": "import { useState, useEffect } from 'react';\nimport { v4 } from 'uuid';\n\nexport const safeKey = Symbol('chat-id');\n\nexport default function useData(oData: any[]) {\n  const [opData, setData] = useState<any[]>([]);\n\n  useEffect(() => {\n    opInit(oData);\n  }, []);\n\n  const opAdd = (val: any) => {\n    const v = [val, ...opData];\n    setData(v);\n    return v;\n  };\n\n  const opInit = (val: any[] = []) => {\n    if (!val || !Array.isArray(val)) return;\n    const nData = val.map((i) => ({ [safeKey]: v4(), ...i }));\n    setData(nData);\n  };\n\n  const opRemove = (id: string) => {\n    const nData = opData.filter((i) => i[safeKey] !== id);\n    setData(nData);\n    return nData;\n  };\n\n  const opRemoveItems = (ids: string[]) => {\n    const nData = opData.filter((i) => !ids.includes(i[safeKey]));\n    setData(nData);\n    return nData;\n  };\n\n  const opReplace = (id: string, data: any) => {\n    const nData = [...opData];\n    const idx = opData.findIndex((v) => v[safeKey] === id);\n    nData[idx] = data;\n    setData(nData);\n    return nData;\n  };\n\n  const opReplaceItems = (ids: string[], data: any) => {\n    const nData = [...opData];\n    let count = 0;\n    for (let i = 0; i < nData.length; i++) {\n      const v = nData[i];\n      if (ids.includes(v[safeKey])) {\n        count++;\n        nData[i] = { ...v, ...data };\n      }\n      if (count === ids.length) break;\n    }\n    setData(nData);\n    return nData;\n  };\n\n  return {\n    opSafeKey: safeKey,\n    opInit,\n    opReplace,\n    opAdd,\n    opRemove,\n    opRemoveItems,\n    opData,\n    opReplaceItems,\n  };\n}\n"
  },
  {
    "path": "ChatGPT/src/hooks/useInit.ts",
    "content": "import { useRef, useEffect } from 'react';\n\n// fix: Two interface requests will be made in development mode\nexport default function useInit(callback: () => void) {\n  const isInit = useRef(true);\n  useEffect(() => {\n    if (isInit.current) {\n      callback();\n      isInit.current = false;\n    }\n  });\n}\n"
  },
  {
    "path": "ChatGPT/src/hooks/useJson.ts",
    "content": "import { useState } from 'react';\n\nimport { readJSON, writeJSON } from '@/utils';\nimport useInit from '@/hooks/useInit';\n\nexport default function useJson<T>(file: string) {\n  const [json, setData] = useState<T>();\n\n  const refreshJson = async () => {\n    const data = await readJSON(file);\n    setData(data);\n    return data;\n  };\n\n  const updateJson = async (data: any) => {\n    await writeJSON(file, data);\n    await refreshJson();\n  };\n\n  useInit(refreshJson);\n\n  return { json, refreshJson, updateJson };\n}\n"
  },
  {
    "path": "ChatGPT/src/hooks/useTable.tsx",
    "content": "import React, { useState } from 'react';\nimport { Table } from 'antd';\nimport type { TableRowSelection } from 'antd/es/table/interface';\n\nimport { safeKey } from '@/hooks/useData';\n\ntype rowSelectionOptions = {\n  key: 'id' | string;\n  rowType: 'id' | 'row' | 'all';\n};\nexport function useTableRowSelection(options?: Partial<rowSelectionOptions>) {\n  const { key = 'id', rowType = 'id' } = options || {};\n  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);\n  const [selectedRowIDs, setSelectedRowIDs] = useState<string[]>([]);\n  const [selectedRows, setSelectedRows] = useState<Record<string | symbol, any>[]>([]);\n\n  const onSelectChange = (\n    newSelectedRowKeys: React.Key[],\n    newSelectedRows: Record<string | symbol, any>[],\n  ) => {\n    const keys = newSelectedRows.map((i: any) => i[safeKey] || i[key]);\n    setSelectedRowKeys(newSelectedRowKeys);\n    if (rowType === 'id') {\n      setSelectedRowIDs(keys);\n    }\n    if (rowType === 'row') {\n      setSelectedRows(newSelectedRows);\n    }\n    if (rowType === 'all') {\n      setSelectedRowIDs(keys);\n      setSelectedRows(newSelectedRows);\n    }\n  };\n\n  const rowReset = () => {\n    setSelectedRowKeys([]);\n    setSelectedRowIDs([]);\n    setSelectedRows([]);\n  };\n\n  const rowSelection: TableRowSelection<Record<string, any>> = {\n    selectedRowKeys,\n    onChange: onSelectChange,\n    selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT, Table.SELECTION_NONE],\n  };\n\n  return { rowSelection, selectedRowIDs, selectedRows, rowReset };\n}\n\nexport const TABLE_PAGINATION = {\n  hideOnSinglePage: true,\n  showSizeChanger: true,\n  showQuickJumper: true,\n  defaultPageSize: 10,\n  pageSizeOptions: [5, 10, 15, 20],\n  showTotal: (total: number) => <span>Total {total} items</span>,\n};\n"
  },
  {
    "path": "ChatGPT/src/icons/SplitIcon.tsx",
    "content": "import Icon from '@ant-design/icons';\nimport type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';\n\ninterface IconProps {\n  onClick: () => void;\n}\n\nexport default function SplitIcon(props: Partial<CustomIconComponentProps & IconProps>) {\n  return (\n    <Icon\n      {...props}\n      component={() => (\n        <svg\n          className=\"chatico\"\n          viewBox=\"0 0 1024 1024\"\n          width=\"1em\"\n          height=\"1em\"\n          fill=\"currentColor\"\n        >\n          <path d=\"M252.068571 906.496h520.283429c89.581714 0 134.144-44.562286 134.144-132.845714V250.331429c0-88.283429-44.562286-132.845714-134.144-132.845715H252.068571c-89.142857 0-134.582857 44.141714-134.582857 132.845715V773.668571c0 88.704 45.44 132.845714 134.582857 132.845715z m1.28-68.992c-42.843429 0-66.852571-22.710857-66.852571-67.291429V253.805714c0-44.580571 24.009143-67.291429 66.852571-67.291428h222.866286v651.008z m517.723429-651.008c42.422857 0 66.432 22.710857 66.432 67.291429V770.194286c0 44.580571-24.009143 67.291429-66.432 67.291428H548.205714V186.496z\" />\n        </svg>\n      )}\n    />\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/layout/index.scss",
    "content": ".chat-logo {\n  text-align: center;\n  height: 48px;\n\n  img {\n    width: 44px;\n    height: 44px;\n    margin-top: 4px;\n  }\n}\n\n.chat-info {\n  text-align: center;\n  font-weight: bold;\n\n  .ant-tag {\n    margin: 2px;\n  }\n}\n\n.ant-layout-sider-trigger {\n  user-select: none;\n  -webkit-user-select: none;\n}\n\n.ant-layout-sider-children {\n  overflow-y: auto;\n}\n\n.chat-container {\n  padding: 20px;\n  overflow: hidden;\n}\n\n.ant-menu {\n  user-select: none;\n  -webkit-user-select: none;\n}\n\n.ant-layout-footer {\n  color: #666 !important;\n  opacity: 0.7;\n}\n"
  },
  {
    "path": "ChatGPT/src/layout/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { Layout, Menu, Tooltip, ConfigProvider, theme, Tag } from 'antd';\nimport { SyncOutlined } from '@ant-design/icons';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport { getName, getVersion } from '@tauri-apps/api/app';\nimport { invoke } from '@tauri-apps/api';\n\nimport useInit from '@/hooks/useInit';\nimport Routes, { menuItems } from '@/routes';\nimport './index.scss';\n\nconst { Content, Footer, Sider } = Layout;\n\nexport default function ChatLayout() {\n  const [collapsed, setCollapsed] = useState(false);\n  const [isDashboard, setDashboard] = useState<any>(null);\n  const [appInfo, setAppInfo] = useState<Record<string, any>>({});\n  const location = useLocation();\n  const [menuKey, setMenuKey] = useState(location.pathname);\n  const go = useNavigate();\n\n  useEffect(() => {\n    if (location.search === '?type=control') {\n      go('/settings');\n    }\n    if (location.search === '?type=preview') {\n      go('/?type=preview');\n    }\n    setMenuKey(location.pathname);\n    setDashboard(location.pathname === '/');\n  }, [location.pathname]);\n\n  useInit(async () => {\n    setAppInfo({\n      appName: await getName(),\n      appVersion: await getVersion(),\n      appTheme: await invoke('get_theme'),\n    });\n  });\n\n  const checkAppUpdate = async () => {\n    await invoke('run_check_update', { silent: false, hasMsg: true });\n  };\n\n  const isDark = appInfo.appTheme === 'dark';\n\n  if (isDashboard === null) return null;\n\n  return (\n    <ConfigProvider theme={{ algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm }}>\n      {isDashboard ? (\n        <Routes />\n      ) : (\n        <Layout style={{ minHeight: '100vh' }} hasSider>\n          <Sider\n            theme={isDark ? 'dark' : 'light'}\n            collapsible\n            collapsed={collapsed}\n            onCollapse={(value) => setCollapsed(value)}\n            style={{\n              overflow: 'auto',\n              height: '100vh',\n              position: 'fixed',\n              left: 0,\n              top: 0,\n              bottom: 0,\n              zIndex: 999,\n            }}\n          >\n            <div className=\"chat-logo\">\n              <img src=\"/logo.png\" />\n            </div>\n            <div className=\"chat-info\">\n              <Tag>{appInfo.appName}</Tag>\n              <Tag>\n                <span style={{ marginRight: 5 }}>{appInfo.appVersion}</span>\n                <Tooltip title=\"click to check update\">\n                  <a onClick={checkAppUpdate}>\n                    <SyncOutlined />\n                  </a>\n                </Tooltip>\n              </Tag>\n            </div>\n\n            <Menu\n              selectedKeys={[menuKey]}\n              mode=\"inline\"\n              theme={appInfo.appTheme === 'dark' ? 'dark' : 'light'}\n              inlineIndent={12}\n              items={menuItems}\n              // defaultOpenKeys={['/model']}\n              onClick={(i) => go(i.key)}\n            />\n          </Sider>\n          <Layout\n            className=\"chat-layout\"\n            style={{ marginLeft: collapsed ? 80 : 200, transition: 'margin-left 300ms ease-out' }}\n          >\n            <Content\n              className=\"chat-container\"\n              style={{\n                overflow: 'inherit',\n              }}\n            >\n              <Routes />\n            </Content>\n            <Footer style={{ textAlign: 'center' }}>\n              <a href=\"https://github.com/NsLearning/LangHelper\" target=\"_blank\">\n                ChatGPT Desktop Application & LangHelper\n              </a>{' '}\n              ©2023 Created by lencx and Nslearning\n            </Footer>\n          </Layout>\n        </Layout>\n      )}\n    </ConfigProvider>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/main.scss",
    "content": ":root {\n  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;\n  font-size: 16px;\n  line-height: 24px;\n  font-weight: 400;\n\n  color: #2a2a2a;\n  background-color: #f6f6f6;\n\n  font-synthesis: none;\n  text-rendering: optimizeLegibility;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  -webkit-text-size-adjust: 100%;\n}\n\nhtml,\nbody,\n#root {\n  padding: 0;\n  margin: 0;\n  height: 100%;\n}\n\n.ant-table-selection-col,\n.ant-table-selection-column {\n  width: 50px !important;\n  min-width: 50px !important;\n}\n\n.chat-prompts-val {\n  display: inline-block;\n  width: 100%;\n  max-width: 300px;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n}\n\n.ellipsis-line {\n  display: inline-block;\n  width: 180px;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.rowedit {\n  padding: 2px 5px;\n\n  &:hover {\n    box-shadow: 0 0 2px rgba(237, 122, 60, 0.8);\n    border-radius: 4px;\n  }\n}\n\n.chat-add-btn {\n  margin-bottom: 5px;\n}\n\n.chat-tags,\n.chat-prompts-tags {\n  .ant-tag {\n    margin: 2px;\n  }\n}\n\n.chat-table-tip {\n  > span {\n    line-height: 16px;\n  }\n}\n\n.chat-file-path {\n  font-size: 12px;\n  font-weight: 500;\n  color: #888;\n  margin-bottom: 3px;\n  line-height: 16px;\n\n  > div {\n    max-width: 400px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  span {\n    display: inline-block;\n    // background-color: #d8d8d8;\n    color: #4096ff;\n    padding: 0 8px;\n    height: 20px;\n    line-height: 20px;\n    border-radius: 4px;\n    cursor: pointer;\n    text-decoration: underline;\n  }\n}\n\n.chatico {\n  cursor: pointer;\n}\n\n.awesome-tips {\n  .ant-tag {\n    cursor: pointer;\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/main.tsx",
    "content": "import { StrictMode, Suspense } from 'react';\nimport { BrowserRouter } from 'react-router-dom';\nimport ReactDOM from 'react-dom/client';\n\nimport Layout from '@/layout';\nimport './main.scss';\n\nReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(\n  <StrictMode>\n    <Suspense fallback={null}>\n      <BrowserRouter>\n        <Layout />\n      </BrowserRouter>\n    </Suspense>\n  </StrictMode>,\n);\n"
  },
  {
    "path": "ChatGPT/src/routes.tsx",
    "content": "import { useRoutes } from 'react-router-dom';\nimport {\n  SettingOutlined,\n  BulbOutlined,\n  SyncOutlined,\n  FileSyncOutlined,\n  UserOutlined,\n  DownloadOutlined,\n  FormOutlined,\n  GlobalOutlined,\n  InfoCircleOutlined,\n} from '@ant-design/icons';\nimport type { MenuProps } from 'antd';\n\nimport Settings from '@/view/settings';\nimport About from '@/view/about';\nimport Awesome from '@/view/awesome';\nimport UserCustom from '@/view/model/UserCustom';\nimport SyncPrompts from '@/view/model/SyncPrompts';\nimport SyncCustom from '@/view/model/SyncCustom';\nimport SyncRecord from '@/view/model/SyncRecord';\nimport Download from '@/view/download';\nimport Notes from '@/view/notes';\nimport Markdown from '@/view/markdown';\nimport Dashboard from '@/view/dashboard';\n\nexport type ChatRouteMetaObject = {\n  label: string;\n  icon?: React.ReactNode;\n};\n\ntype ChatRouteObject = {\n  path: string;\n  element?: JSX.Element;\n  hideMenu?: boolean;\n  meta?: ChatRouteMetaObject;\n  children?: ChatRouteObject[];\n};\n\nexport const routes: Array<ChatRouteObject> = [\n  {\n    path: '/settings',\n    element: <Settings />,\n    meta: {\n      label: 'Settings',\n      icon: <SettingOutlined />,\n    },\n  },\n  {\n    path: '/awesome',\n    element: <Awesome />,\n    meta: {\n      label: 'Awesome',\n      icon: <GlobalOutlined />,\n    },\n  },\n  {\n    path: '/notes',\n    element: <Notes />,\n    meta: {\n      label: 'Notes',\n      icon: <FormOutlined />,\n    },\n  },\n  {\n    path: '/md/:id',\n    element: <Markdown />,\n    hideMenu: true,\n  },\n  {\n    path: '/model',\n    meta: {\n      label: 'Language Model',\n      icon: <BulbOutlined />,\n    },\n    children: [\n      {\n        path: 'user-custom',\n        element: <UserCustom />,\n        meta: {\n          label: 'User Custom',\n          icon: <UserOutlined />,\n        },\n      },\n      // --- Sync\n      {\n        path: 'sync-prompts',\n        element: <SyncPrompts />,\n        meta: {\n          label: 'Sync Prompts',\n          icon: <SyncOutlined />,\n        },\n      },\n      {\n        path: 'sync-custom',\n        element: <SyncCustom />,\n        meta: {\n          label: 'Sync Custom',\n          icon: <FileSyncOutlined />,\n        },\n      },\n      {\n        path: 'sync-custom/:id',\n        element: <SyncRecord />,\n        hideMenu: true,\n      },\n    ],\n  },\n  {\n    path: '/download',\n    element: <Download />,\n    meta: {\n      label: 'Download',\n      icon: <DownloadOutlined />,\n    },\n  },\n  {\n    path: '/about',\n    element: <About />,\n    meta: {\n      label: 'About',\n      icon: <InfoCircleOutlined />,\n    },\n  },\n  {\n    path: '/',\n    element: <Dashboard />,\n    hideMenu: true,\n  },\n];\n\ntype MenuItem = Required<MenuProps>['items'][number];\nexport const menuItems: MenuItem[] = routes\n  .filter((j) => !j.hideMenu)\n  .map((i) => ({\n    ...i.meta,\n    key: i.path || '',\n    children: i?.children\n      ?.filter((j) => !j.hideMenu)\n      ?.map((j) => ({ ...j.meta, key: `${i.path}/${j.path}` || '' })),\n  }));\n\nexport default () => {\n  return useRoutes(routes);\n};\n"
  },
  {
    "path": "ChatGPT/src/utils.ts",
    "content": "import { readTextFile, writeTextFile, exists, createDir } from '@tauri-apps/api/fs';\nimport { homeDir, join, dirname } from '@tauri-apps/api/path';\nimport dayjs from 'dayjs';\n\nexport const APP_CONF_JSON = 'chat.conf.json';\nexport const CHAT_MODEL_JSON = 'chat.model.json';\nexport const CHAT_MODEL_CMD_JSON = 'chat.model.cmd.json';\nexport const CHAT_DOWNLOAD_JSON = 'chat.download.json';\nexport const CHAT_AWESOME_JSON = 'chat.awesome.json';\nexport const CHAT_NOTES_JSON = 'chat.notes.json';\nexport const CHAT_PROMPTS_CSV = 'chat.prompts.csv';\nexport const GITHUB_PROMPTS_CSV_URL =\n  'https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv';\nexport const GITHUB_LOG_URL = 'https://raw.githubusercontent.com/lencx/ChatGPT/main/UPDATE_LOG.md';\n\nexport const DISABLE_AUTO_COMPLETE = {\n  autoCapitalize: 'off',\n  autoComplete: 'off',\n  spellCheck: false,\n};\n\nexport const chatRoot = async () => {\n  return join(await homeDir(), '.chatgpt');\n};\n\nexport const chatModelPath = async (): Promise<string> => {\n  return join(await chatRoot(), CHAT_MODEL_JSON);\n};\n\nexport const chatPromptsPath = async (): Promise<string> => {\n  return join(await chatRoot(), CHAT_PROMPTS_CSV);\n};\n\ntype readJSONOpts = { defaultVal?: Record<string, any>; isRoot?: boolean; isList?: boolean };\nexport const readJSON = async (path: string, opts: readJSONOpts = {}) => {\n  const { defaultVal = {}, isRoot = false, isList = false } = opts;\n  const root = await chatRoot();\n  let file = path;\n\n  if (!isRoot) {\n    file = await join(root, path);\n  }\n\n  if (!(await exists(file))) {\n    if ((await dirname(file)) !== root) {\n      await createDir(await dirname(file), { recursive: true });\n    }\n    await writeTextFile(\n      file,\n      isList\n        ? '[]'\n        : JSON.stringify(\n            {\n              name: 'ChatGPT',\n              link: 'https://github.com/lencx/ChatGPT',\n              ...defaultVal,\n            },\n            null,\n            2,\n          ),\n    );\n  }\n\n  try {\n    return JSON.parse(await readTextFile(file));\n  } catch (e) {\n    return {};\n  }\n};\n\ntype writeJSONOpts = { dir?: string; isRoot?: boolean };\nexport const writeJSON = async (\n  path: string,\n  data: Record<string, any>,\n  opts: writeJSONOpts = {},\n) => {\n  const { isRoot = false } = opts;\n  const root = await chatRoot();\n  let file = path;\n\n  if (!isRoot) {\n    file = await join(root, path);\n  }\n\n  if (isRoot && !(await exists(await dirname(file)))) {\n    await createDir(await dirname(file), { recursive: true });\n  }\n\n  await writeTextFile(file, JSON.stringify(data, null, 2));\n};\n\nexport const fmtDate = (date: any) => dayjs(date).format('YYYY-MM-DD HH:mm:ss');\n\nexport const genCmd = (act: string) =>\n  act\n    .replace(/\\s+|\\/+/g, '_')\n    .replace(/[^\\d\\w]/g, '')\n    .toLocaleLowerCase();\n"
  },
  {
    "path": "ChatGPT/src/view/about/index.scss",
    "content": ".about {\n  .log-tab {\n    font-size: 14px;\n\n    h2 {\n      font-size: 16px;\n    }\n  }\n\n  .markdown-body {\n    background-color: unset;\n  }\n\n  .about-tab {\n    .imgs {\n      img {\n        max-width: 200px;\n        margin-bottom: 20px;\n      }\n    }\n  }\n\n  code {\n    background-color: rgba(200, 200, 200, 0.4);\n    padding: 2px 4px;\n    border-radius: 5px;\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/view/about/index.tsx",
    "content": "import { useState } from 'react';\nimport { invoke } from '@tauri-apps/api';\nimport { Tabs, Tag } from 'antd';\n\nimport { GITHUB_LOG_URL } from '@/utils';\nimport useInit from '@/hooks/useInit';\nimport Markdown from '@/components/Markdown';\nimport './index.scss';\n\nexport default function About() {\n  const [logContent, setLogContent] = useState('');\n\n  useInit(async () => {\n    const data = (await invoke('get_data', { url: GITHUB_LOG_URL })) || '';\n    setLogContent(data as string);\n  });\n\n  return (\n    <div className=\"about\">\n      <Tabs\n        items={[\n          { label: 'About LangHelper', key: 'langhelper', children: <AboutLangHelper /> },\n          { label: 'About ChatGPT', key: 'about', children: <AboutChatGPT /> },\n          { label: 'Update Log', key: 'log', children: <LogTab content={logContent} /> },\n        ]}\n      />\n    </div>\n  );\n}\n\nconst AboutLangHelper = () =>{\n  return (\n    <div className=\"about-tab\">\n      <p>\n        This is new function for learning languages, you can talk with ChatGPT with natural\n        AI sound, get pronuciation assessment, memorize words with context, practice listening,\n        so on, its based on ChatGPT Desktop@lencx, I've been developing this language helper on \n        the shoulders of gaints, if it helps you, do not hesitate to star it, any problems\n        you can follow my channel\n        <a href=\"https://space.bilibili.com/33672855\" target=\"_blank\"> https://space.bilibili.com/33672855 </a>\n        to get solutions and update,\n        and if you have new ideas for it, please contact my email\n        <a> nslearning888@gmail.com</a>\n           \n      </p>\n    </div>\n  )\n}\n\nconst AboutChatGPT = () => {\n  return (\n    <div className=\"about-tab\">\n      <Tag>ChatGPT Desktop Application (Mac, Windows and Linux)</Tag>\n      <p>\n        🕒 History versions:{' '}\n        <a href=\"https://github.com/lencx/ChatGPT/releases\" target=\"_blank\">\n          lencx/ChatGPT/releases\n        </a>\n      </p>\n      <p>\n        It is just a wrapper for the\n        <a href=\"https://chat.openai.com\" target=\"_blank\" title=\"https://chat.openai.com\">\n          {' '}\n          OpenAI ChatGPT{' '}\n        </a>\n        website, no other data transfer exists (you can check the{' '}\n        <a\n          href=\"https://github.com/lencx/ChatGPT\"\n          target=\"_blank\"\n          title=\"https://github.com/lencx/ChatGPT\"\n        >\n          {' '}\n          source code{' '}\n        </a>\n        ). The development and maintenance of this software has taken up a lot of my time. If it\n        helps you, you can buy me a cup of coffee (Chinese users can use WeChat to scan the code),\n        thanks!\n      </p>\n      <p className=\"imgs\" style={{ float: 'left' }}>\n        <a href=\"https://www.buymeacoffee.com/lencx\" target=\"_blank\">\n          <img\n            src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\"\n            alt=\"Buy Me A Coffee\"\n          />\n        </a>{' '}\n        <br />\n        <img\n          width=\"200\"\n          src=\"https://user-images.githubusercontent.com/16164244/207228025-117b5f77-c5d2-48c2-a070-774b7a1596f2.png\"\n        />\n      </p>\n      <img\n        width=\"250\"\n        src=\"https://user-images.githubusercontent.com/16164244/219439614-d5c3710c-e0b3-4df9-9b3c-c150ba0ba5f1.png\"\n      />\n    </div>\n  );\n};\n\nconst LogTab = ({ content }: { content: string }) => {\n  return (\n    <div>\n      <p>\n        Ref:{' '}\n        <a href=\"https://github.com/lencx/ChatGPT/blob/main/UPDATE_LOG.md\" target=\"_blank\">\n          lencx/ChatGPT/UPDATE_LOG.md\n        </a>\n      </p>\n      <Markdown className=\"log-tab\" children={content} />\n    </div>\n  );\n};\n"
  },
  {
    "path": "ChatGPT/src/view/awesome/Form.tsx",
    "content": "import { useEffect, ForwardRefRenderFunction, useImperativeHandle, forwardRef } from 'react';\nimport { Form, Input, Switch } from 'antd';\nimport type { FormProps } from 'antd';\n\nimport Tags from '@comps/Tags';\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\ninterface AwesomeFormProps {\n  record?: Record<string | symbol, any> | null;\n}\n\nconst initFormValue = {\n  title: '',\n  url: '',\n  enable: true,\n  tags: [],\n  category: '',\n};\n\nconst AwesomeForm: ForwardRefRenderFunction<FormProps, AwesomeFormProps> = ({ record }, ref) => {\n  const [form] = Form.useForm();\n  useImperativeHandle(ref, () => ({ form }));\n\n  useEffect(() => {\n    if (record) {\n      form.setFieldsValue(record);\n    }\n  }, [record]);\n\n  return (\n    <Form form={form} labelCol={{ span: 4 }} initialValues={initFormValue}>\n      <Form.Item\n        label=\"Title\"\n        name=\"title\"\n        rules={[{ required: true, message: 'Please enter a title!' }]}\n      >\n        <Input placeholder=\"Please enter a title\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item\n        label=\"URL\"\n        name=\"url\"\n        rules={[{ required: true, message: 'Please enter the URL' }, { type: 'url' }]}\n      >\n        <Input placeholder=\"Please enter the URL\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item\n        label=\"Category\"\n        name=\"category\"\n        rules={[{ required: true, message: 'Please enter a category' }]}\n      >\n        <Input placeholder=\"Please enter a category\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item label=\"Tags\" name=\"tags\">\n        <Tags value={record?.tags} />\n      </Form.Item>\n      <Form.Item label=\"Enable\" name=\"enable\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n    </Form>\n  );\n};\n\nexport default forwardRef(AwesomeForm);\n"
  },
  {
    "path": "ChatGPT/src/view/awesome/config.tsx",
    "content": "import { Tag, Space, Popconfirm, Switch } from 'antd';\nimport { open } from '@tauri-apps/api/shell';\n\nexport const awesomeColumns = () => [\n  {\n    title: 'Title',\n    dataIndex: 'title',\n    fixed: 'left',\n    key: 'title',\n    width: 160,\n  },\n  {\n    title: 'URL',\n    dataIndex: 'url',\n    key: 'url',\n    width: 200,\n    render: (v: string) => <a onClick={() => open(v)}>{v}</a>,\n  },\n  // {\n  //   title: 'Icon',\n  //   dataIndex: 'icon',\n  //   key: 'icon',\n  //   width: 120,\n  // },\n  {\n    title: 'Enable',\n    dataIndex: 'enable',\n    key: 'enable',\n    width: 80,\n    render: (v: boolean = true, row: Record<string, any>, action: Record<string, any>) => (\n      <Switch checked={v} onChange={(v) => action.setRecord({ ...row, enable: v }, 'enable')} />\n    ),\n  },\n  {\n    title: 'Category',\n    dataIndex: 'category',\n    key: 'category',\n    width: 120,\n    render: (v: string) => <Tag color=\"geekblue\">{v}</Tag>,\n  },\n  {\n    title: 'Tags',\n    dataIndex: 'tags',\n    key: 'tags',\n    width: 150,\n    render: (v: string[]) => (\n      <span className=\"chat-tags\">\n        {v?.map((i) => (\n          <Tag key={i}>{i}</Tag>\n        ))}\n      </span>\n    ),\n  },\n  {\n    title: 'Action',\n    fixed: 'right',\n    width: 150,\n    render: (_: any, row: any, actions: any) => {\n      return (\n        <Space>\n          <a onClick={() => actions.setRecord(row, 'edit')}>Edit</a>\n          <Popconfirm\n            title=\"Are you sure you want to delete this URL?\"\n            onConfirm={() => actions.setRecord(row, 'delete')}\n            okText=\"Yes\"\n            cancelText=\"No\"\n          >\n            <a>Delete</a>\n          </Popconfirm>\n        </Space>\n      );\n    },\n  },\n];\n"
  },
  {
    "path": "ChatGPT/src/view/awesome/index.tsx",
    "content": "import { useRef, useEffect, useState } from 'react';\nimport { Link, useNavigate } from 'react-router-dom';\nimport { Table, Modal, Popconfirm, Button, Tooltip, Tag, message } from 'antd';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\nimport { invoke } from '@tauri-apps/api';\n\nimport useJson from '@/hooks/useJson';\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport FilePath from '@/components/FilePath';\nimport { CHAT_AWESOME_JSON } from '@/utils';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { awesomeColumns } from './config';\nimport AwesomeForm from './Form';\n\nexport default function Awesome() {\n  const formRef = useRef<any>(null);\n  const [isVisible, setVisible] = useState(false);\n  const { opData, opInit, opAdd, opReplace, opReplaceItems, opRemove, opRemoveItems, opSafeKey } =\n    useData([]);\n  const { columns, ...opInfo } = useColumns(awesomeColumns());\n  const { rowSelection, selectedRowIDs, rowReset } = useTableRowSelection();\n  const { json, updateJson } = useJson<any[]>(CHAT_AWESOME_JSON);\n  const selectedItems = rowSelection.selectedRowKeys || [];\n\n  useEffect(() => {\n    if (!json || json.length <= 0) return;\n    opInit(json);\n  }, [json?.length]);\n\n  useEffect(() => {\n    if (!opInfo.opType) return;\n    if (['edit', 'new'].includes(opInfo.opType)) {\n      setVisible(true);\n    }\n    if (['delete'].includes(opInfo.opType)) {\n      const data = opRemove(opInfo?.opRecord?.[opSafeKey]);\n      updateJson(data);\n      opInfo.resetRecord();\n    }\n  }, [opInfo.opType, formRef]);\n\n  const hide = () => {\n    setVisible(false);\n    opInfo.resetRecord();\n  };\n\n  useEffect(() => {\n    if (opInfo.opType === 'enable') {\n      const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n      updateJson(data);\n    }\n  }, [opInfo.opTime]);\n\n  const handleDelete = () => {\n    const data = opRemoveItems(selectedRowIDs);\n    updateJson(data);\n    rowReset();\n    message.success('All selected URLs have been deleted');\n  };\n\n  const handleOk = () => {\n    formRef.current?.form?.validateFields().then(async (vals: Record<string, any>) => {\n      let idx = opData.findIndex((i) => i.url === vals.url);\n      if (vals.url === opInfo?.opRecord?.url) {\n        idx = -1;\n      }\n      if (idx === -1) {\n        if (opInfo.opType === 'new') {\n          const data = opAdd(vals);\n          await updateJson(data);\n          opInit(data);\n          message.success('Data added successfully');\n        }\n        if (opInfo.opType === 'edit') {\n          const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);\n          await updateJson(data);\n          message.success('Data updated successfully');\n        }\n        hide();\n      } else {\n        const data = opData[idx];\n        message.error(\n          <div style={{ width: 360 }}>\n            <div>\n              <b>\n                {data.title}: {data.url}\n              </b>\n            </div>\n            <div>This URL already exists, please edit it and try again.</div>\n          </div>,\n        );\n      }\n    });\n  };\n\n  const handleEnable = (isEnable: boolean) => {\n    const data = opReplaceItems(selectedRowIDs, { enable: isEnable });\n    updateJson(data);\n  };\n\n  const handlePreview = () => {\n    invoke('wa_window', {\n      label: 'awesome_preview',\n      url: 'index.html?type=preview',\n      title: 'Preview Dashboard',\n    });\n  };\n\n  const modalTitle = `${{ new: 'Create', edit: 'Edit' }[opInfo.opType]} URL`;\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <div>\n          <Button className=\"chat-add-btn\" type=\"primary\" onClick={opInfo.opNew}>\n            Add URL\n          </Button>\n          <Button type=\"dashed\" onClick={handlePreview}>\n            Preview Dashboard\n          </Button>\n          <PreviewTip />\n        </div>\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Button type=\"primary\" onClick={() => handleEnable(true)}>\n                Enable\n              </Button>\n              <Button onClick={() => handleEnable(false)}>Disable</Button>\n              <Popconfirm\n                overlayStyle={{ width: 250 }}\n                title=\"URLs cannot be recovered after deletion, are you sure you want to delete them?\"\n                placement=\"topLeft\"\n                onConfirm={handleDelete}\n                okText=\"Yes\"\n                cancelText=\"No\"\n              >\n                <Button>Delete</Button>\n              </Popconfirm>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <FilePath paths={CHAT_AWESOME_JSON} />\n      <Table\n        rowKey=\"url\"\n        columns={columns}\n        scroll={{ x: 800 }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n      />\n      <Modal\n        open={isVisible}\n        title={modalTitle}\n        onCancel={hide}\n        onOk={handleOk}\n        destroyOnClose\n        maskClosable={false}\n      >\n        <AwesomeForm ref={formRef} record={opInfo?.opRecord} />\n      </Modal>\n    </div>\n  );\n}\n\nconst PreviewTip = () => {\n  const go = useNavigate();\n  const handleGo = (v: string) => {\n    go(`/settings?type=${v}`);\n  };\n\n  return (\n    <Tooltip\n      overlayInnerStyle={{ width: 400 }}\n      title={\n        <div className=\"awesome-tips\">\n          Click the button to preview, and in\n          <Link to=\"/settings\"> Settings </Link>\n          you can set a single URL or Dashboard as the default window for the app.\n          <br />\n          <Tag onClick={() => handleGo('main_window')} color=\"blue\">\n            Main Window\n          </Tag>\n          {'or '}\n          <Tag onClick={() => handleGo('tray_window')} color=\"blue\">\n            SystemTray Window\n          </Tag>\n        </div>\n      }\n    >\n      <QuestionCircleOutlined style={{ marginLeft: 5, color: '#1677ff' }} />\n    </Tooltip>\n  );\n};\n"
  },
  {
    "path": "ChatGPT/src/view/dashboard/index.scss",
    "content": ".dashboard {\n  position: fixed;\n  width: calc(100% - 30px);\n  height: calc(100% - 30px);\n  overflow-y: auto;\n  padding: 15px;\n\n  &-no-data {\n    height: 100%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    text-align: center;\n    flex-direction: column;\n    font-weight: bold;\n\n    .icon {\n      color: #989898;\n      font-size: 24px;\n    }\n\n    .txt {\n      padding: 10px;\n      font-size: 12px;\n      line-height: 16px;\n\n      a {\n        color: #1677ff;\n        cursor: pointer;\n      }\n    }\n  }\n\n  &.dark {\n    background-color: #000;\n  }\n\n  &.has-top-dom {\n    padding-top: 30px;\n  }\n\n  &.preview {\n    padding-top: 15px;\n  }\n\n  .group-item {\n    margin-bottom: 20px;\n\n    .title {\n      font-weight: bold;\n      font-size: 18px;\n      margin-bottom: 10px;\n    }\n\n    .item {\n      .ant-card-body {\n        padding: 10px;\n        text-align: center;\n        font-weight: 500;\n        font-size: 14px;\n      }\n\n      span {\n        display: block;\n        height: 100%;\n        width: 100%;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/view/dashboard/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport clsx from 'clsx';\nimport { useSearchParams } from 'react-router-dom';\nimport { Row, Col, Card } from 'antd';\nimport { InboxOutlined } from '@ant-design/icons';\nimport { os, invoke } from '@tauri-apps/api';\n\nimport useInit from '@/hooks/useInit';\nimport useJson from '@/hooks/useJson';\nimport { CHAT_AWESOME_JSON, APP_CONF_JSON, readJSON } from '@/utils';\nimport './index.scss';\n\nexport default function Dashboard() {\n  const [params] = useSearchParams();\n  const { json } = useJson<Record<string, any>[]>(CHAT_AWESOME_JSON);\n  const [list, setList] = useState<Array<[string, Record<string, any>[]]>>();\n  const [hasClass, setClass] = useState(false);\n  const [theme, setTheme] = useState('');\n\n  useInit(async () => {\n    const getOS = await os.platform();\n    const conf = await readJSON(APP_CONF_JSON);\n    const appTheme = await invoke('get_theme');\n    setTheme(appTheme as string);\n    setClass(!conf?.titlebar && getOS === 'darwin');\n  });\n\n  useEffect(() => {\n    if (!json) return;\n    const categories = new Map();\n\n    if (Array.isArray(json)) {\n      json?.forEach((i) => {\n        if (!i.enable) return;\n        if (!categories.has(i.category)) {\n          categories.set(i.category, []);\n        }\n        categories.get(i?.category).push(i);\n      });\n      setList(Array.from(categories) || []);\n    } else {\n      setList([]);\n    }\n  }, [JSON.stringify(json)]);\n\n  const handleLink = async (item: Record<string, any>) => {\n    await invoke('wa_window', {\n      label: btoa(item.url).replace(/[^a-zA-Z0-9]/g, ''),\n      title: item.title,\n      url: item.url,\n    });\n  };\n\n  if (!list) return null;\n  if (list?.length === 0) {\n    return (\n      <div className=\"dashboard-no-data\">\n        <div className=\"icon\">\n          <InboxOutlined style={{ fontSize: 80, marginBottom: 5 }} />\n          <br />\n          No data\n        </div>\n        <div className=\"txt\">\n          Go to <a onClick={() => invoke('control_window')}>{'Control Center -> Awesome'}</a> to add\n          data and make sure they are enabled.\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div\n      className={clsx('dashboard', theme, {\n        'has-top-dom': hasClass,\n        preview: params.get('type') === 'preview',\n      })}\n    >\n      <div>\n        {list.map((i) => {\n          return (\n            <div key={i[0]} className=\"group-item\">\n              <Card title={i[0]} size=\"small\">\n                <Row className=\"list\" gutter={[8, 8]}>\n                  {i[1].map((j, idx) => {\n                    return (\n                      <Col\n                        title={`${j?.title}: ${j?.url}`}\n                        key={`${idx}_${j?.url}`}\n                        xl={4}\n                        md={6}\n                        sm={8}\n                        xs={12}\n                      >\n                        <Card className=\"item\" hoverable onClick={() => handleLink(j)}>\n                          <span>{j?.title}</span>\n                        </Card>\n                      </Col>\n                    );\n                  })}\n                </Row>\n              </Card>\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/download/config.tsx",
    "content": "import { useState } from 'react';\nimport { Tag, Space, Popconfirm } from 'antd';\nimport { path, shell } from '@tauri-apps/api';\n\nimport { EditRow } from '@/hooks/useColumns';\n\nimport useInit from '@/hooks/useInit';\nimport { fmtDate, chatRoot } from '@/utils';\n\nconst colorMap: any = {\n  pdf: 'blue',\n  png: 'orange',\n};\n\nexport const downloadColumns = () => [\n  {\n    title: 'Name',\n    dataIndex: 'name',\n    fixed: 'left',\n    key: 'name',\n    width: 240,\n    render: (_: string, row: any, actions: any) => (\n      <EditRow rowKey=\"name\" row={row} actions={actions} />\n    ),\n  },\n  {\n    title: 'Extension',\n    dataIndex: 'ext',\n    key: 'ext',\n    width: 120,\n    render: (v: string) => <Tag color={colorMap[v]}>{v}</Tag>,\n  },\n  {\n    title: 'Path',\n    dataIndex: 'path',\n    key: 'path',\n    width: 200,\n    render: (_: string, row: any) => <RenderPath row={row} />,\n  },\n  {\n    title: 'Created',\n    dataIndex: 'created',\n    key: 'created',\n    width: 150,\n    render: fmtDate,\n  },\n  {\n    title: 'Action',\n    fixed: 'right',\n    width: 150,\n    render: (_: any, row: any, actions: any) => {\n      return (\n        <Space>\n          <a onClick={() => actions.setRecord(row, 'preview')}>Preview</a>\n          <Popconfirm\n            title=\"Are you sure to delete this file?\"\n            onConfirm={() => actions.setRecord(row, 'delete')}\n            okText=\"Yes\"\n            cancelText=\"No\"\n          >\n            <a>Delete</a>\n          </Popconfirm>\n        </Space>\n      );\n    },\n  },\n];\n\nconst RenderPath = ({ row }: any) => {\n  const [filePath, setFilePath] = useState('');\n  useInit(async () => {\n    setFilePath(await getPath(row));\n  });\n  return <a onClick={() => shell.open(filePath)}>{filePath}</a>;\n};\n\nexport const getPath = async (row: any) => {\n  const isImg = ['png'].includes(row?.ext);\n  return (\n    (await path.join(await chatRoot(), 'download', isImg ? 'img' : row.ext, row.id)) + `.${row.ext}`\n  );\n};\n"
  },
  {
    "path": "ChatGPT/src/view/download/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { Table, Modal, Popconfirm, Button, message } from 'antd';\nimport { invoke, path, fs } from '@tauri-apps/api';\n\nimport useJson from '@/hooks/useJson';\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport FilePath from '@/components/FilePath';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { chatRoot, CHAT_DOWNLOAD_JSON } from '@/utils';\nimport { downloadColumns } from './config';\n\nfunction renderFile(buff: Uint8Array, type: string) {\n  const renderType = {\n    pdf: 'application/pdf',\n    png: 'image/png',\n  }[type];\n  return URL.createObjectURL(new Blob([buff], { type: renderType }));\n}\n\nexport default function Download() {\n  const [source, setSource] = useState('');\n  const [isVisible, setVisible] = useState(false);\n  const { opData, opInit, opReplace, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(downloadColumns());\n  const { rowSelection, selectedRows, rowReset } = useTableRowSelection({ rowType: 'row' });\n  const { json, refreshJson, updateJson } = useJson<any[]>(CHAT_DOWNLOAD_JSON);\n  const selectedItems = rowSelection.selectedRowKeys || [];\n\n  useEffect(() => {\n    if (!json || json.length <= 0) return;\n    opInit(json);\n  }, [json?.length]);\n\n  useEffect(() => {\n    if (!opInfo.opType) return;\n    (async () => {\n      const record = opInfo?.opRecord;\n      const isImg = ['png'].includes(record?.ext);\n      const file = await path.join(\n        await chatRoot(),\n        'download',\n        isImg ? 'img' : record?.ext,\n        `${record?.id}.${record?.ext}`,\n      );\n      if (opInfo.opType === 'preview') {\n        const data = await fs.readBinaryFile(file);\n        const sourceData = renderFile(data, record?.ext);\n        setSource(sourceData);\n        setVisible(true);\n        return;\n      }\n      if (opInfo.opType === 'delete') {\n        await fs.removeFile(file);\n        await handleRefresh();\n      }\n      if (opInfo.opType === 'rowedit') {\n        const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n        await updateJson(data);\n        message.success('Name has been changed!');\n      }\n      opInfo.resetRecord();\n    })();\n  }, [opInfo.opType]);\n\n  const handleDelete = async () => {\n    if (opData?.length === selectedRows.length) {\n      const downloadDir = await path.join(await chatRoot(), 'download');\n      await fs.removeDir(downloadDir, { recursive: true });\n      await handleRefresh();\n      message.success('All files have been cleared!');\n      return;\n    }\n\n    const rows = selectedRows.map(async (i) => {\n      const isImg = ['png'].includes(i?.ext);\n      const file = await path.join(\n        await chatRoot(),\n        'download',\n        isImg ? 'img' : i?.ext,\n        `${i?.id}.${i?.ext}`,\n      );\n      await fs.removeFile(file);\n      return file;\n    });\n    Promise.all(rows).then(async () => {\n      await handleRefresh();\n      message.success('All files selected are cleared!');\n    });\n  };\n\n  const handleRefresh = async () => {\n    await invoke('download_list', { pathname: CHAT_DOWNLOAD_JSON, dir: 'download' });\n    rowReset();\n    const data = await refreshJson();\n    opInit(data);\n  };\n\n  const handleCancel = () => {\n    setVisible(false);\n    opInfo.resetRecord();\n  };\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Popconfirm\n                overlayStyle={{ width: 250 }}\n                title=\"Files cannot be recovered after deletion, are you sure you want to delete them?\"\n                placement=\"topLeft\"\n                onConfirm={handleDelete}\n                okText=\"Yes\"\n                cancelText=\"No\"\n              >\n                <Button>Delete</Button>\n              </Popconfirm>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <FilePath paths={CHAT_DOWNLOAD_JSON} />\n      <Table\n        rowKey=\"id\"\n        columns={columns}\n        scroll={{ x: 800 }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n      />\n      <Modal\n        open={isVisible}\n        title={<div>{opInfo?.opRecord?.name || ''}</div>}\n        onCancel={handleCancel}\n        footer={false}\n        destroyOnClose\n      >\n        <img style={{ maxWidth: '100%' }} src={source} />\n      </Modal>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/markdown/index.scss",
    "content": ".md-task {\n  margin-bottom: 5px;\n  display: flex;\n  justify-content: space-between;\n\n  .ant-breadcrumb-link {\n    padding: 3px 5px;\n    transition: all 300ms ease;\n    border-radius: 4px;\n    &:hover {\n      color: rgba(0, 0, 0, 0.88);\n      background-color: rgba(0, 0, 0, 0.06);\n      cursor: pointer;\n    }\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/view/markdown/index.tsx",
    "content": "import { useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { Breadcrumb } from 'antd';\nimport { ArrowLeftOutlined } from '@ant-design/icons';\nimport MarkdownEditor from '@/components/Markdown/Editor';\nimport { fs, shell } from '@tauri-apps/api';\n\nimport useInit from '@/hooks/useInit';\nimport SplitIcon from '@/icons/SplitIcon';\nimport { getPath } from '@/view/notes/config';\nimport './index.scss';\n\nconst modeMap: any = {\n  0: 'split',\n  1: 'md',\n  2: 'doc',\n};\n\nexport default function Markdown() {\n  const [filePath, setFilePath] = useState('');\n  const [source, setSource] = useState('');\n  const [previewMode, setPreviewMode] = useState(0);\n  const location = useLocation();\n  const state = location?.state;\n\n  useInit(async () => {\n    const file = await getPath(state);\n    setFilePath(file);\n    setSource(await fs.readTextFile(file));\n  });\n\n  const handleChange = async (v: string) => {\n    await fs.writeTextFile(filePath, v);\n  };\n\n  const handlePreview = () => {\n    let mode = previewMode + 1;\n    if (mode > 2) mode = 0;\n    setPreviewMode(mode);\n  };\n\n  return (\n    <>\n      <div className=\"md-task\">\n        <Breadcrumb separator=\"\">\n          <Breadcrumb.Item onClick={() => history.go(-1)}>\n            <ArrowLeftOutlined />\n          </Breadcrumb.Item>\n          <Breadcrumb.Item onClick={() => shell.open(filePath)}>{filePath}</Breadcrumb.Item>\n        </Breadcrumb>\n        <div>\n          <SplitIcon onClick={handlePreview} style={{ fontSize: 18, color: 'rgba(0,0,0,0.5)' }} />\n        </div>\n      </div>\n      <MarkdownEditor value={source} onChange={handleChange} mode={modeMap[previewMode]} />\n    </>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncCustom/Form.tsx",
    "content": "import {\n  useEffect,\n  useState,\n  ForwardRefRenderFunction,\n  useImperativeHandle,\n  forwardRef,\n} from 'react';\nimport { Form, Input, Select, Tooltip } from 'antd';\nimport { v4 } from 'uuid';\nimport type { FormProps } from 'antd';\n\nimport { DISABLE_AUTO_COMPLETE, chatRoot } from '@/utils';\nimport useInit from '@/hooks/useInit';\n\ninterface SyncFormProps {\n  record?: Record<string | symbol, any> | null;\n  type: string;\n}\n\nconst initFormValue = {\n  act: '',\n  enable: true,\n  tags: [],\n  prompt: '',\n};\n\nconst SyncForm: ForwardRefRenderFunction<FormProps, SyncFormProps> = ({ record, type }, ref) => {\n  const isDisabled = type === 'edit';\n  const [form] = Form.useForm();\n  useImperativeHandle(ref, () => ({ form }));\n  const [root, setRoot] = useState('');\n\n  useInit(async () => {\n    setRoot(await chatRoot());\n  });\n\n  useEffect(() => {\n    if (record) {\n      form.setFieldsValue(record);\n    }\n  }, [record]);\n\n  const pathOptions = (\n    <Form.Item noStyle name=\"protocol\" initialValue=\"https\">\n      <Select disabled={isDisabled}>\n        <Select.Option value=\"local\">{root}</Select.Option>\n        <Select.Option value=\"http\">http://</Select.Option>\n        <Select.Option value=\"https\">https://</Select.Option>\n      </Select>\n    </Form.Item>\n  );\n  const extOptions = (\n    <Form.Item noStyle name=\"ext\" initialValue=\"json\">\n      <Select disabled={isDisabled}>\n        <Select.Option value=\"csv\">.csv</Select.Option>\n        <Select.Option value=\"json\">.json</Select.Option>\n      </Select>\n    </Form.Item>\n  );\n\n  const jsonTip = (\n    <Tooltip\n      title={\n        <pre>\n          {JSON.stringify(\n            [\n              { cmd: '', act: '', prompt: '' },\n              { cmd: '', act: '', prompt: '' },\n            ],\n            null,\n            2,\n          )}\n        </pre>\n      }\n    >\n      <a>JSON</a>\n    </Tooltip>\n  );\n\n  const csvTip = (\n    <Tooltip\n      title={\n        <pre>{`\"cmd\",\"act\",\"prompt\"\n\"cmd\",\"act\",\"prompt\"\n\"cmd\",\"act\",\"prompt\"\n\"cmd\",\"act\",\"prompt\"`}</pre>\n      }\n    >\n      <a>CSV</a>\n    </Tooltip>\n  );\n\n  return (\n    <>\n      <Form form={form} labelCol={{ span: 4 }} initialValues={initFormValue}>\n        <Form.Item\n          label=\"Name\"\n          name=\"name\"\n          rules={[{ required: true, message: 'Please enter a name!' }]}\n        >\n          <Input placeholder=\"Please enter a name\" {...DISABLE_AUTO_COMPLETE} />\n        </Form.Item>\n        <Form.Item\n          label=\"PATH\"\n          name=\"path\"\n          rules={[{ required: true, message: 'Please enter the path!' }]}\n        >\n          <Input\n            placeholder=\"YOUR_PATH\"\n            addonBefore={pathOptions}\n            addonAfter={extOptions}\n            {...DISABLE_AUTO_COMPLETE}\n          />\n        </Form.Item>\n        <Form.Item style={{ display: 'none' }} name=\"id\" initialValue={v4().replace(/-/g, '')}>\n          <input />\n        </Form.Item>\n      </Form>\n      <div className=\"tip\">\n        <p>\n          The file supports only {csvTip} and {jsonTip} formats.\n        </p>\n      </div>\n    </>\n  );\n};\n\nexport default forwardRef(SyncForm);\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncCustom/config.tsx",
    "content": "import { useState } from 'react';\nimport { Tag, Space, Popconfirm } from 'antd';\nimport { HistoryOutlined } from '@ant-design/icons';\nimport { shell, path } from '@tauri-apps/api';\nimport { Link } from 'react-router-dom';\n\nimport useInit from '@/hooks/useInit';\nimport { chatRoot, fmtDate } from '@/utils';\n\nexport const syncColumns = () => [\n  {\n    title: 'Name',\n    dataIndex: 'name',\n    key: 'name',\n    width: 100,\n  },\n  {\n    title: 'Protocol',\n    dataIndex: 'protocol',\n    key: 'protocol',\n    width: 80,\n    render: (v: string) => <Tag>{v}</Tag>,\n  },\n  {\n    title: 'PATH',\n    dataIndex: 'path',\n    key: 'path',\n    width: 180,\n    render: (_: string, row: any) => <RenderPath row={row} />,\n  },\n  {\n    title: 'Last updated',\n    dataIndex: 'last_updated',\n    key: 'last_updated',\n    width: 140,\n    render: (v: number) => (\n      <div>\n        <HistoryOutlined style={{ marginRight: 5, color: v ? '#52c41a' : '#ff4d4f' }} />\n        {v ? fmtDate(v) : ''}\n      </div>\n    ),\n  },\n  {\n    title: 'Action',\n    fixed: 'right',\n    width: 150,\n    render: (_: any, row: any, actions: any) => {\n      return (\n        <Space>\n          <Popconfirm\n            overlayStyle={{ width: 250 }}\n            title=\"Sync will overwrite the previous data, confirm to sync?\"\n            onConfirm={() => actions.setRecord(row, 'sync')}\n            okText=\"Yes\"\n            cancelText=\"No\"\n          >\n            <a>Sync</a>\n          </Popconfirm>\n          {row.last_updated && (\n            <Link to={`${row.id}`} state={row}>\n              View\n            </Link>\n          )}\n          <a onClick={() => actions.setRecord(row, 'edit')}>Edit</a>\n          <Popconfirm\n            title=\"Are you sure to delete this path?\"\n            onConfirm={() => actions.setRecord(row, 'delete')}\n            okText=\"Yes\"\n            cancelText=\"No\"\n          >\n            <a>Delete</a>\n          </Popconfirm>\n        </Space>\n      );\n    },\n  },\n];\n\nconst RenderPath = ({ row }: any) => {\n  const [filePath, setFilePath] = useState('');\n  useInit(async () => {\n    setFilePath(await getPath(row));\n  });\n  return <a onClick={() => shell.open(filePath)}>{filePath}</a>;\n};\n\nexport const getPath = async (row: any) => {\n  if (!/^http/.test(row.protocol)) {\n    return (await path.join(await chatRoot(), row.path)) + `.${row.ext}`;\n  } else {\n    return `${row.protocol}://${row.path}.${row.ext}`;\n  }\n};\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncCustom/index.tsx",
    "content": "import { useState, useRef, useEffect } from 'react';\nimport { Table, Modal, Button, message } from 'antd';\nimport { invoke, path, fs } from '@tauri-apps/api';\n\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport { TABLE_PAGINATION } from '@/hooks/useTable';\nimport useChatModel, { useCacheModel } from '@/hooks/useChatModel';\nimport { CHAT_MODEL_JSON, chatRoot, readJSON, genCmd } from '@/utils';\nimport { syncColumns, getPath } from './config';\nimport SyncForm from './Form';\n\nconst fmtData = (data: Record<string, any>[] = []) =>\n  (Array.isArray(data) ? data : []).map((i) => ({\n    ...i,\n    cmd: i.cmd ? i.cmd : genCmd(i.act),\n    tags: ['user-sync'],\n    enable: true,\n  }));\n\nexport default function SyncCustom() {\n  const [isVisible, setVisible] = useState(false);\n  const { modelData, modelSet } = useChatModel('sync_custom', CHAT_MODEL_JSON);\n  const { modelCacheCmd, modelCacheSet } = useCacheModel();\n  const { opData, opInit, opAdd, opRemove, opReplace, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(syncColumns());\n  const formRef = useRef<any>(null);\n\n  const hide = () => {\n    setVisible(false);\n    opInfo.resetRecord();\n  };\n\n  useEffect(() => {\n    if (modelData.length <= 0) return;\n    opInit(modelData);\n  }, [modelData]);\n\n  useEffect(() => {\n    if (!opInfo.opType) return;\n    if (opInfo.opType === 'sync') {\n      const filename = `${opInfo?.opRecord?.id}.json`;\n      handleSync(filename).then((isOk: boolean) => {\n        opInfo.resetRecord();\n        if (!isOk) return;\n        const data = opReplace(opInfo?.opRecord?.[opSafeKey], {\n          ...opInfo?.opRecord,\n          last_updated: Date.now(),\n        });\n        modelSet(data);\n        opInfo.resetRecord();\n      });\n    }\n    if (['edit', 'new'].includes(opInfo.opType)) {\n      setVisible(true);\n    }\n    if (['delete'].includes(opInfo.opType)) {\n      (async () => {\n        try {\n          const file = await path.join(\n            await chatRoot(),\n            'cache_model',\n            `${opInfo?.opRecord?.id}.json`,\n          );\n          await fs.removeFile(file);\n        } catch (e) {}\n        const data = opRemove(opInfo?.opRecord?.[opSafeKey]);\n        modelSet(data);\n        opInfo.resetRecord();\n        modelCacheCmd();\n      })();\n    }\n  }, [opInfo.opType, formRef]);\n\n  const handleSync = async (filename: string) => {\n    const record = opInfo?.opRecord;\n    const isJson = /json$/.test(record?.ext);\n    const file = await path.join(await chatRoot(), 'cache_model', filename);\n    const filePath = await getPath(record);\n\n    // https or http\n    if (/^http/.test(record?.protocol)) {\n      const data = await invoke('sync_user_prompts', { url: filePath, dataType: record?.ext });\n      if (data) {\n        await modelCacheSet(data as [], file);\n        await modelCacheCmd();\n        message.success('ChatGPT Prompts data has been synchronized!');\n        return true;\n      } else {\n        message.error('ChatGPT Prompts data sync failed, please try again!');\n        return false;\n      }\n    }\n    // local\n    if (isJson) {\n      // parse json\n      const data = await readJSON(filePath, { isRoot: true });\n      await modelCacheSet(fmtData(data), file);\n    } else {\n      // parse csv\n      const data = await fs.readTextFile(filePath);\n      const list: Record<string, string>[] = await invoke('parse_prompt', { data });\n      await modelCacheSet(fmtData(list), file);\n    }\n    await modelCacheCmd();\n    return true;\n  };\n\n  const handleOk = () => {\n    formRef.current?.form?.validateFields().then((vals: Record<string, any>) => {\n      if (opInfo.opType === 'new') {\n        const data = opAdd(vals);\n        modelSet(data);\n        message.success('Data added successfully');\n      }\n      if (opInfo.opType === 'edit') {\n        const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);\n        modelSet(data);\n        message.success('Data updated successfully');\n      }\n      hide();\n    });\n  };\n\n  return (\n    <div>\n      <Button\n        style={{ marginBottom: 10 }}\n        className=\"chat-add-btn\"\n        type=\"primary\"\n        onClick={opInfo.opNew}\n      >\n        Add PATH\n      </Button>\n      <Table\n        key=\"id\"\n        rowKey=\"name\"\n        columns={columns}\n        scroll={{ x: 800 }}\n        dataSource={opData}\n        pagination={TABLE_PAGINATION}\n      />\n      <Modal\n        open={isVisible}\n        onCancel={hide}\n        title=\"Sync PATH\"\n        onOk={handleOk}\n        destroyOnClose\n        maskClosable={false}\n      >\n        <SyncForm ref={formRef} record={opInfo?.opRecord} type={opInfo.opType} />\n      </Modal>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncPrompts/config.tsx",
    "content": "import { Table, Switch, Tag } from 'antd';\n\nimport { genCmd } from '@/utils';\n\nexport const syncColumns = () => [\n  {\n    title: '/{cmd}',\n    dataIndex: 'cmd',\n    fixed: 'left',\n    // width: 120,\n    key: 'cmd',\n    render: (_: string, row: Record<string, string>) => (\n      <Tag color=\"#2a2a2a\">/{genCmd(row.act)}</Tag>\n    ),\n  },\n  {\n    title: 'Act',\n    dataIndex: 'act',\n    key: 'act',\n    // width: 200,\n  },\n  {\n    title: 'Tags',\n    dataIndex: 'tags',\n    key: 'tags',\n    // width: 150,\n    render: () => <Tag>chatgpt-prompts</Tag>,\n  },\n  {\n    title: 'Enable',\n    dataIndex: 'enable',\n    key: 'enable',\n    // width: 80,\n    render: (v: boolean = false, row: Record<string, any>, action: Record<string, any>) => (\n      <Switch checked={v} onChange={(v) => action.setRecord({ ...row, enable: v }, 'enable')} />\n    ),\n  },\n  Table.EXPAND_COLUMN,\n  {\n    title: 'Prompt',\n    dataIndex: 'prompt',\n    key: 'prompt',\n    // width: 300,\n    render: (v: string) => <span className=\"chat-prompts-val\">{v}</span>,\n  },\n];\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncPrompts/index.scss",
    "content": ".chat-table-tip,\n.chat-table-btns {\n  display: flex;\n  justify-content: space-between;\n}\n\n.chat-table-btns {\n  margin-bottom: 5px;\n\n  .num {\n    margin-left: 10px;\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncPrompts/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { Table, Button, Popconfirm } from 'antd';\nimport { invoke, path } from '@tauri-apps/api';\n\nimport useInit from '@/hooks/useInit';\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport FilePath from '@/components/FilePath';\nimport useChatModel, { useCacheModel } from '@/hooks/useChatModel';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { fmtDate, chatRoot } from '@/utils';\nimport { syncColumns } from './config';\nimport './index.scss';\n\nconst promptsURL = 'https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv';\n\nexport default function SyncPrompts() {\n  const { rowSelection, selectedRowIDs } = useTableRowSelection();\n  const [jsonPath, setJsonPath] = useState('');\n  const { modelJson, modelSet } = useChatModel('sync_prompts');\n  const { modelCacheJson, modelCacheSet } = useCacheModel(jsonPath);\n  const { opData, opInit, opReplace, opReplaceItems, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(syncColumns());\n  const lastUpdated = modelJson?.sync_prompts?.last_updated;\n  const selectedItems = rowSelection.selectedRowKeys || [];\n\n  useInit(async () => {\n    setJsonPath(await path.join(await chatRoot(), 'cache_model', 'chatgpt_prompts.json'));\n  });\n\n  useEffect(() => {\n    if (modelCacheJson.length <= 0) return;\n    opInit(modelCacheJson);\n  }, [modelCacheJson.length]);\n\n  const handleSync = async () => {\n    const data = await invoke('sync_prompts', { time: Date.now() });\n    if (data) {\n      opInit(data as any[]);\n      modelSet({\n        id: 'chatgpt_prompts',\n        last_updated: Date.now(),\n      });\n    }\n  };\n\n  useEffect(() => {\n    if (opInfo.opType === 'enable') {\n      const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n      modelCacheSet(data);\n    }\n  }, [opInfo.opTime]);\n\n  const handleEnable = (isEnable: boolean) => {\n    const data = opReplaceItems(selectedRowIDs, { enable: isEnable });\n    modelCacheSet(data);\n  };\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <Popconfirm\n          overlayStyle={{ width: 250 }}\n          title=\"Sync will overwrite the previous data, confirm to sync?\"\n          placement=\"topLeft\"\n          onConfirm={handleSync}\n          okText=\"Yes\"\n          cancelText=\"No\"\n        >\n          <Button type=\"primary\">Sync</Button>\n        </Popconfirm>\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Button type=\"primary\" onClick={() => handleEnable(true)}>\n                Enable\n              </Button>\n              <Button onClick={() => handleEnable(false)}>Disable</Button>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <div className=\"chat-table-tip\">\n        <div className=\"chat-sync-path\">\n          <FilePath url={promptsURL} content=\"f/awesome-chatgpt-prompts/prompts.csv\" />\n          <FilePath label=\"CACHE\" paths=\"cache_model/chatgpt_prompts.json\" />\n        </div>\n        {lastUpdated && (\n          <span style={{ marginLeft: 10, color: '#888', fontSize: 12 }}>\n            Last updated on {fmtDate(lastUpdated)}\n          </span>\n        )}\n      </div>\n      <Table\n        key={lastUpdated}\n        rowKey=\"act\"\n        columns={columns}\n        scroll={{ x: 'auto' }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n        expandable={{\n          expandedRowRender: (record) => <div style={{ padding: 10 }}>{record.prompt}</div>,\n        }}\n      />\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncRecord/config.tsx",
    "content": "import { Switch, Tag, Table } from 'antd';\n\nimport { genCmd } from '@/utils';\n\nexport const syncColumns = () => [\n  {\n    title: '/{cmd}',\n    dataIndex: 'cmd',\n    fixed: 'left',\n    // width: 120,\n    key: 'cmd',\n    render: (_: string, row: Record<string, string>) => (\n      <Tag color=\"#2a2a2a\">/{row.cmd ? row.cmd : genCmd(row.act)}</Tag>\n    ),\n  },\n  {\n    title: 'Act',\n    dataIndex: 'act',\n    key: 'act',\n    // width: 200,\n  },\n  {\n    title: 'Tags',\n    dataIndex: 'tags',\n    key: 'tags',\n    // width: 150,\n    render: (v: string[]) => (\n      <span className=\"chat-prompts-tags\">\n        {v?.map((i) => (\n          <Tag key={i}>{i}</Tag>\n        ))}\n      </span>\n    ),\n  },\n  {\n    title: 'Enable',\n    dataIndex: 'enable',\n    key: 'enable',\n    // width: 80,\n    render: (v: boolean = false, row: Record<string, any>, action: Record<string, any>) => (\n      <Switch checked={v} onChange={(v) => action.setRecord({ ...row, enable: v }, 'enable')} />\n    ),\n  },\n  Table.EXPAND_COLUMN,\n  {\n    title: 'Prompt',\n    dataIndex: 'prompt',\n    key: 'prompt',\n    // width: 300,\n    render: (v: string) => <span className=\"chat-prompts-val\">{v}</span>,\n  },\n];\n"
  },
  {
    "path": "ChatGPT/src/view/model/SyncRecord/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { ArrowLeftOutlined } from '@ant-design/icons';\nimport { Table, Button } from 'antd';\nimport { path } from '@tauri-apps/api';\n\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport FilePath from '@/components/FilePath';\nimport { useCacheModel } from '@/hooks/useChatModel';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { getPath } from '@/view/model/SyncCustom/config';\nimport { fmtDate, chatRoot } from '@/utils';\nimport { syncColumns } from './config';\nimport useInit from '@/hooks/useInit';\n\nexport default function SyncRecord() {\n  const location = useLocation();\n  const [filePath, setFilePath] = useState('');\n  const [jsonPath, setJsonPath] = useState('');\n  const state = location?.state;\n\n  const { rowSelection, selectedRowIDs } = useTableRowSelection();\n  const { modelCacheJson, modelCacheSet } = useCacheModel(jsonPath);\n  const { opData, opInit, opReplace, opReplaceItems, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(syncColumns());\n\n  const selectedItems = rowSelection.selectedRowKeys || [];\n\n  useInit(async () => {\n    setFilePath(await getPath(state));\n    setJsonPath(await path.join(await chatRoot(), 'cache_model', `${state?.id}.json`));\n  });\n\n  useEffect(() => {\n    if (modelCacheJson.length <= 0) return;\n    opInit(modelCacheJson);\n  }, [modelCacheJson.length]);\n\n  useEffect(() => {\n    if (opInfo.opType === 'enable') {\n      const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n      modelCacheSet(data);\n    }\n  }, [opInfo.opTime]);\n\n  const handleEnable = (isEnable: boolean) => {\n    const data = opReplaceItems(selectedRowIDs, { enable: isEnable });\n    modelCacheSet(data);\n  };\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <div>\n          <Button shape=\"round\" icon={<ArrowLeftOutlined />} onClick={() => history.back()} />\n        </div>\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Button type=\"primary\" onClick={() => handleEnable(true)}>\n                Enable\n              </Button>\n              <Button onClick={() => handleEnable(false)}>Disable</Button>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <div className=\"chat-table-tip\">\n        <div className=\"chat-sync-path\">\n          <FilePath url={filePath} />\n          <FilePath label=\"CACHE\" paths={`cache_model/${state?.id}.json`} />\n        </div>\n        {state?.last_updated && (\n          <span style={{ marginLeft: 10, color: '#888', fontSize: 12 }}>\n            Last updated on {fmtDate(state?.last_updated)}\n          </span>\n        )}\n      </div>\n      <Table\n        key=\"prompt\"\n        rowKey=\"act\"\n        columns={columns}\n        scroll={{ x: 'auto' }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n        expandable={{\n          expandedRowRender: (record) => <div style={{ padding: 10 }}>{record.prompt}</div>,\n        }}\n      />\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/model/UserCustom/Form.tsx",
    "content": "import { useEffect, ForwardRefRenderFunction, useImperativeHandle, forwardRef } from 'react';\nimport { Form, Input, Switch } from 'antd';\nimport type { FormProps } from 'antd';\n\nimport Tags from '@comps/Tags';\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\ninterface UserCustomFormProps {\n  record?: Record<string | symbol, any> | null;\n}\n\nconst initFormValue = {\n  act: '',\n  enable: true,\n  tags: [],\n  prompt: '',\n};\n\nconst UserCustomForm: ForwardRefRenderFunction<FormProps, UserCustomFormProps> = (\n  { record },\n  ref,\n) => {\n  const [form] = Form.useForm();\n  useImperativeHandle(ref, () => ({ form }));\n\n  useEffect(() => {\n    if (record) {\n      form.setFieldsValue(record);\n    }\n  }, [record]);\n\n  return (\n    <Form form={form} labelCol={{ span: 4 }} initialValues={initFormValue}>\n      <Form.Item\n        label=\"/{cmd}\"\n        name=\"cmd\"\n        rules={[{ required: true, message: 'Please enter the {cmd}!' }]}\n      >\n        <Input placeholder=\"Please enter the {cmd}\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item\n        label=\"Act\"\n        name=\"act\"\n        rules={[{ required: true, message: 'Please enter the Act!' }]}\n      >\n        <Input placeholder=\"Please enter the Act\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item label=\"Tags\" name=\"tags\">\n        <Tags value={record?.tags} />\n      </Form.Item>\n      <Form.Item label=\"Enable\" name=\"enable\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      <Form.Item\n        label=\"Prompt\"\n        name=\"prompt\"\n        rules={[{ required: true, message: 'Please enter a prompt!' }]}\n      >\n        <Input.TextArea rows={4} placeholder=\"Please enter a prompt\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n    </Form>\n  );\n};\n\nexport default forwardRef(UserCustomForm);\n"
  },
  {
    "path": "ChatGPT/src/view/model/UserCustom/config.tsx",
    "content": "import { Tag, Switch, Space, Popconfirm, Table } from 'antd';\n\nexport const modelColumns = () => [\n  {\n    title: '/{cmd}',\n    dataIndex: 'cmd',\n    fixed: 'left',\n    width: 120,\n    key: 'cmd',\n    render: (v: string) => <Tag color=\"#2a2a2a\">/{v}</Tag>,\n  },\n  {\n    title: 'Act',\n    dataIndex: 'act',\n    key: 'act',\n    width: 200,\n  },\n  {\n    title: 'Tags',\n    dataIndex: 'tags',\n    key: 'tags',\n    width: 150,\n    render: (v: string[]) => (\n      <span className=\"chat-prompts-tags\">\n        {v?.map((i) => (\n          <Tag key={i}>{i}</Tag>\n        ))}\n      </span>\n    ),\n  },\n  {\n    title: 'Enable',\n    dataIndex: 'enable',\n    key: 'enable',\n    width: 80,\n    render: (v: boolean = false, row: Record<string, any>, action: Record<string, any>) => (\n      <Switch checked={v} onChange={(v) => action.setRecord({ ...row, enable: v }, 'enable')} />\n    ),\n  },\n  Table.EXPAND_COLUMN,\n  {\n    title: 'Prompt',\n    dataIndex: 'prompt',\n    key: 'prompt',\n    width: 300,\n    render: (v: string) => <span className=\"chat-prompts-val\">{v}</span>,\n  },\n  {\n    title: 'Action',\n    key: 'action',\n    fixed: 'right',\n    width: 120,\n    render: (_: any, row: any, actions: any) => (\n      <Space size=\"middle\">\n        <a onClick={() => actions.setRecord(row, 'edit')}>Edit</a>\n        <Popconfirm\n          title=\"Are you sure to delete this model?\"\n          onConfirm={() => actions.setRecord(row, 'delete')}\n          okText=\"Yes\"\n          cancelText=\"No\"\n        >\n          <a>Delete</a>\n        </Popconfirm>\n      </Space>\n    ),\n  },\n];\n"
  },
  {
    "path": "ChatGPT/src/view/model/UserCustom/index.tsx",
    "content": "import { useState, useRef, useEffect } from 'react';\nimport { Table, Button, Modal, message } from 'antd';\nimport { path } from '@tauri-apps/api';\n\nimport useInit from '@/hooks/useInit';\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport FilePath from '@/components/FilePath';\nimport useChatModel, { useCacheModel } from '@/hooks/useChatModel';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { chatRoot, fmtDate } from '@/utils';\nimport { modelColumns } from './config';\nimport UserCustomForm from './Form';\n\nexport default function UserCustom() {\n  const { rowSelection, selectedRowIDs } = useTableRowSelection();\n  const [isVisible, setVisible] = useState(false);\n  const [jsonPath, setJsonPath] = useState('');\n  const { modelJson, modelSet } = useChatModel('user_custom');\n  const { modelCacheJson, modelCacheSet } = useCacheModel(jsonPath);\n  const { opData, opInit, opReplaceItems, opAdd, opRemove, opReplace, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(modelColumns());\n  const lastUpdated = modelJson?.user_custom?.last_updated;\n  const selectedItems = rowSelection.selectedRowKeys || [];\n  const formRef = useRef<any>(null);\n\n  useInit(async () => {\n    setJsonPath(await path.join(await chatRoot(), 'cache_model', 'user_custom.json'));\n  });\n\n  useEffect(() => {\n    if (modelCacheJson.length <= 0) return;\n    opInit(modelCacheJson);\n  }, [modelCacheJson.length]);\n\n  useEffect(() => {\n    if (!opInfo.opType) return;\n    if (['edit', 'new'].includes(opInfo.opType)) {\n      setVisible(true);\n    }\n    if (['delete'].includes(opInfo.opType)) {\n      const data = opRemove(opInfo?.opRecord?.[opSafeKey]);\n      modelCacheSet(data);\n      opInfo.resetRecord();\n    }\n  }, [opInfo.opType, formRef]);\n\n  useEffect(() => {\n    if (opInfo.opType === 'enable') {\n      const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n      modelCacheSet(data);\n    }\n  }, [opInfo.opTime]);\n\n  const handleEnable = (isEnable: boolean) => {\n    const data = opReplaceItems(selectedRowIDs, { enable: isEnable });\n    modelCacheSet(data);\n  };\n\n  const hide = () => {\n    setVisible(false);\n    opInfo.resetRecord();\n  };\n\n  const handleOk = () => {\n    formRef.current?.form?.validateFields().then(async (vals: Record<string, any>) => {\n      if (\n        modelCacheJson.map((i: any) => i.cmd).includes(vals.cmd) &&\n        opInfo?.opRecord?.cmd !== vals.cmd\n      ) {\n        message.warning(\n          `\"cmd: /${vals.cmd}\" already exists, please change the \"${vals.cmd}\" name and resubmit.`,\n        );\n        return;\n      }\n      let data = [];\n      switch (opInfo.opType) {\n        case 'new':\n          data = opAdd(vals);\n          break;\n        case 'edit':\n          data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);\n          break;\n        default:\n          break;\n      }\n      await modelCacheSet(data);\n      opInit(data);\n      modelSet({\n        id: 'user_custom',\n        last_updated: Date.now(),\n      });\n      hide();\n    });\n  };\n\n  const modalTitle = `${{ new: 'Create', edit: 'Edit' }[opInfo.opType]} Model`;\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <Button className=\"chat-add-btn\" type=\"primary\" onClick={opInfo.opNew}>\n          Add Model\n        </Button>\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Button type=\"primary\" onClick={() => handleEnable(true)}>\n                Enable\n              </Button>\n              <Button onClick={() => handleEnable(false)}>Disable</Button>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <div className=\"chat-table-tip\">\n        <FilePath label=\"CACHE\" paths=\"cache_model/user_custom.json\" />\n        {lastUpdated && (\n          <span style={{ marginLeft: 10, color: '#888', fontSize: 12 }}>\n            Last updated on {fmtDate(lastUpdated)}\n          </span>\n        )}\n      </div>\n      <Table\n        key={lastUpdated}\n        rowKey=\"cmd\"\n        columns={columns}\n        scroll={{ x: 'auto' }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n        expandable={{\n          expandedRowRender: (record) => <div style={{ padding: 10 }}>{record.prompt}</div>,\n        }}\n      />\n      <Modal\n        open={isVisible}\n        onCancel={hide}\n        title={modalTitle}\n        onOk={handleOk}\n        destroyOnClose\n        maskClosable={false}\n      >\n        <UserCustomForm record={opInfo?.opRecord} ref={formRef} />\n      </Modal>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/notes/config.tsx",
    "content": "import { useState } from 'react';\nimport { Link } from 'react-router-dom';\nimport { Space, Popconfirm } from 'antd';\nimport { path, shell } from '@tauri-apps/api';\n\nimport { EditRow } from '@/hooks/useColumns';\n\nimport useInit from '@/hooks/useInit';\nimport { fmtDate, chatRoot } from '@/utils';\n\nexport const notesColumns = () => [\n  {\n    title: 'Name',\n    dataIndex: 'name',\n    fixed: 'left',\n    key: 'name',\n    width: 240,\n    render: (_: string, row: any, actions: any) => (\n      <EditRow rowKey=\"name\" row={row} actions={actions} />\n    ),\n  },\n  {\n    title: 'Path',\n    dataIndex: 'path',\n    key: 'path',\n    width: 200,\n    render: (_: string, row: any) => <RenderPath row={row} />,\n  },\n  {\n    title: 'Created',\n    dataIndex: 'created',\n    key: 'created',\n    width: 150,\n    render: fmtDate,\n  },\n  {\n    title: 'Action',\n    fixed: 'right',\n    width: 160,\n    render: (_: any, row: any, actions: any) => {\n      return (\n        <Space>\n          <a onClick={() => actions.setRecord(row, 'preview')}>Preview</a>\n          <Link to={`/md/${row.id}`} state={row}>\n            Edit\n          </Link>\n          <Popconfirm\n            title=\"Are you sure to delete this file?\"\n            onConfirm={() => actions.setRecord(row, 'delete')}\n            okText=\"Yes\"\n            cancelText=\"No\"\n          >\n            <a>Delete</a>\n          </Popconfirm>\n        </Space>\n      );\n    },\n  },\n];\n\nconst RenderPath = ({ row }: any) => {\n  const [filePath, setFilePath] = useState('');\n  useInit(async () => {\n    setFilePath(await getPath(row));\n  });\n  return <a onClick={() => shell.open(filePath)}>{filePath}</a>;\n};\n\nexport const getPath = async (row: any) => {\n  return (await path.join(await chatRoot(), 'notes', row.id)) + `.${row.ext}`;\n};\n"
  },
  {
    "path": "ChatGPT/src/view/notes/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { Table, Modal, Popconfirm, Button, message } from 'antd';\nimport { invoke, path, fs } from '@tauri-apps/api';\n\nimport useJson from '@/hooks/useJson';\nimport useData from '@/hooks/useData';\nimport useColumns from '@/hooks/useColumns';\nimport Markdown from '@/components/Markdown';\nimport FilePath from '@/components/FilePath';\nimport { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';\nimport { chatRoot, CHAT_NOTES_JSON } from '@/utils';\nimport { notesColumns } from './config';\n\nexport default function Notes() {\n  const [source, setSource] = useState('');\n  const [isVisible, setVisible] = useState(false);\n  const { opData, opInit, opReplace, opSafeKey } = useData([]);\n  const { columns, ...opInfo } = useColumns(notesColumns());\n  const { rowSelection, selectedRows, rowReset } = useTableRowSelection({ rowType: 'row' });\n  const { json, refreshJson, updateJson } = useJson<any[]>(CHAT_NOTES_JSON);\n  const selectedItems = rowSelection.selectedRowKeys || [];\n\n  useEffect(() => {\n    if (!json || json.length <= 0) return;\n    opInit(json);\n  }, [json?.length]);\n\n  useEffect(() => {\n    if (!opInfo.opType) return;\n    (async () => {\n      const record = opInfo?.opRecord;\n      const file = await path.join(await chatRoot(), 'notes', `${record?.id}.${record?.ext}`);\n      if (opInfo.opType === 'preview') {\n        const data = await fs.readTextFile(file);\n        setSource(data);\n        setVisible(true);\n        return;\n      }\n      if (opInfo.opType === 'delete') {\n        await fs.removeFile(file);\n        await handleRefresh();\n      }\n      if (opInfo.opType === 'rowedit') {\n        const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);\n        await updateJson(data);\n        message.success('Name has been changed!');\n      }\n      opInfo.resetRecord();\n    })();\n  }, [opInfo.opType]);\n\n  const handleDelete = async () => {\n    if (opData?.length === selectedRows.length) {\n      const notesDir = await path.join(await chatRoot(), 'notes');\n      await fs.removeDir(notesDir, { recursive: true });\n      await handleRefresh();\n      message.success('All files have been cleared!');\n      return;\n    }\n\n    const rows = selectedRows.map(async (i) => {\n      const file = await path.join(await chatRoot(), 'notes', `${i?.id}.${i?.ext}`);\n      await fs.removeFile(file);\n      return file;\n    });\n    Promise.all(rows).then(async () => {\n      await handleRefresh();\n      message.success('All files selected are cleared!');\n    });\n  };\n\n  const handleRefresh = async () => {\n    await invoke('download_list', { pathname: CHAT_NOTES_JSON, dir: 'notes' });\n    rowReset();\n    const data = await refreshJson();\n    opInit(data);\n  };\n\n  const handleCancel = () => {\n    setVisible(false);\n    opInfo.resetRecord();\n  };\n\n  return (\n    <div>\n      <div className=\"chat-table-btns\">\n        <div>\n          {selectedItems.length > 0 && (\n            <>\n              <Popconfirm\n                overlayStyle={{ width: 250 }}\n                title=\"Files cannot be recovered after deletion, are you sure you want to delete them?\"\n                placement=\"topLeft\"\n                onConfirm={handleDelete}\n                okText=\"Yes\"\n                cancelText=\"No\"\n              >\n                <Button>Delete</Button>\n              </Popconfirm>\n              <span className=\"num\">Selected {selectedItems.length} items</span>\n            </>\n          )}\n        </div>\n      </div>\n      <FilePath paths={CHAT_NOTES_JSON} />\n      <Table\n        rowKey=\"id\"\n        columns={columns}\n        scroll={{ x: 800 }}\n        dataSource={opData}\n        rowSelection={rowSelection}\n        pagination={TABLE_PAGINATION}\n      />\n      <Modal\n        open={isVisible}\n        title={<div>{opInfo?.opRecord?.name || ''}</div>}\n        onCancel={handleCancel}\n        footer={false}\n        destroyOnClose\n        width={600}\n      >\n        <Markdown children={source} />\n      </Modal>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/settings/General.tsx",
    "content": "import { useState } from 'react';\nimport { Form, Radio, Switch, Input, Tooltip, Select, Tag } from 'antd';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\nimport { platform } from '@tauri-apps/api/os';\n\nimport useInit from '@/hooks/useInit';\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\nexport default function General() {\n  const [platformInfo, setPlatform] = useState('');\n  const [vlist, setVoices] = useState<any[]>([]);\n\n  useInit(async () => {\n    setPlatform(await platform());\n    speechSynthesis.addEventListener('voiceschanged', () => {\n      const voices = speechSynthesis.getVoices();\n      console.log(voices);\n      setVoices(voices);\n    });\n    setVoices(speechSynthesis.getVoices());\n  });\n\n  return (\n    <>\n      <Form.Item label=\"Stay On Top\" name=\"stay_on_top\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      <Form.Item label=\"Save Window State\" name=\"save_window_state\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      {platformInfo === 'darwin' && (\n        <Form.Item label=\"Titlebar\" name=\"titlebar\" valuePropName=\"checked\">\n          <Switch />\n        </Form.Item>\n      )}\n      {platformInfo === 'darwin' && (\n        <Form.Item label=\"Hide Dock Icon\" name=\"hide_dock_icon\" valuePropName=\"checked\">\n          <Switch />\n        </Form.Item>\n      )}\n      <Form.Item label=\"Theme\" name=\"theme\">\n        <Radio.Group>\n          <Radio value=\"light\">Light</Radio>\n          <Radio value=\"dark\">Dark</Radio>\n          {['darwin', 'windows'].includes(platformInfo) && <Radio value=\"System\">System</Radio>}\n        </Radio.Group>\n      </Form.Item>\n      <Form.Item label={<AutoUpdateLabel />} name=\"auto_update\">\n        <Radio.Group>\n          <Radio value=\"prompt\">Prompt</Radio>\n          <Radio value=\"silent\">Silent</Radio>\n          {/*<Radio value=\"disable\">Disable</Radio>*/}\n        </Radio.Group>\n      </Form.Item>\n      <Form.Item label={<GlobalShortcutLabel />} name=\"global_shortcut\">\n        <Input placeholder=\"CmdOrCtrl+Shift+O\" {...DISABLE_AUTO_COMPLETE} />\n      </Form.Item>\n      <Form.Item label=\"Set Speech Language\" name=\"speech_lang\">\n        <Select>\n          {vlist.map((voice: any) => {\n            return (\n              <Select.Option key={voice.voiceURI} value={voice.voiceURI}>\n                {voice.name} {': '}\n                <Tag>{voice.lang}</Tag>\n              </Select.Option>\n            );\n          })}\n        </Select>\n      </Form.Item>\n    </>\n  );\n}\n\nconst AutoUpdateLabel = () => {\n  return (\n    <span>\n      Auto Update{' '}\n      <Tooltip\n        title={\n          <div>\n            <div>Auto Update Policy</div>\n            <div>\n              <strong>Prompt</strong>: prompt to install\n            </div>\n            <div>\n              <strong>Silent</strong>: install silently\n            </div>\n            {/* <div><strong>Disable</strong>: disable auto update</div> */}\n          </div>\n        }\n      >\n        <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n      </Tooltip>\n    </span>\n  );\n};\n\nconst GlobalShortcutLabel = () => {\n  return (\n    <div>\n      Global Shortcut{' '}\n      <Tooltip\n        title={\n          <div>\n            <div>Shortcut definition, modifiers and key separated by \"+\" e.g. CmdOrControl+Q</div>\n            <div style={{ margin: '10px 0' }}>If empty, the shortcut is disabled.</div>\n            <a href=\"https://tauri.app/v1/api/js/globalshortcut\" target=\"_blank\">\n              https://tauri.app/v1/api/js/globalshortcut\n            </a>\n          </div>\n        }\n      >\n        <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n      </Tooltip>\n    </div>\n  );\n};\n"
  },
  {
    "path": "ChatGPT/src/view/settings/LangHelper.tsx",
    "content": "import { useState} from 'react';\nimport useInit from '@/hooks/useInit';\nimport {Form,Switch,Select,Radio,Input} from 'antd'\nimport { speakers, celebrity} from './Speakers';\nimport { FormInstance } from 'antd/lib/form';\n\nexport default function LangHelper({ form }: { form: FormInstance }) {\n\n    const Speech_Type_List = ['web','ai','azure','iflytek'];\n    // web, ai,azure, iflytek\n    const Rec_Type_List = ['web','iflytek','ai'];\n    //iflytek, speechsuper\n    const Assess_Type_List = ['','iflytek','speechsuper'];\n\n    const Special_Speech_Mode =['accent_per_sentence',\"region_per_passage\"]\n    const [selectSpeech, setSelectSpeech] = useState('')\n    const [selectRec,setSelectRec]  = useState('');\n    const [selectAssess,setSelectAssess]  = useState('');\n    \n    useInit(() => {\n        setSelectSpeech(form.getFieldValue('speech_type'));\n        setSelectRec(form.getFieldValue('rec_type'));\n        setSelectAssess(form.getFieldValue('assess_type'));\n    });\n    return (\n      <>\n        <Form.Item label=\"Talk mode\" name=\"talk_mode\" valuePropName=\"checked\">\n            <Switch />\n        </Form.Item>\n        <Form.Item label = \"Speech Type\" name=\"speech_type\">\n            <Select onChange={(v) =>{setSelectSpeech(v)}}>\n                { Speech_Type_List.map((s:string) =>{\n                    return (\n                        <Select.Option key={s} value={s}>\n                            {s}\n                        </Select.Option>\n                    );\n                })}\n            </Select>\n        </Form.Item>\n        <Form.Item label = \"Recognition Type\" name=\"rec_type\">\n            <Select onChange={(v)=>{setSelectRec(v)}}>\n                { Rec_Type_List.map((s:string) =>{\n                    return (\n                        <Select.Option key={s} value={s}>\n                            {s}\n                        </Select.Option>\n                    );\n                })}\n            </Select>\n        </Form.Item>\n        <Form.Item label = \"Assessment Type\" name=\"assess_type\">\n            <Select onChange={(v) =>{setSelectAssess(v)}}>\n                { Assess_Type_List.map((s:string) =>{\n                    return (\n                        <Select.Option key={s} value={s}>\n                            {s}\n                        </Select.Option>\n                    );\n                })}\n            </Select>\n        </Form.Item>\n        { selectSpeech === \"ai\" && (\n            <Form.Item label=\"Hundreds ai Accents\" name=\"speech_ai_lang\">\n                <Select>\n                    {Special_Speech_Mode.map((s:string)=>{\n                        return (\n                            <Select.Option key={s} value ={s}>\n                                {s}\n                            </Select.Option>\n                        );\n                    })}\n                    {speakers.map((l:string[])=>{\n                        const speaker = l.join(\"-\");\n                        return (\n                            <Select.Option key={speaker} value ={speaker}>\n                                {speaker}\n                            </Select.Option>\n                        );\n                    })}\n                    {celebrity.map((s:string)=>{\n                        return (\n                            <Select.Option key={s} value ={s}>\n                                {s}\n                            </Select.Option>\n                        );\n                    })}\n                </Select>\n            </Form.Item>\n        )}\n         { selectSpeech === \"ai\" && (\n            <Form.Item label=\"AI speech subprocess number\" name=\"subprocess_number\">\n                <Radio.Group>\n                    <Radio value=\"1\">1</Radio>\n                    <Radio value=\"2\">2</Radio>\n                    <Radio value=\"3\">3</Radio>\n                </Radio.Group>\n          </Form.Item>\n        )}\n        { selectRec === \"iflytek\" && (\n            <Form.Item label=\"iflytek Rec AppId\" name=\"iflytek_rec_appid\">\n                <Input placeholder=\"input your iflytek Rec AppId\"/>\n            </Form.Item>\n        )}\n        { selectRec === \"iflytek\" && (\n            <Form.Item label=\"iflytek Rec ApiKey\" name=\"iflytek_rec_apikey\">\n                <Input placeholder=\"input your iflytek Rec ApiKey\"/>\n            </Form.Item>\n        )}\n        { selectRec === \"iflytek\" && (\n            <Form.Item label=\"iflytek Rec Lang\" name=\"rec_iflytek_lang\">\n                <Radio.Group>\n                    <Radio value=\"cn\">ch&en</Radio>\n                    <Radio value=\"en\">en</Radio>\n                </Radio.Group>\n            </Form.Item>\n        )}\n        { selectAssess === \"iflytek\" && (\n            <Form.Item label=\"iflytek Assess AppId\" name=\"iflytek_assess_appid\">\n                <Input placeholder=\"input your iflytek Assess AppId\"/>\n            </Form.Item>\n        )}\n        { selectAssess === \"iflytek\" && (\n            <Form.Item label=\"iflytek Assess ApiSecret\" name=\"iflytek_assess_appsecret\">\n                <Input placeholder=\"input your iflytek Assess ApiSecret\"/>\n            </Form.Item>\n        )}\n        { selectAssess === \"iflytek\" && (\n            <Form.Item label=\"iflytek Assess ApiKey\" name=\"iflytek_assess_apikey\">\n                <Input placeholder=\"input your iflytek Assess ApiKey\"/>\n            </Form.Item>\n        )}\n        { selectAssess === \"speechsuper\" && (\n            <Form.Item label=\"speechsuper Assess AppKey\" name=\"ss_assess_appkey\">\n                <Input placeholder=\"input your speechsuper Assess AppKey\"/>\n            </Form.Item>\n        )}\n        { selectAssess === \"speechsuper\" && (\n            <Form.Item label=\"speechsuper Assess SecretKey\" name=\"ss_assess_secretkey\">\n                <Input placeholder=\"input your speechsuper Assess SecretKey\"/>\n            </Form.Item>\n        )}\n      </>\n    );\n}\n  "
  },
  {
    "path": "ChatGPT/src/view/settings/MainWindow.tsx",
    "content": "import { Form, Switch, Input, InputNumber, Tooltip } from 'antd';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\n\nimport SwitchOrigin from '@/components/SwitchOrigin';\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\n\nconst PopupSearchLabel = () => {\n  return (\n    <span>\n      Pop-up Search{' '}\n      <Tooltip\n        title={\n          <div>\n            <div style={{ marginBottom: 10 }}>\n              Generate images according to the content: Select the ChatGPT content with the mouse,\n              no more than 400 characters. the <b>DALL·E 2</b> button appears, and click to jump\n              (Note: because the search content filled by the script cannot trigger the event\n              directly, you need to enter a space in the input box to make the button clickable).\n            </div>\n            <div>\n              The application is built using Tauri, and due to its security restrictions, some of\n              the action buttons will not work, so we recommend going to your browser.\n            </div>\n          </div>\n        }\n      >\n        <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n      </Tooltip>\n    </span>\n  );\n};\n\nconst MainCloseLabel = () => {\n  return (\n    <span>\n      Close Exit{' '}\n      <Tooltip title=\"Click the close button whether to exit directly, the default minimized.\">\n        <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n      </Tooltip>\n    </span>\n  );\n};\n\nexport default function MainWindow() {\n  return (\n    <>\n      <Form.Item label={<PopupSearchLabel />} name=\"popup_search\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      <Form.Item label={<MainCloseLabel />} name=\"main_close\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      <Form.Item label=\"Default Width\" name=\"main_width\">\n        <InputNumber />\n      </Form.Item>\n      <Form.Item label=\"Default Height\" name=\"main_height\">\n        <InputNumber />\n      </Form.Item>\n      <SwitchOrigin name=\"main\" />\n      <Form.Item label=\"User Agent (Main)\" name=\"ua_window\">\n        <Input.TextArea\n          autoSize={{ minRows: 4, maxRows: 4 }}\n          {...DISABLE_AUTO_COMPLETE}\n          placeholder=\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36\"\n        />\n      </Form.Item>\n    </>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/settings/Speakers.ts",
    "content": "\nexport const speakers: string[][] =[\n    ['p225', 'F', 'English'],\n    ['p226', 'M', 'English'],\n    ['p227', 'M', 'English'],\n    ['p228', 'F', 'English'],\n    ['p229', 'F', 'English'],\n    ['p230', 'F', 'English'],\n    ['p231', 'F', 'English'],\n    ['p232', 'M', 'English'],\n    ['p233', 'F', 'English'],\n    ['p234', 'F', 'Scottish'],\n    ['p236', 'F', 'English'],\n    ['p237', 'M', 'Scottish'],\n    ['p238', 'F', 'NorthernIrish'],\n    ['p239', 'F', 'English'],\n    ['p240', 'F', 'English'],\n    ['p241', 'M', 'Scottish'],\n    ['p243', 'M', 'English'],\n    ['p244', 'F', 'English'],\n    ['p245', 'M', 'Irish'],\n    ['p246', 'M', 'Scottish'],\n    ['p247', 'M', 'Scottish'],\n    ['p248', 'F', 'Indian'],\n    ['p249', 'F', 'Scottish'],\n    ['p250', 'F', 'English'],\n    ['p251', 'M', 'Indian'],\n    ['p252', 'M', 'Scottish'],\n    ['p253', 'F', 'Welsh'],\n    ['p254', 'M', 'English'],\n    ['p255', 'M', 'Scottish'],\n    ['p256', 'M', 'English'],\n    ['p257', 'F', 'English'],\n    ['p258', 'M', 'English'],\n    ['p259', 'M', 'English'],\n    ['p260', 'M', 'Scottish'],\n    ['p261', 'F', 'NorthernIrish'],\n    ['p262', 'F', 'Scottish'],\n    ['p263', 'M', 'Scottish'],\n    ['p264', 'F', 'Scottish'],\n    ['p265', 'F', 'Scottish'],\n    ['p266', 'F', 'Irish'],\n    ['p267', 'F', 'English'],\n    ['p268', 'F', 'English'],\n    ['p269', 'F', 'English'],\n    ['p270', 'M', 'English'],\n    ['p271', 'M', 'Scottish'],\n    ['p272', 'M', 'Scottish'],\n    ['p273', 'M', 'English'],\n    ['p274', 'M', 'English'],\n    ['p275', 'M', 'Scottish'],\n    ['p276', 'F', 'English'],\n    ['p277', 'F', 'English'],\n    ['p278', 'M', 'English'],\n    ['p279', 'M', 'English'],\n    ['p280', 'F', 'Unknown'],\n    ['p281', 'M', 'Scottish'],\n    ['p282', 'F', 'English'],\n    ['p283', 'F', 'Irish'],\n    ['p284', 'M', 'Scottish'],\n    ['p285', 'M', 'Scottish'],\n    ['p286', 'M', 'English'],\n    ['p287', 'M', 'English'],\n    ['p288', 'F', 'Irish'],\n    ['p292', 'M', 'NorthernIrish'],\n    ['p293', 'F', 'NorthernIrish'],\n    ['p294', 'F', 'American'],\n    ['p295', 'F', 'Irish'],\n    ['p297', 'F', 'American'],\n    ['p298', 'M', 'Irish'],\n    ['p299', 'F', 'American'],\n    ['p300', 'F', 'American'],\n    ['p301', 'F', 'American'],\n    ['p302', 'M', 'Canadian'],\n    ['p303', 'F', 'Canadian'],\n    ['p304', 'M', 'NorthernIrish'],\n    ['p305', 'F', 'American'],\n    ['p306', 'F', 'American'],\n    ['p307', 'F', 'Canadian'],\n    ['p308', 'F', 'American'],\n    ['p310', 'F', 'American'],\n    ['p311', 'M', 'American'],\n    ['p312', 'F', 'Canadian'],\n    ['p313', 'F', 'Irish'],\n    ['p314', 'F', 'SouthAfrican'],\n    ['p315', 'M', 'American'],\n    ['p316', 'M', 'Canadian'],\n    ['p317', 'F', 'Canadian'],\n    ['p318', 'F', 'American'],\n    ['p323', 'F', 'SouthAfrican'],\n    ['p326', 'M', 'Australian'],\n    ['p329', 'F', 'American'],\n    ['p330', 'F', 'American'],\n    ['p333', 'F', 'American'],\n    ['p334', 'M', 'American'],\n    ['p335', 'F', 'NewZealand'],\n    ['p336', 'F', 'SouthAfrican'],\n    ['p339', 'F', 'American'],\n    ['p340', 'F', 'Irish'],\n    ['p341', 'F', 'American'],\n    ['p343', 'F', 'Canadian'],\n    ['p345', 'M', 'American'],\n    ['p347', 'M', 'SouthAfrican'],\n    ['p351', 'F', 'NorthernIrish'],\n    ['p360', 'M', 'American'],\n    ['p361', 'F', 'American'],\n    ['p362', 'F', 'American'],\n    ['p363', 'M', 'Canadian'],\n    ['p364', 'M', 'Irish'],\n    ['p374', 'M', 'Australian'],\n    ['p376', 'M', 'Indian'],\n    ['s5', 'F', 'British'],\n];\n\nexport const celebrity:string[]= [\n  \"Downey\",\n  \"Obama\",\n];"
  },
  {
    "path": "ChatGPT/src/view/settings/TrayWindow.tsx",
    "content": "import { Form, Switch, Input, InputNumber, Tooltip } from 'antd';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\n\nimport { DISABLE_AUTO_COMPLETE } from '@/utils';\nimport SwitchOrigin from '@/components/SwitchOrigin';\n\nconst UALabel = () => {\n  return (\n    <span>\n      User Agent (SystemTray){' '}\n      <Tooltip\n        title={<div>For a better experience, we recommend using the Mobile User-Agent.</div>}\n      >\n        <QuestionCircleOutlined style={{ color: '#1677ff' }} />\n      </Tooltip>\n    </span>\n  );\n};\n\nexport default function TrayWindow() {\n  return (\n    <>\n      <Form.Item label=\"Enable SystemTray\" name=\"tray\" valuePropName=\"checked\">\n        <Switch />\n      </Form.Item>\n      <Form.Item label=\"Default Width\" name=\"tray_width\">\n        <InputNumber />\n      </Form.Item>\n      <Form.Item label=\"Default Height\" name=\"tray_height\">\n        <InputNumber />\n      </Form.Item>\n      <SwitchOrigin name=\"tray\" />\n      <Form.Item label={<UALabel />} name=\"ua_tray\">\n        <Input.TextArea\n          autoSize={{ minRows: 4, maxRows: 4 }}\n          {...DISABLE_AUTO_COMPLETE}\n          placeholder=\"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1\"\n        />\n      </Form.Item>\n    </>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/view/settings/index.tsx",
    "content": "import { useEffect, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { Form, Tabs, Space, Button, Popconfirm, message } from 'antd';\nimport { invoke, dialog, process, path, shell } from '@tauri-apps/api';\nimport { clone, omit, isEqual } from 'lodash';\n\nimport useInit from '@/hooks/useInit';\nimport FilePath from '@/components/FilePath';\nimport { chatRoot, APP_CONF_JSON } from '@/utils';\nimport General from './General';\nimport MainWindow from './MainWindow';\nimport TrayWindow from './TrayWindow';\nimport LangHelper from './LangHelper'\n\nexport default function Settings() {\n  const [params] = useSearchParams();\n  const [activeKey, setActiveKey] = useState('general');\n  const [form] = Form.useForm();\n  const [chatConf, setChatConf] = useState<any>(null);\n  const [filePath, setPath] = useState('');\n  const key = params.get('type');\n\n  useEffect(() => {\n    setActiveKey(key ? key : 'general');\n  }, [key]);\n\n  useInit(async () => {\n    setChatConf(await invoke('get_app_conf'));\n    setPath(await path.join(await chatRoot(), APP_CONF_JSON));\n  });\n\n  useEffect(() => {\n    form.setFieldsValue(clone(chatConf));\n  }, [chatConf]);\n\n  const onCancel = () => {\n    form.setFieldsValue(chatConf);\n  };\n\n  const onReset = async () => {\n    const chatData = await invoke('reset_app_conf');\n    setChatConf(chatData);\n    const isOk = await dialog.ask(`Configuration reset successfully, do you want to restart?`, {\n      title: 'ChatGPT Preferences',\n    });\n    if (isOk) {\n      process.relaunch();\n      return;\n    }\n    message.success('Configuration reset successfully');\n  };\n\n  const onFinish = async (values: any) => {\n    if (!isEqual(omit(chatConf, ['default_origin']), values)) {\n      await invoke('form_confirm', { data: values, label: 'main' });\n      const isOk = await dialog.ask(`Configuration saved successfully, do you want to restart?`, {\n        title: 'ChatGPT Preferences',\n      });\n      if (isOk) {\n        process.relaunch();\n        return;\n      }\n      message.success('Configuration saved successfully');\n    }\n  };\n\n  const handleTab = (v: string) => {\n    setActiveKey(v);\n  };\n\n  return (\n    <div>\n      <FilePath paths={APP_CONF_JSON} />\n      <Form\n        form={form}\n        style={{ maxWidth: 500 }}\n        onFinish={onFinish}\n        labelCol={{ span: 10 }}\n        wrapperCol={{ span: 13, offset: 1 }}\n      >\n        <Tabs\n          activeKey={activeKey}\n          onChange={handleTab}\n          items={[\n            { label: 'LangHelper', key: 'lang_helper', children: <LangHelper form= {form}/> },\n            { label: 'General', key: 'general', children: <General /> },\n            { label: 'Main Window', key: 'main_window', children: <MainWindow /> },\n            { label: 'SystemTray Window', key: 'tray_window', children: <TrayWindow /> },\n          ]}\n        />\n\n        <Form.Item>\n          <Space size={20}>\n            <Button onClick={onCancel}>Cancel</Button>\n            <Button type=\"primary\" htmlType=\"submit\">\n              Submit\n            </Button>\n            <Popconfirm\n              title={\n                <div style={{ width: 360 }}>\n                  Are you sure you want to reset the configuration file\n                  <a onClick={() => shell.open(filePath)} style={{ margin: '0 5px' }}>\n                    {filePath}\n                  </a>\n                  to the default?\n                </div>\n              }\n              onConfirm={onReset}\n              okText=\"Yes\"\n              cancelText=\"No\"\n            >\n              <Button type=\"dashed\">Reset to defaults</Button>\n            </Popconfirm>\n          </Space>\n        </Form.Item>\n      </Form>\n    </div>\n  );\n}\n"
  },
  {
    "path": "ChatGPT/src/vite-env.d.ts",
    "content": "/// <reference types=\"vite/client\" />\n"
  },
  {
    "path": "ChatGPT/src-tauri/Cargo.toml",
    "content": "[package]\nname = \"chatgpt\"\nversion = \"0.0.0\"\nauthors = [\"lencx <cxin1314@gmail.com>\"]\ndescription = \"ChatGPT Desktop Application\"\nrepository = \"https://github.com/lencx/ChatGPT\"\nlicense = \"MIT\"\nedition = \"2021\"\nrust-version = \"1.57\"\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[build-dependencies]\ntauri-build = {version = \"1.2.1\", features = [] }\n\n[dependencies]\nanyhow = \"1.0.66\"\nserde_json = \"1.0\"\nlog = \"0.4.17\"\ncsv = \"1.1.6\"\nthiserror = \"1.0.38\"\nwalkdir = \"2.3.2\"\nregex = \"1.7.0\"\nreqwest = {version = \"0.11.13\", features = [\"json\"] }\nwry = \"0.24.1\"\ndark-light = \"1.0.0\"\nserde = { version = \"1.0\", features = [\"derive\"] }\ntokio = { version = \"1.23.0\", features = [\"macros\"] }\ntauri = { version = \"1.2.4\", features = [\"devtools\", \"fs-create-dir\", \"fs-exists\", \"fs-read-dir\", \"fs-read-file\", \"fs-remove-dir\", \"fs-remove-file\", \"fs-write-file\", \"global-shortcut\", \"global-shortcut-all\", \"os-all\", \"path-all\", \"process-all\", \"shell-open-api\", \"system-tray\", \"updater\"] }\ntauri-plugin-positioner = { git = \"https://github.com/lencx/tauri-plugins-workspace\", features = [\"system-tray\"] }\ntauri-plugin-log = { git = \"https://github.com/lencx/tauri-plugins-workspace\", branch = \"dev\", features = [\"colored\"] }\ntauri-plugin-autostart = { git = \"https://github.com/lencx/tauri-plugins-workspace\", branch = \"dev\" }\ntauri-plugin-window-state = { git = \"https://github.com/lencx/tauri-plugins-workspace\", branch = \"dev\" }\nhyper = \"0.14.11\"\nwebview = \"0.1.1\"\n# sqlx = { version = \"0.6.2\", features = [\"runtime-tokio-rustls\", \"sqlite\"] }\n\n[features]\n# by default Tauri runs in production mode\n# when `tauri dev` runs, it is executed with `cargo run --no-default-features` if `devPath` is an URL\ndefault = [ \"custom-protocol\" ]\n# this feature is used for production builds where `devPath` points to the filesystem\n# DO NOT remove this\ncustom-protocol = [ \"tauri/custom-protocol\" ]\n"
  },
  {
    "path": "ChatGPT/src-tauri/build.rs",
    "content": "fn main() {\n  tauri_build::build()\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/cmd.rs",
    "content": "use crate::utils;\nuse log::error;\nuse std::{fs, path::PathBuf};\nuse tauri::{api, command, AppHandle, Manager};\n\n#[command]\npub fn drag_window(app: AppHandle) {\n  app.get_window(\"core\").unwrap().start_dragging().unwrap();\n}\n\n#[command]\npub fn fullscreen(app: AppHandle) {\n  let win = app.get_window(\"core\").unwrap();\n  if win.is_fullscreen().unwrap() {\n    win.set_fullscreen(false).unwrap();\n  } else {\n    win.set_fullscreen(true).unwrap();\n  }\n}\n\n#[command]\npub fn download(app: AppHandle, name: String, blob: Vec<u8>) {\n  let win = app.app_handle().get_window(\"core\");\n  let path = utils::app_root().join(PathBuf::from(name));\n  utils::create_file(&path).unwrap();\n  fs::write(&path, blob).unwrap();\n  tauri::api::dialog::message(\n    win.as_ref(),\n    \"Save File\",\n    format!(\"PATH: {}\", path.display()),\n  );\n}\n\n#[command]\npub fn save_file(app: AppHandle, name: String, content: String) {\n  let win = app.app_handle().get_window(\"core\");\n  let path = utils::app_root().join(PathBuf::from(name));\n  utils::create_file(&path).unwrap();\n  fs::write(&path, content).unwrap();\n  tauri::api::dialog::message(\n    win.as_ref(),\n    \"Save File\",\n    format!(\"PATH: {}\", path.display()),\n  );\n}\n\n#[command]\npub fn open_link(app: AppHandle, url: String) {\n  api::shell::open(&app.shell_scope(), url, None).unwrap();\n}\n\n#[command]\npub fn run_check_update(app: AppHandle, silent: bool, has_msg: Option<bool>) {\n  utils::run_check_update(app, silent, has_msg);\n}\n\n#[command]\npub fn open_file(path: PathBuf) {\n  utils::open_file(path);\n}\n\n#[command]\npub async fn get_data(app: AppHandle, url: String, is_msg: Option<bool>) -> Option<String> {\n  let is_msg = is_msg.unwrap_or(false);\n  let res = if is_msg {\n    utils::get_data(&url, Some(&app)).await\n  } else {\n    utils::get_data(&url, None).await\n  };\n  res.unwrap_or_else(|err| {\n    error!(\"chatgpt_client_http: {}\", err);\n    None\n  })\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/cors.rs",
    "content": "use serde::{Deserialize, Serialize};\nuse reqwest::{Client, Method, RequestBuilder,Proxy};\n// use wry::http::UriScheme;\n\n#[derive(Default, Serialize, Deserialize,Debug)]\npub struct Message {\n    message: String,\n    data:String,\n}\n\n#[tauri::command]\npub async fn fetch_data(\n    method: String,\n    url: String,\n    body: Option<String>\n) -> Result<Message, String>{\n    println!(\"{},{},{:?}\",method,url,body);\n\n    let req_builder: RequestBuilder;\n    let method = match method.as_str() {\n        \"GET\" => Method::GET,\n        \"POST\" => Method::POST,\n        \"PUT\" => Method::PUT,\n        \"DELETE\" => Method::DELETE,\n        _ => {\n            // Handle invalid method\n            return Err(\"Invalid method\".to_string());\n        }\n    };\n    if url.contains(\"localhost\"){\n        let mut client_builder = Client::builder();\n        // let mut client_builder = Client::builder()\n        //         .pool_max_idle_per_host(15);\n        //         .pool_idle_timeout(Duration::from_secs(10))\n                // .build()?;\n        client_builder = client_builder.proxy(Proxy::custom(move |url| {       \n                None::<String> // bypass proxy for localhost\n        }));\n        let client = client_builder.build().map_err(|e| format!(\"Failed to create client: {}\", e))?;\n        req_builder = client.request(method, &url);\n    } else {\n        let client =Client::new();\n        req_builder = client.request(method, &url);\n    }\n    \n    let req_builder = req_builder.header(\"Content-Type\", \"application/json\"); // Add header\n    let resp = match body {\n        Some(data) => req_builder.body(data).send().await.map_err(|e| format!(\"Request failed: {}\", e))?,\n        None => req_builder.send().await.map_err(|e| format!(\"Request failed: {}\", e))?,\n    };\n    \n    let message: Message = resp.json().await.map_err(|e| format!(\"Failed to parse response: {}\", e))?;\n    println!(\"response:{:?}\",message);\n    Ok(message) // Return the response directly\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/fs_extra.rs",
    "content": "// https://github.com/tauri-apps/tauri-plugin-fs-extra/blob/dev/src/lib.rs\n\n// Copyright 2019-2021 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n\nuse serde::{ser::Serializer, Serialize};\nuse std::{\n  path::PathBuf,\n  time::{SystemTime, UNIX_EPOCH},\n};\nuse tauri::command;\n\n#[cfg(unix)]\nuse std::os::unix::fs::{MetadataExt, PermissionsExt};\n#[cfg(windows)]\nuse std::os::windows::fs::MetadataExt;\n\ntype Result<T> = std::result::Result<T, Error>;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n  #[error(transparent)]\n  Io(#[from] std::io::Error),\n}\n\nimpl Serialize for Error {\n  fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>\n  where\n    S: Serializer,\n  {\n    serializer.serialize_str(self.to_string().as_ref())\n  }\n}\n\n#[derive(Serialize)]\n#[serde(rename_all = \"camelCase\")]\nstruct Permissions {\n  readonly: bool,\n  #[cfg(unix)]\n  mode: u32,\n}\n\n#[cfg(unix)]\n#[derive(Serialize)]\n#[serde(rename_all = \"camelCase\")]\nstruct UnixMetadata {\n  dev: u64,\n  ino: u64,\n  mode: u32,\n  nlink: u64,\n  uid: u32,\n  gid: u32,\n  rdev: u64,\n  blksize: u64,\n  blocks: u64,\n}\n\n#[derive(Serialize)]\n#[serde(rename_all = \"camelCase\")]\npub struct Metadata {\n  accessed_at_ms: u64,\n  pub created_at_ms: u64,\n  modified_at_ms: u64,\n  is_dir: bool,\n  is_file: bool,\n  is_symlink: bool,\n  size: u64,\n  permissions: Permissions,\n  #[cfg(unix)]\n  #[serde(flatten)]\n  unix: UnixMetadata,\n  #[cfg(windows)]\n  file_attributes: u32,\n}\n\npub fn system_time_to_ms(time: std::io::Result<SystemTime>) -> u64 {\n  time\n    .map(|t| {\n      let duration_since_epoch = t.duration_since(UNIX_EPOCH).unwrap();\n      duration_since_epoch.as_millis() as u64\n    })\n    .unwrap_or_default()\n}\n\n#[command]\npub async fn metadata(path: PathBuf) -> Result<Metadata> {\n  let metadata = std::fs::metadata(path)?;\n  let file_type = metadata.file_type();\n  let permissions = metadata.permissions();\n  Ok(Metadata {\n    accessed_at_ms: system_time_to_ms(metadata.accessed()),\n    created_at_ms: system_time_to_ms(metadata.created()),\n    modified_at_ms: system_time_to_ms(metadata.modified()),\n    is_dir: file_type.is_dir(),\n    is_file: file_type.is_file(),\n    is_symlink: file_type.is_symlink(),\n    size: metadata.len(),\n    permissions: Permissions {\n      readonly: permissions.readonly(),\n      #[cfg(unix)]\n      mode: permissions.mode(),\n    },\n    #[cfg(unix)]\n    unix: UnixMetadata {\n      dev: metadata.dev(),\n      ino: metadata.ino(),\n      mode: metadata.mode(),\n      nlink: metadata.nlink(),\n      uid: metadata.uid(),\n      gid: metadata.gid(),\n      rdev: metadata.rdev(),\n      blksize: metadata.blksize(),\n      blocks: metadata.blocks(),\n    },\n    #[cfg(windows)]\n    file_attributes: metadata.file_attributes(),\n  })\n}\n\n// #[command]\n// pub async fn exists(path: PathBuf) -> bool {\n//     path.exists()\n// }\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/gpt.rs",
    "content": "use crate::{\n  app::{fs_extra, window},\n  conf::GITHUB_PROMPTS_CSV_URL,\n  utils,\n};\nuse log::{error, info};\nuse regex::Regex;\nuse std::{collections::HashMap, fs, path::PathBuf, vec};\nuse tauri::{api, command, AppHandle, Manager};\nuse walkdir::WalkDir;\n\n#[command]\npub fn get_chat_model_cmd() -> serde_json::Value {\n  let path = utils::app_root().join(\"chat.model.cmd.json\");\n  let content = fs::read_to_string(path).unwrap_or_else(|_| r#\"{\"data\":[]}\"#.to_string());\n  serde_json::from_str(&content).unwrap()\n}\n\n#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]\npub struct PromptRecord {\n  pub cmd: Option<String>,\n  pub act: String,\n  pub prompt: String,\n}\n\n#[command]\npub fn parse_prompt(data: String) -> Vec<PromptRecord> {\n  let mut rdr = csv::Reader::from_reader(data.as_bytes());\n  let mut list = vec![];\n  for result in rdr.deserialize() {\n    let record: PromptRecord = result.unwrap_or_else(|err| {\n      error!(\"parse_prompt: {}\", err);\n      PromptRecord {\n        cmd: None,\n        act: \"\".to_string(),\n        prompt: \"\".to_string(),\n      }\n    });\n    if !record.act.is_empty() {\n      list.push(record);\n    }\n  }\n  list\n}\n\n#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]\npub struct ModelRecord {\n  pub cmd: String,\n  pub act: String,\n  pub prompt: String,\n  pub tags: Vec<String>,\n  pub enable: bool,\n}\n\n#[command]\npub fn cmd_list() -> Vec<ModelRecord> {\n  let mut list = vec![];\n  for entry in WalkDir::new(utils::app_root().join(\"cache_model\"))\n    .into_iter()\n    .filter_map(|e| e.ok())\n  {\n    let file = fs::read_to_string(entry.path().display().to_string());\n    if let Ok(v) = file {\n      let data: Vec<ModelRecord> = serde_json::from_str(&v).unwrap_or_else(|_| vec![]);\n      let enable_list = data.into_iter().filter(|v| v.enable);\n      list.extend(enable_list)\n    }\n  }\n  // dbg!(&list);\n  list.sort_by(|a, b| a.cmd.len().cmp(&b.cmd.len()));\n  list\n}\n\n#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]\npub struct FileMetadata {\n  pub name: String,\n  pub ext: String,\n  pub created: u64,\n  pub id: String,\n}\n\n#[tauri::command]\npub fn get_download_list(pathname: &str) -> (Vec<serde_json::Value>, PathBuf) {\n  info!(\"get_download_list: {}\", pathname);\n  let download_path = utils::app_root().join(PathBuf::from(pathname));\n  let content = fs::read_to_string(&download_path).unwrap_or_else(|err| {\n    error!(\"download_list: {}\", err);\n    fs::write(&download_path, \"[]\").unwrap();\n    \"[]\".to_string()\n  });\n  let list = serde_json::from_str::<Vec<serde_json::Value>>(&content).unwrap_or_else(|err| {\n    error!(\"download_list_parse: {}\", err);\n    vec![]\n  });\n\n  (list, download_path)\n}\n\n#[command]\npub fn download_list(pathname: &str, dir: &str, filename: Option<String>, id: Option<String>) {\n  info!(\"download_list: {}\", pathname);\n  let data = get_download_list(pathname);\n  let mut list = vec![];\n  let mut idmap = HashMap::new();\n  utils::vec_to_hashmap(data.0.into_iter(), \"id\", &mut idmap);\n\n  for entry in WalkDir::new(utils::app_root().join(dir))\n    .into_iter()\n    .filter_entry(|e| !utils::is_hidden(e))\n    .filter_map(|e| e.ok())\n  {\n    let metadata = entry.metadata().unwrap();\n    if metadata.is_file() {\n      let file_path = entry.path().display().to_string();\n      let re = Regex::new(r\"(?P<id>[\\d\\w]+).(?P<ext>\\w+)$\").unwrap();\n      let caps = re.captures(&file_path).unwrap();\n      let fid = &caps[\"id\"];\n      let fext = &caps[\"ext\"];\n\n      let mut file_data = FileMetadata {\n        name: fid.to_string(),\n        id: fid.to_string(),\n        ext: fext.to_string(),\n        created: fs_extra::system_time_to_ms(metadata.created()),\n      };\n\n      if idmap.get(fid).is_some() {\n        let name = idmap.get(fid).unwrap().get(\"name\").unwrap().clone();\n        match name {\n          serde_json::Value::String(v) => {\n            file_data.name = v.clone();\n            v\n          }\n          _ => \"\".to_string(),\n        };\n      }\n\n      if filename.is_some() && id.is_some() {\n        if let Some(ref v) = id {\n          if fid == v {\n            if let Some(ref v2) = filename {\n              file_data.name = v2.to_string();\n            }\n          }\n        }\n      }\n      list.push(serde_json::to_value(file_data).unwrap());\n    }\n  }\n\n  // dbg!(&list);\n  list.sort_by(|a, b| {\n    let a1 = a.get(\"created\").unwrap().as_u64().unwrap();\n    let b1 = b.get(\"created\").unwrap().as_u64().unwrap();\n    a1.cmp(&b1).reverse()\n  });\n\n  fs::write(data.1, serde_json::to_string_pretty(&list).unwrap()).unwrap();\n}\n\n#[command]\npub async fn sync_prompts(app: AppHandle, time: u64) -> Option<Vec<ModelRecord>> {\n  let res = utils::get_data(GITHUB_PROMPTS_CSV_URL, Some(&app))\n    .await\n    .unwrap();\n\n  if let Some(v) = res {\n    let data = parse_prompt(v)\n      .iter()\n      .map(move |i| ModelRecord {\n        cmd: if i.cmd.is_some() {\n          i.cmd.clone().unwrap()\n        } else {\n          utils::gen_cmd(i.act.clone())\n        },\n        act: i.act.clone(),\n        prompt: i.prompt.clone(),\n        tags: vec![\"chatgpt-prompts\".to_string()],\n        enable: true,\n      })\n      .collect::<Vec<ModelRecord>>();\n\n    let data2 = data.clone();\n\n    let model = utils::app_root().join(\"chat.model.json\");\n    let model_cmd = utils::app_root().join(\"chat.model.cmd.json\");\n    let chatgpt_prompts = utils::app_root()\n      .join(\"cache_model\")\n      .join(\"chatgpt_prompts.json\");\n\n    if !utils::exists(&model) {\n      fs::write(\n        &model,\n        serde_json::json!({\n          \"name\": \"ChatGPT Model\",\n          \"link\": \"https://github.com/lencx/ChatGPT\"\n        })\n        .to_string(),\n      )\n      .unwrap();\n    }\n\n    // chatgpt_prompts.json\n    fs::write(\n      chatgpt_prompts,\n      serde_json::to_string_pretty(&data).unwrap(),\n    )\n    .unwrap();\n    let cmd_data = cmd_list();\n\n    // chat.model.cmd.json\n    fs::write(\n      model_cmd,\n      serde_json::to_string_pretty(&serde_json::json!({\n        \"name\": \"ChatGPT CMD\",\n        \"last_updated\": time,\n        \"data\": cmd_data,\n      }))\n      .unwrap(),\n    )\n    .unwrap();\n    let mut kv = HashMap::new();\n    kv.insert(\n      \"sync_prompts\".to_string(),\n      serde_json::json!({ \"id\": \"chatgpt_prompts\", \"last_updated\": time }),\n    );\n    let model_data = utils::merge(\n      &serde_json::from_str(&fs::read_to_string(&model).unwrap()).unwrap(),\n      &kv,\n    );\n\n    // chat.model.json\n    fs::write(model, serde_json::to_string_pretty(&model_data).unwrap()).unwrap();\n\n    // refresh window\n    api::dialog::message(\n      app.get_window(\"core\").as_ref(),\n      \"Sync Prompts\",\n      \"ChatGPT Prompts data has been synchronized!\",\n    );\n    window::cmd::window_reload(app.clone(), \"core\");\n    window::cmd::window_reload(app, \"tray\");\n\n    return Some(data2);\n  }\n\n  None\n}\n\n#[command]\npub async fn sync_user_prompts(url: String, data_type: String) -> Option<Vec<ModelRecord>> {\n  info!(\"sync_user_prompts: url => {}\", url);\n  let res = utils::get_data(&url, None).await.unwrap_or_else(|err| {\n    error!(\"chatgpt_http: {}\", err);\n    None\n  });\n\n  if let Some(v) = res {\n    let data;\n    if data_type == \"csv\" {\n      info!(\"chatgpt_http_csv_parse\");\n      data = parse_prompt(v);\n    } else if data_type == \"json\" {\n      info!(\"chatgpt_http_json_parse\");\n      data = serde_json::from_str(&v).unwrap_or_else(|err| {\n        error!(\"chatgpt_http_json_parse: {}\", err);\n        vec![]\n      });\n    } else {\n      error!(\"chatgpt_http_unknown_type\");\n      data = vec![];\n    }\n\n    let data = data\n      .iter()\n      .map(move |i| ModelRecord {\n        cmd: if i.cmd.is_some() {\n          i.cmd.clone().unwrap()\n        } else {\n          utils::gen_cmd(i.act.clone())\n        },\n        act: i.act.clone(),\n        prompt: i.prompt.clone(),\n        tags: vec![\"user-sync\".to_string()],\n        enable: true,\n      })\n      .collect::<Vec<ModelRecord>>();\n\n    return Some(data);\n  }\n\n  None\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/menu.rs",
    "content": "use crate::{\n  app::window,\n  conf::{self, AppConf},\n  utils,\n};\nuse tauri::{\n  AppHandle, CustomMenuItem, Manager, Menu, MenuItem, Submenu, SystemTray, SystemTrayEvent,\n  SystemTrayMenu, SystemTrayMenuItem, WindowMenuEvent,\n};\nuse tauri_plugin_positioner::{on_tray_event, Position, WindowExt};\n\n#[cfg(target_os = \"macos\")]\nuse tauri::AboutMetadata;\n\n// --- Menu\npub fn init() -> Menu {\n  let app_conf = AppConf::read();\n  let name = \"ChatGPT\";\n  let app_menu = Submenu::new(\n    name,\n    Menu::with_items([\n      #[cfg(target_os = \"macos\")]\n      MenuItem::About(name.into(), AboutMetadata::default()).into(),\n      #[cfg(not(target_os = \"macos\"))]\n      CustomMenuItem::new(\"about\".to_string(), \"About ChatGPT\").into(),\n      CustomMenuItem::new(\"check_update\".to_string(), \"Check for Updates\").into(),\n      MenuItem::Services.into(),\n      MenuItem::Hide.into(),\n      MenuItem::HideOthers.into(),\n      MenuItem::ShowAll.into(),\n      MenuItem::Separator.into(),\n      MenuItem::Quit.into(),\n    ]),\n  );\n\n  let stay_on_top =\n    CustomMenuItem::new(\"stay_on_top\".to_string(), \"Stay On Top\").accelerator(\"CmdOrCtrl+T\");\n  let stay_on_top_menu = if app_conf.stay_on_top {\n    stay_on_top.selected()\n  } else {\n    stay_on_top\n  };\n\n  let theme_light = CustomMenuItem::new(\"theme_light\".to_string(), \"Light\");\n  let theme_dark = CustomMenuItem::new(\"theme_dark\".to_string(), \"Dark\");\n  let theme_system = CustomMenuItem::new(\"theme_system\".to_string(), \"System\");\n  let is_dark = app_conf.clone().theme_check(\"dark\");\n  let is_system = app_conf.clone().theme_check(\"system\");\n\n  let update_prompt = CustomMenuItem::new(\"update_prompt\".to_string(), \"Prompt\");\n  let update_silent = CustomMenuItem::new(\"update_silent\".to_string(), \"Silent\");\n  // let _update_disable = CustomMenuItem::new(\"update_disable\".to_string(), \"Disable\");\n\n  let popup_search = CustomMenuItem::new(\"popup_search\".to_string(), \"Pop-up Search\");\n  let popup_search_menu = if app_conf.popup_search {\n    popup_search.selected()\n  } else {\n    popup_search\n  };\n\n  #[cfg(target_os = \"macos\")]\n  let titlebar = CustomMenuItem::new(\"titlebar\".to_string(), \"Titlebar\").accelerator(\"CmdOrCtrl+B\");\n  #[cfg(target_os = \"macos\")]\n  let titlebar_menu = if app_conf.titlebar {\n    titlebar.selected()\n  } else {\n    titlebar\n  };\n\n  let system_tray = CustomMenuItem::new(\"system_tray\".to_string(), \"System Tray\");\n  let system_tray_menu = if app_conf.tray {\n    system_tray.selected()\n  } else {\n    system_tray\n  };\n\n  let auto_update = app_conf.get_auto_update();\n  let preferences_menu = Submenu::new(\n    \"Preferences\",\n    Menu::with_items([\n      CustomMenuItem::new(\"control_center\".to_string(), \"Control Center\")\n        .accelerator(\"CmdOrCtrl+Shift+P\")\n        .into(),\n      MenuItem::Separator.into(),\n      stay_on_top_menu.into(),\n      #[cfg(target_os = \"macos\")]\n      titlebar_menu.into(),\n      #[cfg(target_os = \"macos\")]\n      CustomMenuItem::new(\"hide_dock_icon\".to_string(), \"Hide Dock Icon\").into(),\n      system_tray_menu.into(),\n      CustomMenuItem::new(\"inject_script\".to_string(), \"Inject Script\")\n        .accelerator(\"CmdOrCtrl+J\")\n        .into(),\n      MenuItem::Separator.into(),\n      Submenu::new(\n        \"Theme\",\n        Menu::new()\n          .add_item(if is_dark || is_system {\n            theme_light\n          } else {\n            theme_light.selected()\n          })\n          .add_item(if is_dark {\n            theme_dark.selected()\n          } else {\n            theme_dark\n          })\n          .add_item(if is_system {\n            theme_system.selected()\n          } else {\n            theme_system\n          }),\n      )\n      .into(),\n      Submenu::new(\n        \"Auto Update\",\n        Menu::new()\n          .add_item(if auto_update == \"prompt\" {\n            update_prompt.selected()\n          } else {\n            update_prompt\n          })\n          .add_item(if auto_update == \"silent\" {\n            update_silent.selected()\n          } else {\n            update_silent\n          }), // .add_item(if auto_update == \"disable\" {\n              //     update_disable.selected()\n              // } else {\n              //     update_disable\n              // })\n      )\n      .into(),\n      MenuItem::Separator.into(),\n      popup_search_menu.into(),\n      CustomMenuItem::new(\"sync_prompts\".to_string(), \"Sync Prompts\").into(),\n      MenuItem::Separator.into(),\n      CustomMenuItem::new(\"go_conf\".to_string(), \"Go to Config\")\n        .accelerator(\"CmdOrCtrl+Shift+G\")\n        .into(),\n      CustomMenuItem::new(\"restart\".to_string(), \"Restart ChatGPT\")\n        .accelerator(\"CmdOrCtrl+Shift+R\")\n        .into(),\n      CustomMenuItem::new(\"clear_conf\".to_string(), \"Clear Config\").into(),\n      MenuItem::Separator.into(),\n      CustomMenuItem::new(\"nofwl\".to_string(), \"NoFWL Desktop Application\").into(),\n      CustomMenuItem::new(\"buy_coffee\".to_string(), \"Buy lencx a coffee\").into(),\n    ]),\n  );\n\n  let edit_menu = Submenu::new(\n    \"Edit\",\n    Menu::new()\n      .add_native_item(MenuItem::Undo)\n      .add_native_item(MenuItem::Redo)\n      .add_native_item(MenuItem::Separator)\n      .add_native_item(MenuItem::Cut)\n      .add_native_item(MenuItem::Copy)\n      .add_native_item(MenuItem::Paste)\n      .add_native_item(MenuItem::SelectAll),\n  );\n\n  let view_menu = Submenu::new(\n    \"View\",\n    Menu::new()\n      .add_item(CustomMenuItem::new(\"go_back\".to_string(), \"Go Back\").accelerator(\"CmdOrCtrl+[\"))\n      .add_item(\n        CustomMenuItem::new(\"go_forward\".to_string(), \"Go Forward\").accelerator(\"CmdOrCtrl+]\"),\n      )\n      .add_item(\n        CustomMenuItem::new(\"scroll_top\".to_string(), \"Scroll to Top of Screen\")\n          .accelerator(\"CmdOrCtrl+Up\"),\n      )\n      .add_item(\n        CustomMenuItem::new(\"scroll_bottom\".to_string(), \"Scroll to Bottom of Screen\")\n          .accelerator(\"CmdOrCtrl+Down\"),\n      )\n      .add_native_item(MenuItem::Separator)\n      .add_item(\n        CustomMenuItem::new(\"zoom_0\".to_string(), \"Zoom to Actual Size\").accelerator(\"CmdOrCtrl+0\"),\n      )\n      .add_item(CustomMenuItem::new(\"zoom_out\".to_string(), \"Zoom Out\").accelerator(\"CmdOrCtrl+-\"))\n      .add_item(CustomMenuItem::new(\"zoom_in\".to_string(), \"Zoom In\").accelerator(\"CmdOrCtrl+Plus\"))\n      .add_native_item(MenuItem::Separator)\n      .add_item(\n        CustomMenuItem::new(\"reload\".to_string(), \"Refresh the Screen\").accelerator(\"CmdOrCtrl+R\"),\n      ),\n  );\n\n  let window_menu = Submenu::new(\n    \"Window\",\n    Menu::new()\n      .add_item(CustomMenuItem::new(\n        \"app_website\".to_string(),\n        \"ChatGPT User's Guide\",\n      ))\n      .add_item(CustomMenuItem::new(\"dalle2\".to_string(), \"DALL·E 2\"))\n      .add_native_item(MenuItem::Separator)\n      .add_native_item(MenuItem::Minimize)\n      .add_native_item(MenuItem::Zoom),\n  );\n\n  let help_menu = Submenu::new(\n    \"Help\",\n    Menu::new()\n      .add_item(CustomMenuItem::new(\n        \"chatgpt_log\".to_string(),\n        \"ChatGPT Log\",\n      ))\n      .add_item(CustomMenuItem::new(\"update_log\".to_string(), \"Update Log\"))\n      .add_item(CustomMenuItem::new(\"report_bug\".to_string(), \"Report Bug\"))\n      .add_item(\n        CustomMenuItem::new(\"dev_tools\".to_string(), \"Toggle Developer Tools\")\n          .accelerator(\"CmdOrCtrl+Shift+I\"),\n      ),\n  );\n\n  let words_menu = Submenu::new(\n    \"Words\",\n    Menu::new()\n      .add_item(CustomMenuItem::new(\"add to new words\".to_string(),\"add to new words\"))\n      .add_item(CustomMenuItem::new(\"mark it as known\".to_string(),\"mark it as known\"))\n  );\n\n  Menu::new()\n    .add_submenu(app_menu)\n    .add_submenu(preferences_menu)\n    .add_submenu(window_menu)\n    .add_submenu(edit_menu)\n    .add_submenu(view_menu)\n    .add_submenu(help_menu)\n    .add_submenu(words_menu)\n}\n\n// --- Menu Event\npub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {\n  let win = Some(event.window()).unwrap();\n  let app = win.app_handle();\n  let script_path = utils::script_path().to_string_lossy().to_string();\n  let menu_id = event.menu_item_id();\n  let menu_handle = win.menu_handle();\n\n  match menu_id {\n    // App\n    \"about\" => {\n      let tauri_conf = utils::get_tauri_conf().unwrap();\n      tauri::api::dialog::message(\n        app.get_window(\"core\").as_ref(),\n        \"ChatGPT\",\n        format!(\"Version {}\", tauri_conf.package.version.unwrap()),\n      );\n    }\n    \"check_update\" => {\n      utils::run_check_update(app, false, None);\n    }\n    // Preferences\n    \"control_center\" => window::cmd::control_window(app),\n    \"restart\" => tauri::api::process::restart(&app.env()),\n    \"inject_script\" => open(&app, script_path),\n    \"go_conf\" => utils::open_file(utils::app_root()),\n    \"clear_conf\" => utils::clear_conf(&app),\n    \"app_website\" => window::cmd::wa_window(\n      app,\n      \"app_website\".into(),\n      \"ChatGPT User's Guide\".into(),\n      conf::APP_WEBSITE.into(),\n      None,\n    ),\n    \"nofwl\" => open(&app, conf::NOFWL_APP.to_string()),\n    \"buy_coffee\" => open(&app, conf::BUY_COFFEE.to_string()),\n    \"popup_search\" => {\n      let app_conf = AppConf::read();\n      let popup_search = !app_conf.popup_search;\n      menu_handle\n        .get_item(menu_id)\n        .set_selected(popup_search)\n        .unwrap();\n      app_conf\n        .amend(serde_json::json!({ \"popup_search\": popup_search }))\n        .write();\n      window::cmd::window_reload(app.clone(), \"core\");\n      window::cmd::window_reload(app, \"tray\");\n    }\n    \"sync_prompts\" => {\n      tauri::api::dialog::ask(\n        app.get_window(\"core\").as_ref(),\n        \"Sync Prompts\",\n        \"Data sync will enable all prompts, are you sure you want to sync?\",\n        move |is_restart| {\n          if is_restart {\n            app\n              .get_window(\"core\")\n              .unwrap()\n              .eval(\"window.__sync_prompts && window.__sync_prompts()\")\n              .unwrap()\n          }\n        },\n      );\n    }\n    \"hide_dock_icon\" => {\n      AppConf::read()\n        .amend(serde_json::json!({ \"hide_dock_icon\": true }))\n        .write()\n        .restart(app);\n    }\n    \"titlebar\" => {\n      let app_conf = AppConf::read();\n      app_conf\n        .clone()\n        .amend(serde_json::json!({ \"titlebar\": !app_conf.titlebar }))\n        .write()\n        .restart(app);\n    }\n    \"system_tray\" => {\n      let app_conf = AppConf::read();\n      app_conf\n        .clone()\n        .amend(serde_json::json!({ \"tray\": !app_conf.tray }))\n        .write()\n        .restart(app);\n    }\n    \"theme_light\" | \"theme_dark\" | \"theme_system\" => {\n      let theme = match menu_id {\n        \"theme_dark\" => \"dark\",\n        \"theme_system\" => \"system\",\n        _ => \"light\",\n      };\n      AppConf::read()\n        .amend(serde_json::json!({ \"theme\": theme }))\n        .write()\n        .restart(app);\n    }\n    \"update_prompt\" | \"update_silent\" | \"update_disable\" => {\n      // for id in [\"update_prompt\", \"update_silent\", \"update_disable\"] {\n      for id in [\"update_prompt\", \"update_silent\"] {\n        menu_handle.get_item(id).set_selected(false).unwrap();\n      }\n      let auto_update = match menu_id {\n        \"update_silent\" => {\n          menu_handle\n            .get_item(\"update_silent\")\n            .set_selected(true)\n            .unwrap();\n          \"silent\"\n        }\n        \"update_disable\" => {\n          menu_handle\n            .get_item(\"update_disable\")\n            .set_selected(true)\n            .unwrap();\n          \"disable\"\n        }\n        _ => {\n          menu_handle\n            .get_item(\"update_prompt\")\n            .set_selected(true)\n            .unwrap();\n          \"prompt\"\n        }\n      };\n      AppConf::read()\n        .amend(serde_json::json!({ \"auto_update\": auto_update }))\n        .write();\n    }\n    \"stay_on_top\" => {\n      let app_conf = AppConf::read();\n      let stay_on_top = !app_conf.stay_on_top;\n      menu_handle\n        .get_item(menu_id)\n        .set_selected(stay_on_top)\n        .unwrap();\n      win.set_always_on_top(stay_on_top).unwrap();\n      app_conf\n        .amend(serde_json::json!({ \"stay_on_top\": stay_on_top }))\n        .write();\n    }\n    // Window\n    \"dalle2\" => window::dalle2_window(&app, None, None, Some(false)),\n    // View\n    \"zoom_0\" => win.eval(\"window.__zoom0 && window.__zoom0()\").unwrap(),\n    \"zoom_out\" => win.eval(\"window.__zoomOut && window.__zoomOut()\").unwrap(),\n    \"zoom_in\" => win.eval(\"window.__zoomIn && window.__zoomIn()\").unwrap(),\n    \"reload\" => win.eval(\"window.location.reload()\").unwrap(),\n    \"go_back\" => win.eval(\"window.history.go(-1)\").unwrap(),\n    \"go_forward\" => win.eval(\"window.history.go(1)\").unwrap(),\n    \"scroll_top\" => win\n      .eval(\n        r#\"window.scroll({\n          top: 0,\n          left: 0,\n          behavior: \"smooth\"\n          })\"#,\n      )\n      .unwrap(),\n    \"scroll_bottom\" => win\n      .eval(\n        r#\"window.scroll({\n          top: document.body.scrollHeight,\n          left: 0,\n          behavior: \"smooth\"})\"#,\n      )\n      .unwrap(),\n    // Help\n    \"chatgpt_log\" => utils::open_file(utils::app_root().join(\"chatgpt.log\")),\n    \"update_log\" => open(&app, conf::UPDATE_LOG_URL.to_string()),\n    \"report_bug\" => open(&app, conf::ISSUES_URL.to_string()),\n    \"dev_tools\" => {\n      win.open_devtools();\n      win.close_devtools();\n    }\n    \"add to new words\" => win.eval(\"window.__helper && window.__helper('add')\").unwrap(),\n    \"mark it as known\" => win.eval(\"window.__helper && window.__helper('remove')\").unwrap(),\n    _ => (),\n  }\n}\n\n// --- SystemTray Menu\npub fn tray_menu() -> SystemTray {\n  if cfg!(target_os = \"macos\") {\n    let mut tray_menu = SystemTrayMenu::new()\n      .add_item(CustomMenuItem::new(\n        \"control_center\".to_string(),\n        \"Control Center\",\n      ))\n      .add_native_item(SystemTrayMenuItem::Separator);\n\n    if AppConf::read().hide_dock_icon {\n      tray_menu = tray_menu.add_item(CustomMenuItem::new(\n        \"show_dock_icon\".to_string(),\n        \"Show Dock Icon\",\n      ));\n    } else {\n      tray_menu = tray_menu\n        .add_item(CustomMenuItem::new(\n          \"hide_dock_icon\".to_string(),\n          \"Hide Dock Icon\",\n        ))\n        .add_item(CustomMenuItem::new(\"show_core\".to_string(), \"Show Window\"));\n    }\n\n    SystemTray::new().with_menu(\n      tray_menu\n        .add_native_item(SystemTrayMenuItem::Separator)\n        .add_item(CustomMenuItem::new(\"quit\".to_string(), \"Quit\")),\n    )\n  } else {\n    SystemTray::new().with_menu(\n      SystemTrayMenu::new()\n        .add_item(CustomMenuItem::new(\n          \"control_center\".to_string(),\n          \"Control Center\",\n        ))\n        .add_item(CustomMenuItem::new(\"show_core\".to_string(), \"Show Window\"))\n        .add_native_item(SystemTrayMenuItem::Separator)\n        .add_item(CustomMenuItem::new(\"quit\".to_string(), \"Quit\")),\n    )\n  }\n}\n\n// --- SystemTray Event\npub fn tray_handler(handle: &AppHandle, event: SystemTrayEvent) {\n  on_tray_event(handle, &event);\n\n  let app = handle.clone();\n\n  match event {\n    SystemTrayEvent::LeftClick { .. } => {\n      let app_conf = AppConf::read();\n\n      if !app_conf.hide_dock_icon {\n        if let Some(core_win) = handle.get_window(\"core\") {\n          core_win.minimize().unwrap();\n        }\n      }\n\n      if let Some(tray_win) = handle.get_window(\"tray\") {\n        tray_win.move_window(Position::TrayCenter).unwrap();\n\n        if tray_win.is_visible().unwrap() {\n          tray_win.hide().unwrap();\n        } else {\n          tray_win.show().unwrap();\n        }\n      }\n    }\n    SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {\n      \"control_center\" => window::cmd::control_window(app),\n      \"restart\" => tauri::api::process::restart(&handle.env()),\n      \"show_dock_icon\" => {\n        AppConf::read()\n          .amend(serde_json::json!({ \"hide_dock_icon\": false }))\n          .write()\n          .restart(app);\n      }\n      \"hide_dock_icon\" => {\n        let app_conf = AppConf::read();\n        if !app_conf.hide_dock_icon {\n          app_conf\n            .amend(serde_json::json!({ \"hide_dock_icon\": true }))\n            .write()\n            .restart(app);\n        }\n      }\n      \"show_core\" => {\n        if let Some(core_win) = app.get_window(\"core\") {\n          let tray_win = app.get_window(\"tray\").unwrap();\n          if !core_win.is_visible().unwrap() {\n            core_win.show().unwrap();\n            core_win.set_focus().unwrap();\n            tray_win.hide().unwrap();\n          }\n        };\n      }\n      \"quit\" => std::process::exit(0),\n      _ => (),\n    },\n    _ => (),\n  }\n}\n\npub fn open(app: &AppHandle, path: String) {\n  tauri::api::shell::open(&app.shell_scope(), path, None).unwrap();\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/mod.rs",
    "content": "pub mod cmd;\npub mod fs_extra;\npub mod gpt;\npub mod menu;\npub mod setup;\npub mod window;\npub mod cors;\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/setup.rs",
    "content": "use crate::{app::window, conf::AppConf, utils};\nuse log::{error, info};\nuse tauri::{utils::config::WindowUrl, window::WindowBuilder, App, GlobalShortcutManager, Manager};\nuse wry::application::accelerator::Accelerator;\n\npub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {\n  info!(\"stepup\");\n  let app_conf = AppConf::read();\n  let url = app_conf.main_origin.to_string();\n  let theme = AppConf::theme_mode();\n  let handle = app.app_handle();\n\n  tauri::async_runtime::spawn(async move {\n    info!(\"stepup_tray\");\n    window::tray_window(&handle);\n  });\n\n  if let Some(v) = app_conf.clone().global_shortcut {\n    info!(\"global_shortcut: `{}`\", v);\n    match v.parse::<Accelerator>() {\n      Ok(_) => {\n        info!(\"global_shortcut_register\");\n        let handle = app.app_handle();\n        let mut shortcut = app.global_shortcut_manager();\n        shortcut\n          .register(&v, move || {\n            if let Some(w) = handle.get_window(\"core\") {\n              if w.is_visible().unwrap() {\n                w.hide().unwrap();\n              } else {\n                w.show().unwrap();\n                w.set_focus().unwrap();\n              }\n            }\n          })\n          .unwrap_or_else(|err| {\n            error!(\"global_shortcut_register_error: {}\", err);\n          });\n      }\n      Err(err) => {\n        error!(\"global_shortcut_parse_error: {}\", err);\n      }\n    }\n  } else {\n    info!(\"global_shortcut_unregister\");\n  };\n\n  let app_conf2 = app_conf.clone();\n  if app_conf.hide_dock_icon {\n    #[cfg(target_os = \"macos\")]\n    app.set_activation_policy(tauri::ActivationPolicy::Accessory);\n  } else {\n    let app = app.handle();\n    tauri::async_runtime::spawn(async move {\n      let link = if app_conf2.main_dashboard {\n        \"index.html\"\n      } else {\n        &url\n      };\n      info!(\"main_window: {}\", link);\n      let mut main_win = WindowBuilder::new(&app, \"core\", WindowUrl::App(link.into()))\n        .title(\"ChatGPT\")\n        .resizable(true)\n        .fullscreen(false)\n        .inner_size(app_conf2.main_width, app_conf2.main_height)\n        .theme(Some(theme))\n        .always_on_top(app_conf2.stay_on_top)\n        .initialization_script(&utils::user_script())\n        .initialization_script(include_str!(\"../scripts/core.js\"))\n        .user_agent(&app_conf2.ua_window);\n\n      #[cfg(target_os = \"macos\")]\n      {\n        main_win = main_win\n          .title_bar_style(app_conf2.clone().titlebar())\n          .hidden_title(true);\n      }\n\n      if url == \"https://chat.openai.com\" && !app_conf2.main_dashboard {\n        main_win = main_win\n          .initialization_script(include_str!(\"../vendors/floating-ui-core.js\"))\n          .initialization_script(include_str!(\"../vendors/floating-ui-dom.js\"))\n          .initialization_script(include_str!(\"../vendors/html2canvas.js\"))\n          .initialization_script(include_str!(\"../vendors/jspdf.js\"))\n          .initialization_script(include_str!(\"../vendors/turndown.js\"))\n          .initialization_script(include_str!(\"../vendors/turndown-plugin-gfm.js\"))\n          .initialization_script(include_str!(\"../scripts/popup.core.js\"))\n          .initialization_script(include_str!(\"../scripts/export.js\"))\n          .initialization_script(include_str!(\"../scripts/markdown.export.js\"))\n          .initialization_script(include_str!(\"../scripts/cmd.js\"))\n          .initialization_script(include_str!(\"../scripts/chat.js\"))\n      }\n\n      main_win.build().unwrap();\n    });\n  }\n\n  // auto_update\n  let auto_update = app_conf.get_auto_update();\n  if auto_update != \"disable\" {\n    info!(\"run_check_update\");\n    let app = app.handle();\n    utils::run_check_update(app, auto_update == \"silent\", None);\n  }\n\n  Ok(())\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/app/window.rs",
    "content": "use crate::{conf::AppConf, utils};\nuse log::info;\nuse std::time::SystemTime;\nuse tauri::{utils::config::WindowUrl, window::WindowBuilder, Manager};\n\npub fn tray_window(handle: &tauri::AppHandle) {\n  let app_conf = AppConf::read();\n  let theme = AppConf::theme_mode();\n  let app = handle.clone();\n\n  tauri::async_runtime::spawn(async move {\n    let link = if app_conf.tray_dashboard {\n      \"index.html\"\n    } else {\n      &app_conf.tray_origin\n    };\n    let mut tray_win = WindowBuilder::new(&app, \"tray\", WindowUrl::App(link.into()))\n      .title(\"ChatGPT\")\n      .resizable(false)\n      .fullscreen(false)\n      .inner_size(app_conf.tray_width, app_conf.tray_height)\n      .decorations(false)\n      .always_on_top(true)\n      .theme(Some(theme))\n      .initialization_script(&utils::user_script())\n      .initialization_script(include_str!(\"../scripts/core.js\"))\n      .user_agent(&app_conf.ua_tray);\n\n    if app_conf.tray_origin == \"https://chat.openai.com\" && !app_conf.tray_dashboard {\n      tray_win = tray_win\n        .initialization_script(include_str!(\"../vendors/floating-ui-core.js\"))\n        .initialization_script(include_str!(\"../vendors/floating-ui-dom.js\"))\n        .initialization_script(include_str!(\"../scripts/cmd.js\"))\n        .initialization_script(include_str!(\"../scripts/chat.js\"))\n        .initialization_script(include_str!(\"../scripts/popup.core.js\"))\n    }\n\n    tray_win.build().unwrap().hide().unwrap();\n  });\n}\n\npub fn dalle2_window(\n  handle: &tauri::AppHandle,\n  query: Option<String>,\n  title: Option<String>,\n  is_new: Option<bool>,\n) {\n  info!(\"dalle2_query: {:?}\", query);\n  let theme = AppConf::theme_mode();\n  let app = handle.clone();\n\n  let query = if query.is_some() {\n    format!(\"window.addEventListener('DOMContentLoaded', function() {{\\nwindow.__CHATGPT_QUERY__='{}';\\n}})\", query.unwrap())\n  } else {\n    \"\".to_string()\n  };\n\n  let label = if is_new.unwrap_or(true) {\n    let timestamp = SystemTime::now()\n      .duration_since(SystemTime::UNIX_EPOCH)\n      .unwrap()\n      .as_secs();\n    format!(\"dalle2_{}\", timestamp)\n  } else {\n    \"dalle2\".to_string()\n  };\n\n  if app.get_window(\"dalle2\").is_none() {\n    tauri::async_runtime::spawn(async move {\n      WindowBuilder::new(\n        &app,\n        label,\n        WindowUrl::App(\"https://labs.openai.com\".into()),\n      )\n      .title(title.unwrap_or_else(|| \"DALL·E 2\".to_string()))\n      .resizable(true)\n      .fullscreen(false)\n      .inner_size(800.0, 600.0)\n      .always_on_top(false)\n      .theme(Some(theme))\n      .initialization_script(include_str!(\"../scripts/core.js\"))\n      .initialization_script(&query)\n      .initialization_script(include_str!(\"../scripts/dalle2.js\"))\n      .build()\n      .unwrap();\n    });\n  } else {\n    let dalle2_win = app.get_window(\"dalle2\").unwrap();\n    dalle2_win.show().unwrap();\n    dalle2_win.set_focus().unwrap();\n  }\n}\n\npub mod cmd {\n  use super::*;\n  use log::info;\n  use tauri::{command, utils::config::WindowUrl, window::WindowBuilder, Manager};\n\n  #[tauri::command]\n  pub fn dalle2_search_window(app: tauri::AppHandle, query: String) {\n    dalle2_window(\n      &app.app_handle(),\n      Some(query),\n      Some(\"ChatGPT & DALL·E 2\".to_string()),\n      None,\n    );\n  }\n\n  #[tauri::command]\n  pub fn control_window(handle: tauri::AppHandle) {\n    tauri::async_runtime::spawn(async move {\n      if handle.get_window(\"main\").is_none() {\n        WindowBuilder::new(\n          &handle,\n          \"main\",\n          WindowUrl::App(\"index.html?type=control\".into()),\n        )\n        .title(\"Control Center\")\n        .resizable(true)\n        .fullscreen(false)\n        .inner_size(1200.0, 700.0)\n        .min_inner_size(1000.0, 600.0)\n        .build()\n        .unwrap();\n      } else {\n        let main_win = handle.get_window(\"main\").unwrap();\n        main_win.show().unwrap();\n        main_win.set_focus().unwrap();\n      }\n    });\n  }\n\n  #[command]\n  pub fn wa_window(\n    app: tauri::AppHandle,\n    label: String,\n    title: String,\n    url: String,\n    script: Option<String>,\n  ) {\n    info!(\"wa_window: {} :=> {}\", title, url);\n    let win = app.get_window(&label);\n    if win.is_none() {\n      tauri::async_runtime::spawn(async move {\n        tauri::WindowBuilder::new(&app, label, tauri::WindowUrl::App(url.parse().unwrap()))\n          .initialization_script(&script.unwrap_or_default())\n          .initialization_script(include_str!(\"../scripts/core.js\"))\n          .title(title)\n          .inner_size(960.0, 700.0)\n          .resizable(true)\n          .build()\n          .unwrap();\n      });\n    } else if let Some(v) = win {\n      if !v.is_visible().unwrap() {\n        v.show().unwrap();\n      }\n      v.eval(\"window.location.reload()\").unwrap();\n      v.set_focus().unwrap();\n    }\n  }\n\n  #[command]\n  pub fn window_reload(app: tauri::AppHandle, label: &str) {\n    app\n      .app_handle()\n      .get_window(label)\n      .unwrap()\n      .eval(\"window.location.reload()\")\n      .unwrap();\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/conf.rs",
    "content": "use log::{error, info};\nuse serde_json::Value;\nuse std::{collections::BTreeMap, path::PathBuf};\nuse tauri::{Manager, Theme};\n\n#[cfg(target_os = \"macos\")]\nuse tauri::TitleBarStyle;\n\nuse crate::utils::{app_root, create_file, exists};\n\npub const APP_WEBSITE: &str = \"https://lencx.github.io/app/\";\npub const ISSUES_URL: &str = \"https://github.com/lencx/ChatGPT/issues\";\npub const NOFWL_APP: &str = \"https://github.com/lencx/nofwl\";\npub const UPDATE_LOG_URL: &str = \"https://github.com/lencx/ChatGPT/blob/main/UPDATE_LOG.md\";\npub const BUY_COFFEE: &str = \"https://www.buymeacoffee.com/lencx\";\npub const GITHUB_PROMPTS_CSV_URL: &str =\n  \"https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv\";\n\npub const APP_CONF_PATH: &str = \"chat.conf.json\";\npub const CHATGPT_URL: &str = \"https://chat.openai.com\";\npub const UA_MOBILE: &str = \"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1\";\n\nmacro_rules! pub_struct {\n  ($name:ident {$($field:ident: $t:ty,)*}) => {\n    #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]\n    pub struct $name {\n      $(pub $field: $t),*\n    }\n  }\n}\n\npub_struct!(AppConf {\n  titlebar: bool,\n  hide_dock_icon: bool,\n  // macOS and Windows: light / dark / system\n  theme: String,\n  // auto update policy: prompt / silent / disable\n  auto_update: String,\n  stay_on_top: bool,\n  save_window_state: bool,\n  global_shortcut: Option<String>,\n  default_origin: String,\n\n  processor : String,         // gpu ,cpu\n  subprocess_number: String,  // 1,2,3\n  talk_mode : bool,\n  speech_lang: String,       // for web speech api\n  speech_ai_lang: String,     // for open source ai speech model\n  speech_azure_lang: String,  // for azure speech api\n  speech_type: String,       // web, ai, azure, ... need to define the related variable\n\n  rec_lang: String,          // for web recognition api\n  rec_ai_lang: String,       // for open source ai recognition api\n  rec_iflytek_lang: String,   // for Iflytek recognition api\n  rec_type: String,           // web, ai, Iflytek, ...\n\n  assess_type: String,        //iflytek, speechsuper\n\n  iflytek_rec_appid: String,\n  iflytek_rec_apikey: String,\n  iflytek_assess_appid: String,\n  iflytek_assess_appsecret: String,\n  iflytek_assess_apikey: String,\n  ss_assess_appkey: String,\n  ss_assess_secretkey: String,\n  // Main Window\n  isinit: bool,\n  popup_search: bool,\n  main_close: bool,\n  main_dashboard: bool,\n  main_origin: String,\n  ua_window: String,\n  main_width: f64,\n  main_height: f64,\n\n  // Tray Window\n  tray_width: f64,\n  tray_height: f64,\n  tray: bool,\n  tray_dashboard: bool,\n  tray_origin: String,\n  ua_tray: String,\n});\n\nimpl AppConf {\n  pub fn new() -> Self {\n    info!(\"conf_init\");\n    Self {\n      titlebar: !cfg!(target_os = \"macos\"),\n      hide_dock_icon: false,\n      save_window_state: false,\n      theme: \"light\".into(),\n      auto_update: \"prompt\".into(),\n      #[cfg(target_os = \"macos\")]\n      speech_lang: \"com.apple.eloquence.en-US.Rocko\".into(),\n      #[cfg(not(target_os = \"macos\"))]\n      speech_lang: \"\".into(),\n      processor : \"cpu\".into(),         // gpu ,cpu\n      subprocess_number: \"3\".into(),    // 1,2,3\n      talk_mode: true,\n      speech_ai_lang: \"accent_per_sentence\".into(),\n      speech_azure_lang: \"\".into(),\n      speech_type: \"web\".into(),\n      rec_lang: \"en-US\".into(),\n      rec_ai_lang: \"\".into(),\n      rec_iflytek_lang: \"en\".into(),\n      rec_type: \"web\".into(),  // web ai iflytek\n      assess_type: \"speechsuper\".into(), // speechsuper,iflytek\n      iflytek_rec_appid: \"\".into(),\n      iflytek_rec_apikey: \"\".into(),\n      iflytek_assess_appid: \"\".into(),\n      iflytek_assess_appsecret: \"\".into(),\n      iflytek_assess_apikey: \"\".into(),\n      ss_assess_appkey: \"\".into(),\n      ss_assess_secretkey: \"\".into(),\n      tray: false,\n      popup_search: false,\n      isinit: true,\n      main_close: false,\n      stay_on_top: false,\n      main_dashboard: false,\n      tray_dashboard: false,\n      main_width: 800.0,\n      main_height: 600.0,\n      tray_width: 360.0,\n      tray_height: 540.0,\n      main_origin: CHATGPT_URL.into(),\n      tray_origin: CHATGPT_URL.into(),\n      default_origin: CHATGPT_URL.into(),\n      ua_tray: UA_MOBILE.into(),\n      ua_window: \"\".into(),\n      global_shortcut: None,\n    }\n  }\n\n  pub fn file_path() -> PathBuf {\n    app_root().join(APP_CONF_PATH)\n  }\n\n  pub fn read() -> Self {\n    match std::fs::read_to_string(Self::file_path()) {\n      Ok(v) => {\n        if let Ok(v2) = serde_json::from_str::<AppConf>(&v) {\n          v2\n        } else {\n          error!(\"conf_read_parse_error\");\n          Self::default()\n        }\n      }\n      Err(err) => {\n        error!(\"conf_read_error: {}\", err);\n        Self::default()\n      }\n    }\n  }\n\n  pub fn write(self) -> Self {\n    let path = &Self::file_path();\n    if !exists(path) {\n      create_file(path).unwrap();\n      info!(\"conf_create\");\n    }\n    if let Ok(v) = serde_json::to_string_pretty(&self) {\n      std::fs::write(path, v).unwrap_or_else(|err| {\n        error!(\"conf_write: {}\", err);\n        Self::default().write();\n      });\n    } else {\n      error!(\"conf_ser\");\n    }\n    self\n  }\n\n  pub fn amend(self, json: Value) -> Self {\n    let val = serde_json::to_value(&self).unwrap();\n    let mut config: BTreeMap<String, Value> = serde_json::from_value(val).unwrap();\n    let new_json: BTreeMap<String, Value> = serde_json::from_value(json).unwrap();\n\n    for (k, v) in new_json {\n      config.insert(k, v);\n    }\n\n    match serde_json::to_string_pretty(&config) {\n      Ok(v) => match serde_json::from_str::<AppConf>(&v) {\n        Ok(v) => v,\n        Err(err) => {\n          error!(\"conf_amend_parse: {}\", err);\n          self\n        }\n      },\n      Err(err) => {\n        error!(\"conf_amend_str: {}\", err);\n        self\n      }\n    }\n  }\n\n  #[cfg(target_os = \"macos\")]\n  pub fn titlebar(self) -> TitleBarStyle {\n    if self.titlebar {\n      TitleBarStyle::Transparent\n    } else {\n      TitleBarStyle::Overlay\n    }\n  }\n\n  pub fn theme_mode() -> Theme {\n    match Self::get_theme().as_str() {\n      \"system\" => match dark_light::detect() {\n        // Dark mode\n        dark_light::Mode::Dark => Theme::Dark,\n        // Light mode\n        dark_light::Mode::Light => Theme::Light,\n        // Unspecified\n        dark_light::Mode::Default => Theme::Light,\n      },\n      \"dark\" => Theme::Dark,\n      _ => Theme::Light,\n    }\n  }\n\n  pub fn get_theme() -> String {\n    Self::read().theme.to_lowercase()\n  }\n\n  pub fn get_auto_update(self) -> String {\n    self.auto_update.to_lowercase()\n  }\n\n  pub fn theme_check(self, mode: &str) -> bool {\n    self.theme.to_lowercase() == mode\n  }\n\n  pub fn restart(self, app: tauri::AppHandle) {\n    tauri::api::process::restart(&app.env());\n  }\n}\n\nimpl Default for AppConf {\n  fn default() -> Self {\n    Self::new()\n  }\n}\n\npub mod cmd {\n  use super::AppConf;\n  use tauri::{command, AppHandle, Manager};\n\n  #[command]\n  pub fn get_app_conf() -> AppConf {\n    AppConf::read()\n  }\n\n  #[command]\n  pub fn reset_app_conf() -> AppConf {\n    AppConf::default().write()\n  }\n\n  #[command]\n  pub fn get_theme() -> String {\n    AppConf::get_theme()\n  }\n\n  #[command]\n  pub fn form_confirm(_app: AppHandle, data: serde_json::Value) {\n    AppConf::read().amend(serde_json::json!(data)).write();\n  }\n\n  #[command]\n  pub fn form_cancel(app: AppHandle, label: &str, title: &str, msg: &str) {\n    let win = app.app_handle().get_window(label).unwrap();\n    tauri::api::dialog::ask(\n      app.app_handle().get_window(label).as_ref(),\n      title,\n      msg,\n      move |is_cancel| {\n        if is_cancel {\n          win.close().unwrap();\n        }\n      },\n    );\n  }\n\n  #[command]\n  pub fn form_msg(app: AppHandle, label: &str, title: &str, msg: &str) {\n    let win = app.app_handle().get_window(label);\n    tauri::api::dialog::message(win.as_ref(), title, msg);\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/main.rs",
    "content": "#![cfg_attr(\n  all(not(debug_assertions), target_os = \"windows\"),\n  windows_subsystem = \"windows\"\n)]\n\nmod app;\nmod conf;\nmod utils;\n\nuse app::{cmd, fs_extra, gpt, menu, setup, window, cors};\nuse conf::AppConf;\nuse tauri_plugin_autostart::MacosLauncher;\nuse tauri_plugin_log::{\n  fern::colors::{Color, ColoredLevelConfig},\n  LogTarget,\n};\n\n#[tokio::main]\nasync fn main() {\n  let app_conf = AppConf::read().write();\n  // If the file does not exist, creating the file will block menu synchronization\n  utils::create_chatgpt_prompts();\n  let context = tauri::generate_context!();\n\n  gpt::download_list(\"chat.download.json\", \"download\", None, None);\n  gpt::download_list(\"chat.notes.json\", \"notes\", None, None);\n\n  let mut log = tauri_plugin_log::Builder::default()\n    .targets([\n      // LogTarget::LogDir,\n      // LOG PATH: ~/.chatgpt/ChatGPT.log\n      LogTarget::Folder(utils::app_root()),\n      LogTarget::Stdout,\n      LogTarget::Webview,\n    ])\n    .level(log::LevelFilter::Debug);\n\n  if cfg!(debug_assertions) {\n    log = log.with_colors(ColoredLevelConfig {\n      error: Color::Red,\n      warn: Color::Yellow,\n      debug: Color::Blue,\n      info: Color::BrightGreen,\n      trace: Color::Cyan,\n    });\n  }\n\n  let mut builder = tauri::Builder::default()\n    .plugin(log.build())\n    .plugin(tauri_plugin_positioner::init())\n    .plugin(tauri_plugin_autostart::init(\n      MacosLauncher::LaunchAgent,\n      None,\n    ))\n    .invoke_handler(tauri::generate_handler![\n      cmd::drag_window,\n      cmd::fullscreen,\n      cmd::download,\n      cmd::save_file,\n      cmd::open_link,\n      cmd::run_check_update,\n      cmd::open_file,\n      cmd::get_data,\n      gpt::get_chat_model_cmd,\n      gpt::parse_prompt,\n      gpt::sync_prompts,\n      gpt::sync_user_prompts,\n      gpt::cmd_list,\n      gpt::download_list,\n      gpt::get_download_list,\n      fs_extra::metadata,\n      conf::cmd::get_app_conf,\n      conf::cmd::reset_app_conf,\n      conf::cmd::get_theme,\n      conf::cmd::form_confirm,\n      conf::cmd::form_cancel,\n      conf::cmd::form_msg,\n      window::cmd::wa_window,\n      window::cmd::control_window,\n      window::cmd::window_reload,\n      window::cmd::dalle2_search_window,\n      cors::fetch_data,\n    ])\n    .setup(setup::init)\n    .menu(menu::init());\n\n  if app_conf.tray {\n    builder = builder.system_tray(menu::tray_menu());\n  }\n\n  if app_conf.save_window_state {\n    builder = builder.plugin(tauri_plugin_window_state::Builder::default().build());\n  }\n\n  builder\n    .on_menu_event(menu::menu_handler)\n    .on_system_tray_event(menu::tray_handler)\n    .on_window_event(move |event| {\n      if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {\n        let win = event.window().clone();\n        let app_conf = AppConf::read();\n        if win.label() == \"core\" {\n          if app_conf.isinit {\n            tauri::api::dialog::ask(\n              Some(event.window()),\n              \"\",\n              \"Do you want to exit the application when you click the [x] button?\",\n              move |is_ok| {\n                app_conf\n                  .amend(serde_json::json!({ \"isinit\" : false, \"main_close\": is_ok }))\n                  .write();\n                if is_ok {\n                  std::process::exit(0);\n                } else {\n                  win.minimize().unwrap();\n                }\n              },\n            );\n          } else if app_conf.main_close {\n            std::process::exit(0);\n          } else {\n            win.minimize().unwrap();\n          }\n        } else {\n          event.window().close().unwrap();\n        }\n        api.prevent_close();\n      }\n    })\n    .run(context)\n    .expect(\"error while running ChatGPT application\");\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/chat.js",
    "content": "var RecBtnClickCnt = 0;\nconst SpeechRecognitionApi_Sart = 'http://localhost:6868/Rec/Start';\nconst SpeechRecognitionApi_Stop = 'http://localhost:6868/Rec/Stop';\nconst SkipSpeechApi = 'http://localhost:6868/Skip';\nconst NewMessageFlagApi = \"http://localhost:6868/NewMessage\";\nconst SpeakOutApi = \"http://localhost:6868/play\";\nconst SpeakAssessmentApi = \"http://localhost:6868/assess\";\nconst SettingInitApi = 'http://localhost:6868/init';\nconst Helper_Rec_Start_Action = \"start\";\nconst Helper_Rec_Stop_Action = \"stop\";\n\n\nvar Helper_Messages_Count = 0;\nvar Helper_Current_Message = null;\nvar Helper_Current_Message_Sentences = [];\nvar Helper_Current_Message_Sentences_Next_Read = 0;\nvar Helper_NewMessage_Ending_Cnt = 0\nvar Helper_NewMessage_Ending_Enable = 0\n\nvar Web_Speech_Rec = null;\nvar New_Words = []; \n\nvar chatConf = {};\n\nasync function init() {\n  new MutationObserver(function (mutationsList) {\n    for (const mutation of mutationsList) {\n      // console.log(mutation);\n      // if (mutation.target.closest(\".text-sm\")) {\n      //   console.log(\"create btns\");\n      //   chatBtns();\n      // }\n      if (mutation.target.closest(\"form\")) {\n        chatBtns();\n      }\n      if (mutation.target.matches(\"#__next\")) {\n        console.log(\"---CheckNewMessages\");\n        Helper_Messages_Count = document.querySelectorAll('.text-base').length;\n        AddRecognitionBtn();\n        Helper_CheckNewMessages();\n        // setTimeout(AddRecognitionBtn, 1000);\n      }\n    }\n  }).observe(document.body, {\n    childList: true,\n    subtree: true,\n  });\n  document.addEventListener('visibilitychange', () =>\n    document.getElementsByTagName('textarea')[0]?.focus()\n  );\n  window.__helper = Helper_Words\n  setTimeout(AddRecognitionBtn, 1000);\n  setTimeout(Helper_CheckNewMessages, 1000);\n  setTimeout(Get_app_conf,1000);\n}\nasync function Get_app_conf(){\n  chatConf = await invoke('get_app_conf') || {};\n  if(chatConf == {}){\n    setTimeout(Get_app_conf,1000);\n  }else{\n    invoke(\"fetch_data\",{\n      method: 'POST',\n      url: SettingInitApi,\n      body:JSON.stringify({\n        processor:chatConf.processor,\n        subprocess_number:chatConf.subprocess_number,\n        iflytek_rec_appid:chatConf.iflytek_rec_appid,\n        iflytek_rec_apikey: chatConf.iflytek_rec_apikey,\n        iflytek_assess_appid: chatConf.iflytek_assess_appid,\n        iflytek_assess_appsecret: chatConf.iflytek_assess_appsecret,\n        iflytek_assess_apikey: chatConf.iflytek_assess_apikey,\n        ss_assess_appkey: chatConf.ss_assess_appkey,\n        ss_assess_secretkey: chatConf.ss_assess_secretkey,\n      }),\n    })\n    .then(data => {\n      console.log(data); \n    })\n    .catch(error => {\n      console.log('init : did not get data from tts server ->',error);\n    });\n  }\n}\nasync function chatBtns() {\n  // const chatConf = await invoke('get_app_conf') || {};\n  const synth = window.speechSynthesis;\n  let currentUtterance = null;\n  let currentIndex = -1;\n  const list = Array.from(document.querySelectorAll(\"main >div>div>div>div>div\"));\n  list.forEach((i, idx) => {\n      if (i.querySelector('.chat-item-copy')) return;\n      if (!i.querySelector('button.rounded-md')) return;\n      if (!i.querySelector('.self-end')) return;\n      const cpbtn = i.querySelector('button.rounded-md').cloneNode(true);\n      cpbtn.classList.add('chat-item-copy');\n      cpbtn.title = 'Copy to clipboard';\n      cpbtn.innerHTML = setIcon('copy');\n      i.querySelector('.self-end').appendChild(cpbtn);\n      cpbtn.onclick = () => {\n        copyToClipboard(i?.innerText?.trim() || '', cpbtn);\n      }\n\n      const saybtn = i.querySelector('button.rounded-md').cloneNode(true);\n      saybtn.classList.add('chat-item-voice');\n      saybtn.title = 'Say';\n      saybtn.innerHTML = setIcon('voice');\n      i.querySelector('.self-end').appendChild(saybtn);\n      saybtn.onclick = () => {\n        if (currentUtterance && currentIndex !== -1) {\n          synth.cancel();\n          if (idx === currentIndex) {\n            saybtn.innerHTML = setIcon('voice');\n            currentUtterance = null;\n            currentIndex = -1;\n            return;\n          } else if (list[currentIndex].querySelector('.chat-item-voice')) {\n            list[currentIndex].querySelector('.chat-item-voice').innerHTML = setIcon('voice');\n            list[idx].querySelector('.chat-item-voice').innerHTML = setIcon('speaking');\n          }\n        }\n        const txt = i?.innerText?.trim() || '';\n        if (!txt) return;\n        const utterance = new SpeechSynthesisUtterance(txt);\n        const voices = speechSynthesis.getVoices();\n        let voice = voices.find(voice => voice.voiceURI === chatConf.speech_lang);\n        if (!voice) {\n          voice = voices.find(voice => voice.lang === 'en-US');\n        }\n        utterance.voice = voice;\n        currentIndex = idx;\n        utterance.lang = voice.lang;\n        // utterance.rate = 0.7;\n        // utterance.pitch = 1.1;\n        // utterance.volume = 1;\n        synth.speak(utterance);\n        amISpeaking = synth.speaking;\n        saybtn.innerHTML = setIcon('speaking');\n        currentUtterance = utterance;\n        currentIndex = idx;\n        utterance.onend = () => {\n          saybtn.innerHTML = setIcon('voice');\n          currentUtterance = null;\n          currentIndex = -1;\n        }\n      }\n      const rebtn = i.querySelector('button.rounded-md').cloneNode(true);\n      rebtn.classList.add('chat-item-recoginition');\n      rebtn.title = 'speech recognition';\n      rebtn.innerHTML = setIcon('recognition');\n      i.querySelector('.self-end').appendChild(rebtn);\n      rebtn.onclick = () => {\n        if(RecBtnClickCnt ===0 ){\n          rebtn.innerHTML = setIcon('recognizing');\n          SpeechRecognition(rebtn,Helper_Rec_Start_Action);\n          RecBtnClickCnt =1;\n        }else{\n          SpeechRecognition(rebtn,Helper_Rec_Stop_Action);\n          RecBtnClickCnt =0;\n          rebtn.innerHTML = setIcon('recognition');\n        }\n      }\n       // Skip speech button\n      const skipbtn =  i.querySelector('button.rounded-md').cloneNode(true);\n      skipbtn.classList.add('chat-item-skip');\n      skipbtn.title = 'skip speech';\n      skipbtn.innerHTML = setIcon('skip');\n      i.querySelector('.self-end').appendChild(skipbtn);\n      skipbtn.onclick = () => {\n        skipbtn.innerHTML = setIcon('skipping');\n        Skip_Speech();\n        setTimeout((btn,cmd) => {btn.innerHTML = setIcon(cmd);},200,skipbtn,'skip');\n      }\n      // sppeech assessment button\n      const assessbtn =  i.querySelector('button.rounded-md').cloneNode(true);\n      assessbtn.classList.add('chat-item-assessment');\n      assessbtn.title = 'speech assessment';\n      assessbtn.innerHTML = setIcon('assess');\n      i.querySelector('.self-end').appendChild(assessbtn);\n      assessbtn.onclick = () => {\n        assessbtn.innerHTML = setIcon('assessing');\n        Speech_Assessment(assessbtn);\n      }\n\n    })\n  // AddRecognitionBtn();\n}\n\nfunction AddRecognitionBtn(){\n  // console.log(\"AddRecognitionBtn\");\n  // const input = document.querySelector(\"form>div>div\");\n  // // const input = document.querySelector('textarea').parentNode;\n  // if (!input) return;\n  // if (input.querySelector('.chat-item-recoginition')) return;\n  // if (input.querySelector('.chat-item-skip')) return;\n  // // if (!input.querySelector('button.rounded-md')) return;\n  // // const button = input.querySelector('button.rounded-md');\n  // if (!input.querySelector('button')) return;\n  // const button = input.querySelector('button');\n  // const rebtn = button.cloneNode(true);\n  // rebtn.classList.add('chat-item-recognition');\n  // rebtn.id = \"recognition-button\";\n  // // rebtn.classList.remove('md:right-2', 'right-1');\n\n  // rebtn.title = \"speech recognition\";\n  // rebtn.innerHTML = setIcon('recognition');\n  // input.appendChild(rebtn);\n  // // input.insertBefore(rebtn, button);\n  // const head = document.getElementsByTagName('head')[0];\n  // const style = document.createElement('style');\n  // style.innerHTML = '.rebtn-right-4 { right: 2.5rem; }  .rebtn-right-6 { right: 4.5rem; }';\n  // head.appendChild(style);\n  // // rebtn.classList.add('rebtn-right-4');\n  // rebtn.disabled = false;\n  // rebtn.onclick = () => {\n  //   if(RecBtnClickCnt ===0 ){\n  //     rebtn.innerHTML = setIcon('recognizing');\n  //     SpeechRecognition(rebtn,Helper_Rec_Start_Action);\n  //     RecBtnClickCnt =1;\n  //   }else{\n  //     SpeechRecognition(rebtn,Helper_Rec_Stop_Action);\n  //     RecBtnClickCnt =0;\n  //     rebtn.innerHTML = setIcon('recognition');\n  //   }\n  // }\n\n  // // Skip speech button\n  // // const skipbtn =  button.cloneNode(true);\n  // const buttonPosition = button.getBoundingClientRect();\n\n  // const skipbtn =  document.createElement(\"button\");\n  // skipbtn.style.position = 'absolute';\n\t// skipbtn.style.top = buttonPosition.top + 'px';\n\t// skipbtn.style.left = (buttonPosition.left - skipbtn.offsetWidth - 10) + 'px';\n  // skipbtn.classList.add('chat-item-skip');\n  // skipbtn.id = \"skip-button\";\n  // // skipbtn.classList.add('chat-item-skip','rebtn-right-6');\n  // // skipbtn.classList.remove('md:right-2', 'right-1');\n  // // skipbtn.title = 'skip speech';\n  // skipbtn.innerHTML = setIcon('skip');\n  // // input.appendChild(skipbtn);\n  // // input.insertBefore(skipbtn, rebtn);\n  // skipbtn.disabled = false;\n  // document.body.appendChild(skipbtn);\n  // // console.log(skipbtn);\n  // skipbtn.onclick = () => {\n  //   skipbtn.innerHTML = setIcon('skipping');\n  //   Skip_Speech();\n  //   setTimeout((btn,cmd) => {btn.innerHTML = setIcon(cmd);},100,skipbtn,'skip');\n  // }\n\n}\nasync function Speech_Assessment(btn){\n  // const chatConf = await invoke('get_app_conf') || {};\n  var textarea = document.querySelector(\"textarea\");\n  var existingText = textarea.value;\n  if(existingText.trim()!=''){\n    invoke(\"fetch_data\",{\n      method: 'POST',\n      url: SpeakAssessmentApi,\n      body:JSON.stringify({\n        text:existingText,\n        type:chatConf.assess_type\n      }),\n    })\n    .then(data => {\n      console.log(data.message); \n      console.log(data.data);\n      Helper_SendMessage(\"->\"+data.data);\n      if(btn) btn.innerHTML =setIcon('assess');\n    })\n    .catch(error => {\n      if(btn) btn.innerHTML =setIcon('assess');\n      console.log('Speech_Assessment : did not get data from tts server ->',error);\n    });\n  }else{\n    if(btn) btn.innerHTML =setIcon('assess');\n  }\n  \n}\nfunction Skip_Speech(){\n  Helper_Current_Message = null;\n  // stop speaking\n  invoke(\"fetch_data\",{\n\t\tmethod: 'POST',\n    url: SkipSpeechApi,\n\t})\n  .then(data => {\n    console.log(data.message); \n  })\n\t.catch(error => {\n\t\tconsole.log('Helper_NewMessageFlag : did not get data from tts server ->',error);\n\t});\n}\nasync function SpeechRecognition(btn, action){\n  // const chatConf = await invoke('get_app_conf') || {};\n  \n  console.log(\"btn:\", btn);\n  if (chatConf.rec_type == \"web\"){\n    if (action == Helper_Rec_Start_Action){\n      Web_Speech_Rec = ('webkitSpeechRecognition' in window) ? new webkitSpeechRecognition() : new SpeechRecognition();\n      Web_Speech_Rec.continuous = true;\n      Web_Speech_Rec.lang = chatConf.rec_lang;\n      Web_Speech_Rec.start();\n      Web_Speech_Rec.onstart = () =>{\n        console.log(\"I'm listening\");\n      };\n      Web_Speech_Rec.onend = () =>{\n        console.log(\"I've stopped listening\");\n      };\n      Web_Speech_Rec.onerror = () =>{\n        console.log(\"Error while listening\");\n      };\n      Web_Speech_Rec.onresult = (event) =>{\n        var final_transcript = \"\";\n        for (let i = event.resultIndex; i < event.results.length; ++i) {\n          if (event.results[i].isFinal)\n            final_transcript += event.results[i][0].transcript;\n        }\n        console.log(\"You have said the following words: \"+final_transcript);\n        Helper_SendMessage(final_transcript);\n      };\n    } else if (action == Helper_Rec_Stop_Action){\n      if (Web_Speech_Rec){\n        Web_Speech_Rec.stop();\n        Web_Speech_Rec = null;\n      }\n    }\n    \n  }else if (chatConf.rec_type == \"iflytek\"){\n    if (action === Helper_Rec_Start_Action){\n      invoke(\"fetch_data\",{\n        method: 'POST',\n        url: SpeechRecognitionApi_Sart,\n        body: JSON.stringify({\n          lang: chatConf.rec_iflytek_lang\n        }) \n      })\n      .then(response => {\n        console.log(response.message); \n      })\n      .catch(error => {\n        console.log('Helper_NewMessageFlag : did not get data from tts server ->',error);\n      });\n    }else if(action === Helper_Rec_Stop_Action){\n      invoke(\"fetch_data\",{\n        method: 'POST',\n        url: SpeechRecognitionApi_Stop,\n      })\n      .then(response => {\n        console.log(response.message); \n        console.log(\"xunfei recognization result :\",response.data);\n        Helper_SendMessage(response.data);\n      })\n      .catch(error => {\n        console.log('Helper_NewMessageFlag : did not get data from tts server ->',error);\n      });\n    }\n  }\n}\nfunction Helper_SendMessage(text){\n  // Put message in textarea\n  var textarea = document.querySelector(\"textarea\");\n  if (!textarea) return;\n  textarea.focus();\n  // fix the send message can't be clicked due to recognition input without keybord input.\n  textarea.parentNode.querySelector(\"button\").disabled =false;\n  var existingText = textarea.value;\n  \n  // Is there already existing text?\n  if (!existingText) textarea.value = text;\n  else textarea.value = existingText + \" \" + text;\n  \n  // Change height in case\n  var fullText = existingText + \" \" + text;\n  var rows = Math.ceil(fullText.length / 88);\n  var height = rows * 24;\n  textarea.style.height = height + \"px\";\n  \n}\n// Check for new messages the ChatGPT bot has sent. \n// If a new message is found, it will be read out loud.\nfunction Helper_CheckNewMessages(){\n\t// Any new messages?\n  var messages = document.querySelectorAll('.text-base');\n  var currentMessageCount = messages.length;\n\tif (currentMessageCount > Helper_Messages_Count) {\n\t\t// New message!\n    console.log(\"new message!\");\n\t\tHelper_Messages_Count = currentMessageCount;\n    Helper_Current_Message = messages[currentMessageCount - 1];\n    console.log(\"Helper_Current_Message:\",Helper_Current_Message);\n\t\tHelper_Current_Message_Sentences = []; // Reset list of parts already spoken\n\t\tHelper_Current_Message_Sentences_Next_Read = 0;\n    Helper_NewMessage_Ending_Enable = 1;\n    Helper_NewMessage_Ending_Cnt = 0;\n\t\tHelper_NewMessageFlag();\n\t}\n\n\t// Split current message into parts\n  var SendDelayCnt = 0;\n\tif (Helper_Current_Message) {\n    // let textLength = CN_CURRENT_MESSAGE.textContent.trim().length;\n\t\tvar currentText = Helper_Current_Message.textContent+\"\";\n\t\tvar newSentences = Helper_SplitIntoSentences(currentText);\n    if ((Helper_NewMessage_Ending_Enable === 1) && (currentText !='')) {\n      Helper_NewMessage_Ending_Cnt +=1;\n      console.log(currentText,Helper_NewMessage_Ending_Cnt)\n    }\n\t\tif (newSentences != null && newSentences.length != Helper_Current_Message_Sentences.length) {\n\t\t\t// There is a new part of a sentence!\n\t\t\tvar nextRead = Helper_Current_Message_Sentences_Next_Read;\n\t\t\tfor (i = nextRead; i < newSentences.length; i++) {\n\t\t\t\tHelper_Current_Message_Sentences_Next_Read = i+1;\n\n\t\t\t\tvar lastPart = newSentences[i];\n        if ((chatConf!={}) && chatConf.talk_mode ===true){\n          setTimeout(Helper_SayOutLoud,50*SendDelayCnt,lastPart);\n        }\n        SendDelayCnt +=1;\n\t\t\t\t// Helper_SayOutLoud(lastPart);\n\t\t\t}\n\t\t\tHelper_Current_Message_Sentences = newSentences;\n      Helper_NewMessage_Ending_Cnt = 0;\n      // Helper_TagNewWord(Helper_Current_Message.querySelectorAll('p'));\n\t\t}\n\t}\n\tsetTimeout(Helper_CheckNewMessages, SendDelayCnt==0 ? 100:50*SendDelayCnt);\n  if (Helper_NewMessage_Ending_Cnt>=600){\n    // regard its the ending of new message\n    Helper_NewMessage_Ending_Enable = 0;\n    Helper_NewMessage_Ending_Cnt = 0;\n    Helper_TagNewWord(Helper_Current_Message.querySelectorAll('p'));\n  }\n}\n// highlight the the new word with custom color\nfunction Helper_TagNewWord(elements){\n  // const words = ['weird','strange']\n  console.log(elements)\n  if(elements && elements.length){\n    console.log(\"come in \");\n    for(let i=0; i<elements.length; i++){\n      const pnode = elements[i];\n      // const text = pnode.textContent;\n      const text = (pnode.innerText!='')?pnode.innerText+'':pnode.textContent+'';\n      New_Words.forEach(word =>{\n        const index = text.indexOf(word);\n        console.log(pnode,text);\n        // If the word is found, wrap it in a span with a CSS class to highlight it\n        if (index !== -1) {\n          for(let j=0; j<pnode.childNodes.length;j++){\n            const node = pnode.childNodes[i];\n            if (node.nodeType === Node.TEXT_NODE) {\n\n              const text = node.textContent;\n              const index = text.indexOf(word);\n              // If the word is found, wrap it in a span with a CSS class to highlight it\n              if (index !== -1) {\n                const span = document.createElement('span');\n                span.className = 'highlight';\n                const highlightedText = document.createTextNode(text.substr(index, word.length));\n                span.appendChild(highlightedText);\n                const unhighlightedText = document.createTextNode(text.substr(index + word.length));\n                node.textContent = text.substr(0, index);\n                node.parentNode.insertBefore(span, node.nextSibling);\n                node.parentNode.insertBefore(unhighlightedText, span.nextSibling);\n              }\n            }\n          }\n        }\n      })\n      \n    }\n  }\n}\n\n// tell tts server there is a new message\nfunction Helper_NewMessageFlag() {\n\tinvoke(\"fetch_data\",{\n\t\tmethod: 'POST',\n    url: NewMessageFlagApi,\n\t})\n  .then(data => {\n    console.log(data.message); \n  })\n\t.catch(error => {\n\t\tconsole.log('Helper_NewMessageFlag : did not get data from tts server ->',error);\n\t});\n}\n\nasync function Helper_SayOutLoud(text){\n  // const chatConf = await invoke('get_app_conf') || {};\n  var speaker = chatConf.speech_ai_lang;\n  if (speaker.includes(\"-\")) {\n    speaker = speaker.split(\"-\")[0];\n  }\n  invoke('fetch_data', { \n    method: 'POST',\n    url: SpeakOutApi,\n    body: JSON.stringify({\n      text:text,\n      speaker:speaker,\n    }) \n  })\n  .then(response => {\n    console.log(response.message); \n\t})\n\t.catch(error => {\n\t\tconsole.error('did not get data from tts server !',error);\n\t});\n\n}\nfunction Helper_Words(cmd){\n  const selectedText = window.getSelection().toString().trim();\n  const isEnglishWord = /^[a-zA-Z]+$/.test(selectedText);\n  const indexToRemove = New_Words.indexOf(selectedText);\n  if(cmd === \"add\"){\n    \n    if (isEnglishWord){\n      if (indexToRemove !== -1) {\n        console.log(\"${selectedText} already in !\");\n      }else{\n        New_Words.push(selectedText);\n        console.log(\"add ${selectedText} to new words!\");\n      }\n     \n    }else{\n      console.log(\"${selectedText} is now a english word! add failed\");\n    }\n  }else if(cmd === \"remove\"){\n    if (isEnglishWord){\n      if (indexToRemove !== -1) {\n        New_Words.splice(indexToRemove, 1);\n      }\n      console.log(\"remove ${selectedText} from new words sucessfully!\");\n    }else{\n      console.log(\"${selectedText} is now a english word! remove failed\");\n    }\n  }\n}\n// Split the text into sentences so the speech synthesis can start speaking as soon as possible\nfunction Helper_SplitIntoSentences(text) {\n\tvar sentences = [];\n\tvar currentSentence = \"\";\n\t\n\tfor(var i=0; i<text.length; i++) {\n\t\t//\n\t\tvar currentChar = text[i];\n\t\t\n\t\t// Add character to current sentence\n\t\tcurrentSentence += currentChar;\n\t\t\n\t\t// is the current character a delimiter? if so, add current part to array and clear\n\t\tif (\n\t\t\t// Latin punctuation\n\t\t       currentChar == ',' \n\t\t\t|| currentChar == ':' \n\t\t\t|| currentChar == '.' \n\t\t\t|| currentChar == '!' \n\t\t\t|| currentChar == '?' \n\t\t\t|| currentChar == ';'\n\t\t\t|| currentChar == '…'\n\t\t\t// Chinese/japanese punctuation\n\t\t\t|| currentChar == '、' \n\t\t\t|| currentChar == '，'\n\t\t\t|| currentChar == '。'\n\t\t\t|| currentChar == '．'\n\t\t\t|| currentChar == '！'\n\t\t\t|| currentChar == '？'\n\t\t\t|| currentChar == '；'\n\t\t\t|| currentChar == '：'\n\t\t\t) {\n\t\t\tif (currentSentence.trim() != \"\") sentences.push(currentSentence.trim());\n\t\t\tcurrentSentence = \"\";\n\t\t}\n\t}\n\treturn sentences;\n}\n\nfunction copyToClipboard(text, btn) {\n  window.clearTimeout(window.__cpTimeout);\n  btn.innerHTML = setIcon('cpok');\n  if (navigator.clipboard) {\n    navigator.clipboard.writeText(text);\n  } else {\n    var textarea = document.createElement('textarea');\n    document.body.appendChild(textarea);\n    textarea.style.position = 'fixed';\n    textarea.style.clip = 'rect(0 0 0 0)';\n    textarea.style.top = '10px';\n    textarea.value = text;\n    textarea.select();\n    document.execCommand('copy', true);\n    document.body.removeChild(textarea);\n  }\n  window.__cpTimeout = setTimeout(() => {\n    btn.innerHTML = setIcon('copy');\n  }, 1000);\n}\n\nfunction focusOnInput() {\n  // This currently works because there is only a single `<textarea>` element on the ChatGPT UI page.\n  document.getElementsByTagName(\"textarea\")[0].focus();\n}\n\nfunction setIcon(type) {\n  return {\n    copy: `<svg class=\"chatappico copy\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"2\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"></path><rect x=\"8\" y=\"2\" width=\"8\" height=\"4\" rx=\"1\" ry=\"1\"></rect></svg>`,\n    cpok: `<svg class=\"chatappico cpok\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"#10a37f\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\"/><path d=\"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4m1 4H11\"/><path d=\"m15 10l-4 4l4 4\"/></g></svg>`,\n    voice: `<svg class=\"chatappico voice\" viewBox=\"0 0 1024 1024\"><path d=\"M542.923802 202.113207c-5.110391 0-10.717086 1.186012-16.572444 3.739161L360.043634 312.714188l-83.057671 0c-46.109154 0-83.433224 36.917818-83.433224 83.121116l0 166.646438c0 45.952588 36.950564 83.153862 83.433224 83.153862l83.057671 0 166.307723 106.829074c23.550369 10.218736 41.745776-0.717338 41.745776-23.898293L568.097134 229.687216C568.096111 212.426087 557.753555 202.113207 542.923802 202.113207z\" fill=\"currentColor\"></path><path d=\"M794.154683 314.39548c-16.758686-28.537963-33.771151-48.258097-45.610804-58.882062-3.986801-3.489474-8.972349-5.233188-13.833053-5.233188-5.79396 0-11.464099 2.337231-15.57779 6.91448-7.662517 8.631588-6.976902 21.808702 1.620917 29.410843 1.994424 1.744737 5.856381 5.700839 11.154038 11.777231 9.033747 10.437723 18.006096 22.774703 26.419719 37.072337 24.235984 41.033555 38.755676 89.011266 38.755676 143.688563 0 54.705949-14.519692 102.651938-38.755676 143.810337-8.414647 14.20656-17.448394 26.668383-26.484188 37.07336-5.234211 6.076392-9.096169 10.033517-11.149944 11.778254-8.538467 7.603165-9.224082 20.717857-1.683339 29.40982 7.599072 8.473999 20.807908 9.222035 29.40982 1.650593 11.900028-10.562567 28.910447-30.252001 45.732577-58.850339 27.79095-47.078225 44.490284-102.3122 44.490284-164.872025C838.708412 416.646282 821.946656 361.470635 794.154683 314.39548z\" fill=\"currentColor\"></path><path d=\"M690.846806 377.360534c-8.723685-17.790178-17.698081-30.2827-24.301476-37.260625-4.111644-4.3951-9.595542-6.544043-15.139815-6.544043-5.110391 0-10.159384 1.774413-14.270005 5.54632-8.350179 7.881504-8.847505 20.99722-0.997724 29.471219 3.927449 4.112668 10.468422 13.304004 17.448394 27.199479 11.587919 23.77038 18.567891 51.559283 18.567891 83.370803 0 31.80845-6.978948 59.72322-18.567891 83.400478-6.978948 13.892405-13.520945 23.052019-17.448394 27.259854-7.850805 8.410554-7.353478 21.559015 0.997724 29.440519 8.473999 7.882528 21.559015 7.353478 29.474288-1.025353 6.53995-7.011694 15.513322-19.440771 24.238031-37.356816 14.393825-29.189809 22.992667-63.243393 22.992667-101.781104C713.839473 440.603927 705.241654 406.583089 690.846806 377.360534z\" fill=\"currentColor\"></path></svg>`,\n    speaking: `<svg class=\"chatappico voice\" viewBox=\"0 0 1024 1024\"><path d=\"M542.923802 202.113207c-5.110391 0-10.717086 1.186012-16.572444 3.739161L360.043634 312.714188l-83.057671 0c-46.109154 0-83.433224 36.917818-83.433224 83.121116l0 166.646438c0 45.952588 36.950564 83.153862 83.433224 83.153862l83.057671 0 166.307723 106.829074c23.550369 10.218736 41.745776-0.717338 41.745776-23.898293L568.097134 229.687216C568.096111 212.426087 557.753555 202.113207 542.923802 202.113207z\" fill=\"#10a37f\"></path><path d=\"M794.154683 314.39548c-16.758686-28.537963-33.771151-48.258097-45.610804-58.882062-3.986801-3.489474-8.972349-5.233188-13.833053-5.233188-5.79396 0-11.464099 2.337231-15.57779 6.91448-7.662517 8.631588-6.976902 21.808702 1.620917 29.410843 1.994424 1.744737 5.856381 5.700839 11.154038 11.777231 9.033747 10.437723 18.006096 22.774703 26.419719 37.072337 24.235984 41.033555 38.755676 89.011266 38.755676 143.688563 0 54.705949-14.519692 102.651938-38.755676 143.810337-8.414647 14.20656-17.448394 26.668383-26.484188 37.07336-5.234211 6.076392-9.096169 10.033517-11.149944 11.778254-8.538467 7.603165-9.224082 20.717857-1.683339 29.40982 7.599072 8.473999 20.807908 9.222035 29.40982 1.650593 11.900028-10.562567 28.910447-30.252001 45.732577-58.850339 27.79095-47.078225 44.490284-102.3122 44.490284-164.872025C838.708412 416.646282 821.946656 361.470635 794.154683 314.39548z\" fill=\"#10a37f\"></path><path d=\"M690.846806 377.360534c-8.723685-17.790178-17.698081-30.2827-24.301476-37.260625-4.111644-4.3951-9.595542-6.544043-15.139815-6.544043-5.110391 0-10.159384 1.774413-14.270005 5.54632-8.350179 7.881504-8.847505 20.99722-0.997724 29.471219 3.927449 4.112668 10.468422 13.304004 17.448394 27.199479 11.587919 23.77038 18.567891 51.559283 18.567891 83.370803 0 31.80845-6.978948 59.72322-18.567891 83.400478-6.978948 13.892405-13.520945 23.052019-17.448394 27.259854-7.850805 8.410554-7.353478 21.559015 0.997724 29.440519 8.473999 7.882528 21.559015 7.353478 29.474288-1.025353 6.53995-7.011694 15.513322-19.440771 24.238031-37.356816 14.393825-29.189809 22.992667-63.243393 22.992667-101.781104C713.839473 440.603927 705.241654 406.583089 690.846806 377.360534z\" fill=\"#10a37f\"></path></svg>`,\n    recognition:'<svg class=\"speech recognition\" width=\"20px\" height=\"16px\" viewBox=\"0 0 24 24\"  xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 14.2857C13.4229 14.2857 14.5714 13.1371 14.5714 11.7143V6.57143C14.5714 5.14857 13.4229 4 12 4C10.5771 4 9.42857 5.14857 9.42857 6.57143V11.7143C9.42857 13.1371 10.5771 14.2857 12 14.2857Z\" fill=\"currentColor\"/><path d=\"M16.5429 11.7143H18C18 14.6371 15.6686 17.0543 12.8571 17.4743V20.2857H11.1429V17.4743C8.33143 17.0543 6 14.6371 6 11.7143H7.45714C7.45714 14.2857 9.63429 16.0857 12 16.0857C14.3657 16.0857 16.5429 14.2857 16.5429 11.7143Z\" fill=\"currentColor\"/></svg>',\n    recognizing:'<svg class=\"speech recognition\" width=\"20px\" height=\"16px\" viewBox=\"0 0 24 24\"  xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 14.2857C13.4229 14.2857 14.5714 13.1371 14.5714 11.7143V6.57143C14.5714 5.14857 13.4229 4 12 4C10.5771 4 9.42857 5.14857 9.42857 6.57143V11.7143C9.42857 13.1371 10.5771 14.2857 12 14.2857Z\" fill=\"#10a37f\"/><path d=\"M16.5429 11.7143H18C18 14.6371 15.6686 17.0543 12.8571 17.4743V20.2857H11.1429V17.4743C8.33143 17.0543 6 14.6371 6 11.7143H7.45714C7.45714 14.2857 9.63429 16.0857 12 16.0857C14.3657 16.0857 16.5429 14.2857 16.5429 11.7143Z\" fill=\"#10a37f\"/></svg>',\n    skip:'<svg class=\"speech skip\" width=\"20px\" height=\"16px\" viewBox=\"0 0 24 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><g id=\"Media / Skip_Forward\"><path id=\"Vector\" d=\"M17 5V19M6 10.5713V13.4287C6 15.2557 6 16.1693 6.38355 16.6958C6.71806 17.1549 7.23174 17.4496 7.79688 17.5073C8.44484 17.5733 9.23434 17.113 10.8125 16.1924L13.2617 14.7637L13.2701 14.7588C14.8216 13.8537 15.5979 13.4009 15.8595 12.8105C16.0881 12.2946 16.0881 11.7062 15.8595 11.1902C15.5974 10.5988 14.8188 10.1446 13.2617 9.2363L10.8125 7.80762C9.23434 6.88702 8.44484 6.42651 7.79688 6.49256C7.23174 6.55017 6.71806 6.84556 6.38355 7.30469C6 7.83111 6 8.74424 6 10.5713Z\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g></svg>',\n    skipping:'<svg class=\"speech skip\" width=\"20px\" height=\"16px\" viewBox=\"0 0 24 24\"  xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"#10a37f\" id=\"Media / Skip_Forward\"><path id=\"Vector\" d=\"M17 5V19M6 10.5713V13.4287C6 15.2557 6 16.1693 6.38355 16.6958C6.71806 17.1549 7.23174 17.4496 7.79688 17.5073C8.44484 17.5733 9.23434 17.113 10.8125 16.1924L13.2617 14.7637L13.2701 14.7588C14.8216 13.8537 15.5979 13.4009 15.8595 12.8105C16.0881 12.2946 16.0881 11.7062 15.8595 11.1902C15.5974 10.5988 14.8188 10.1446 13.2617 9.2363L10.8125 7.80762C9.23434 6.88702 8.44484 6.42651 7.79688 6.49256C7.23174 6.55017 6.71806 6.84556 6.38355 7.30469C6 7.83111 6 8.74424 6 10.5713Z\" stroke=\"#10a37f\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g></svg>',\n    assess:'<svg width=\"20px\" height=\"16px\" viewBox=\"0 0 1024 1024\" class=\"icon\"  version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M905.92 237.76a32 32 0 0 0-52.48 36.48A416 416 0 1 1 96 512a418.56 418.56 0 0 1 297.28-398.72 32 32 0 1 0-18.24-61.44A480 480 0 1 0 992 512a477.12 477.12 0 0 0-86.08-274.24z\" fill=\"currentColor\" /><path d=\"M630.72 113.28A413.76 413.76 0 0 1 768 185.28a32 32 0 0 0 39.68-50.24 476.8 476.8 0 0 0-160-83.2 32 32 0 0 0-18.24 61.44zM489.28 86.72a36.8 36.8 0 0 0 10.56 6.72 30.08 30.08 0 0 0 24.32 0 37.12 37.12 0 0 0 10.56-6.72A32 32 0 0 0 544 64a33.6 33.6 0 0 0-9.28-22.72A32 32 0 0 0 505.6 32a20.8 20.8 0 0 0-5.76 1.92 23.68 23.68 0 0 0-5.76 2.88l-4.8 3.84a32 32 0 0 0-6.72 10.56A32 32 0 0 0 480 64a32 32 0 0 0 2.56 12.16 37.12 37.12 0 0 0 6.72 10.56zM355.84 313.6a36.8 36.8 0 0 0-13.12 18.56l-107.52 312.96a37.44 37.44 0 0 0 2.56 35.52 32 32 0 0 0 24.96 10.56 27.84 27.84 0 0 0 17.28-5.76 43.84 43.84 0 0 0 10.56-13.44 100.16 100.16 0 0 0 7.04-15.36l4.8-12.8 17.6-49.92h118.72l24.96 69.76a45.76 45.76 0 0 0 10.88 19.2 28.8 28.8 0 0 0 20.48 8.32h2.24a27.52 27.52 0 0 0 27.84-15.68 41.28 41.28 0 0 0 0-29.44l-107.84-313.6a36.8 36.8 0 0 0-13.44-19.2 44.16 44.16 0 0 0-48 0.32z m24.32 96l41.6 125.44h-83.2zM594.88 544a66.56 66.56 0 0 0 25.6 4.16h62.4v78.72a29.12 29.12 0 0 0 32 32 26.24 26.24 0 0 0 27.2-16.32 73.28 73.28 0 0 0 4.16-26.24v-66.88h73.6a27.84 27.84 0 0 0 29.44-32 26.56 26.56 0 0 0-16-27.2 64 64 0 0 0-23.04-4.16h-64v-75.84a28.16 28.16 0 0 0-32-30.08 26.56 26.56 0 0 0-27.2 15.68 64 64 0 0 0-4.16 24v66.88h-62.72a69.44 69.44 0 0 0-25.6 4.16 26.56 26.56 0 0 0-15.68 27.2 25.92 25.92 0 0 0 16 25.92z\" fill=\"currentColor\" /></svg>',\n    assessing:'<svg width=\"20px\" height=\"16px\" viewBox=\"0 0 1024 1024\" class=\"icon\"  version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M905.92 237.76a32 32 0 0 0-52.48 36.48A416 416 0 1 1 96 512a418.56 418.56 0 0 1 297.28-398.72 32 32 0 1 0-18.24-61.44A480 480 0 1 0 992 512a477.12 477.12 0 0 0-86.08-274.24z\" fill=\"#10a37f\" /><path d=\"M630.72 113.28A413.76 413.76 0 0 1 768 185.28a32 32 0 0 0 39.68-50.24 476.8 476.8 0 0 0-160-83.2 32 32 0 0 0-18.24 61.44zM489.28 86.72a36.8 36.8 0 0 0 10.56 6.72 30.08 30.08 0 0 0 24.32 0 37.12 37.12 0 0 0 10.56-6.72A32 32 0 0 0 544 64a33.6 33.6 0 0 0-9.28-22.72A32 32 0 0 0 505.6 32a20.8 20.8 0 0 0-5.76 1.92 23.68 23.68 0 0 0-5.76 2.88l-4.8 3.84a32 32 0 0 0-6.72 10.56A32 32 0 0 0 480 64a32 32 0 0 0 2.56 12.16 37.12 37.12 0 0 0 6.72 10.56zM355.84 313.6a36.8 36.8 0 0 0-13.12 18.56l-107.52 312.96a37.44 37.44 0 0 0 2.56 35.52 32 32 0 0 0 24.96 10.56 27.84 27.84 0 0 0 17.28-5.76 43.84 43.84 0 0 0 10.56-13.44 100.16 100.16 0 0 0 7.04-15.36l4.8-12.8 17.6-49.92h118.72l24.96 69.76a45.76 45.76 0 0 0 10.88 19.2 28.8 28.8 0 0 0 20.48 8.32h2.24a27.52 27.52 0 0 0 27.84-15.68 41.28 41.28 0 0 0 0-29.44l-107.84-313.6a36.8 36.8 0 0 0-13.44-19.2 44.16 44.16 0 0 0-48 0.32z m24.32 96l41.6 125.44h-83.2zM594.88 544a66.56 66.56 0 0 0 25.6 4.16h62.4v78.72a29.12 29.12 0 0 0 32 32 26.24 26.24 0 0 0 27.2-16.32 73.28 73.28 0 0 0 4.16-26.24v-66.88h73.6a27.84 27.84 0 0 0 29.44-32 26.56 26.56 0 0 0-16-27.2 64 64 0 0 0-23.04-4.16h-64v-75.84a28.16 28.16 0 0 0-32-30.08 26.56 26.56 0 0 0-27.2 15.68 64 64 0 0 0-4.16 24v66.88h-62.72a69.44 69.44 0 0 0-25.6 4.16 26.56 26.56 0 0 0-15.68 27.2 25.92 25.92 0 0 0 16 25.92z\" fill=\"#10a37f\" /></svg>',\n  }[type];\n}\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/cmd.js",
    "content": "// *** Core Script - CMD ***\n\nfunction init() {\n  const styleDom = document.createElement('style');\n  styleDom.innerHTML = `form {\n    position: relative;\n  }\n  .chat-model-cmd-list {\n    position: absolute;\n    bottom: 60px;\n    max-height: 100px;\n    overflow: auto;\n    z-index: 9999;\n  }\n  .chat-model-cmd-list>div {\n    border: solid 2px rgba(80,80,80,.3);\n    border-radius: 5px;\n    background-color: #fff;\n  }\n\n  html.dark .chat-model-cmd-list>div {\n    background-color: #4a4a4a;\n  }\n  html.dark .chat-model-cmd-list .cmd-item {\n    border-color: #666;\n  }\n  html.dark .chat-model-cmd-list .cmd-item b {\n    color: #e8e8e8;\n  }\n  html.dark .chat-model-cmd-list .cmd-item i {\n    color: #999;\n  }\n  html.dark .chat-model-cmd-list .cmd-item.selected {\n    background: rgba(59,130,246,.5);\n  }\n\n  .chat-model-cmd-list .cmd-item {\n    font-size: 12px;\n    border-bottom: solid 1px rgba(80,80,80,.2);\n    padding: 2px 4px;\n    display: flex;\n    user-select: none;\n    cursor: pointer;\n  }\n  .chat-model-cmd-list .cmd-item:last-child {\n    border-bottom: none;\n  }\n  .chat-model-cmd-list .cmd-item.selected {\n    background: rgba(59,130,246,.3);\n  }\n  .chat-model-cmd-list .cmd-item b {\n    display: inline-block;\n    width: 100px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    border-radius: 4px;\n    margin-right: 10px;\n    color: #2a2a2a;\n  }\n  .chat-model-cmd-list .cmd-item i {\n    width: 100%;\n    max-width: 200px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    text-align: right;\n    color: #888;\n  }\n  .chatappico {\n    width: 20px;\n    height: 20px;\n  }\n  .chatappico.pdf, .chatappico.md {\n    width: 22px;\n    height: 22px;\n  }\n  .chatappico.copy {\n    width: 16px;\n    height: 16px;\n  }\n  .chatappico.cpok {\n    width: 16px;\n    height: 16px;\n  }\n  .chatappico.refresh {\n    width: 22px;\n    height: 22px;\n  }\n  #download-markdown-button,\n  #download-png-button,\n  #download-pdf-button,\n  #refresh-page-button {\n    border: none;\n  }\n  @media screen and (max-width: 767px) {\n    #download-png-button, #download-pdf-button, #download-html-button {\n      display: none;\n    }\n  }\n  .highlight {\n    color: red;\n  }\n  `;\n  document.head.append(styleDom);\n\n  if (window.formInterval) {\n    clearInterval(window.formInterval);\n  }\n  window.formInterval = setInterval(() => {\n    const form = document.querySelector(\"form textarea\");\n    if (!form) return;\n    clearInterval(window.formInterval);\n    cmdTip();\n    new MutationObserver(function (mutationsList) {\n      for (const mutation of mutationsList) {\n        if (mutation.target.getAttribute('id') === '__next') {\n          initDom();\n          cmdTip();\n        }\n        if (mutation.target.getAttribute('class') === 'chat-model-cmd-list') {\n          // The `chatgpt prompt` fill can be done by clicking on the event.\n          const searchDom = document.querySelector(\"form .chat-model-cmd-list>div\");\n          const searchInput = document.querySelector('form textarea');\n          if (!searchDom) return;\n          searchDom.addEventListener('click', (event) => {\n            const item = event.target.closest(\"div\");\n            if (item) {\n              const val = decodeURIComponent(item.getAttribute('data-prompt'));\n              searchInput.value = val;\n              document.querySelector('form textarea').focus();\n              initDom();\n            }\n          });\n        }\n      }\n    }).observe(document.body, {\n      childList: true,\n      subtree: true,\n    });\n  }, 300);\n}\n\nasync function cmdTip() {\n  initDom();\n  const chatModelJson = await invoke('get_chat_model_cmd') || {};\n  const data = chatModelJson.data;\n  if (data.length <= 0) return;\n\n  let modelDom = document.querySelector('.chat-model-cmd-list');\n  if (!modelDom) {\n    const dom = document.createElement('div');\n    dom.classList.add('chat-model-cmd-list');\n    document.querySelector('form').appendChild(dom);\n    modelDom = document.querySelector('.chat-model-cmd-list');\n\n    // fix: tray window\n    if (__TAURI_METADATA__.__currentWindow.label === 'tray') {\n      modelDom.style.bottom = '54px';\n    }\n\n    const itemDom = (v) => `<div class=\"cmd-item\" title=\"${v.prompt}\" data-cmd=\"${v.cmd}\" data-prompt=\"${encodeURIComponent(v.prompt)}\"><b title=\"${v.cmd}\">/${v.cmd}</b><i>${v.act}</i></div>`;\n    const renderList = (v) => {\n      initDom();\n      modelDom.innerHTML = `<div>${v.map(itemDom).join('')}</div>`;\n      window.__CHAT_MODEL_CMD_PROMPT__ = v[0]?.prompt.trim();\n      window.__CHAT_MODEL_CMD__ = v[0]?.cmd.trim();\n      window.__cmd_list = modelDom.querySelectorAll('.cmd-item');\n      window.__cmd_index = 0;\n      window.__cmd_list[window.__cmd_index].classList.add('selected');\n    };\n    const setPrompt = (v = '') => {\n      if (v.trim()) {\n        window.__CHAT_MODEL_CMD_PROMPT__ = window.__CHAT_MODEL_CMD_PROMPT__?.replace(/\\{([^{}]*)\\}/, `{${v.trim()}}`);\n      }\n    }\n    const searchInput = document.querySelector('form textarea');\n\n    // Enter a command starting with `/` and press a space to automatically fill `chatgpt prompt`.\n    // If more than one command appears in the search results, the first one will be used by default.\n    function cmdKeydown(event) {\n      if (!window.__CHAT_MODEL_CMD_PROMPT__) {\n        if (!event.shiftKey && event.keyCode === 13 && __TAURI_METADATA__.__currentWindow.label === 'tray') {\n          const btn = document.querySelector('form button');\n          if (btn) btn.click();\n          event.preventDefault();\n        }\n        return;\n      }\n\n      // ------------------ Keyboard scrolling (ArrowUp | ArrowDown) --------------------------\n      if (event.keyCode === 38 &&  window.__cmd_index > 0) { // ArrowUp\n        window.__cmd_list[window.__cmd_index].classList.remove('selected');\n        window.__cmd_index = window.__cmd_index - 1;\n        window.__cmd_list[window.__cmd_index].classList.add('selected');\n        window.__CHAT_MODEL_CMD_PROMPT__ = decodeURIComponent(window.__cmd_list[window.__cmd_index].getAttribute('data-prompt'));\n        searchInput.value = `/${window.__cmd_list[window.__cmd_index].getAttribute('data-cmd')}`;\n        event.preventDefault();\n      }\n\n      if (event.keyCode === 40 && window.__cmd_index < window.__cmd_list.length - 1) { // ArrowDown\n        window.__cmd_list[window.__cmd_index].classList.remove('selected');\n        window.__cmd_index = window.__cmd_index + 1;\n        window.__cmd_list[window.__cmd_index].classList.add('selected');\n        window.__CHAT_MODEL_CMD_PROMPT__ = decodeURIComponent(window.__cmd_list[window.__cmd_index].getAttribute('data-prompt'));\n        searchInput.value = `/${window.__cmd_list[window.__cmd_index].getAttribute('data-cmd')}`;\n        event.preventDefault();\n      }\n\n      const containerHeight = modelDom.offsetHeight;\n      const itemHeight = window.__cmd_list[0].offsetHeight + 1;\n\n      const itemTop = window.__cmd_list[window.__cmd_index].offsetTop;\n      const itemBottom = itemTop + itemHeight;\n      if (itemTop < modelDom.scrollTop || itemBottom > modelDom.scrollTop + containerHeight) {\n        modelDom.scrollTop = itemTop;\n      }\n\n      // ------------------ TAB key replaces `{q}` tag content -------------------------------\n      // feat: https://github.com/lencx/ChatGPT/issues/54\n      if (event.keyCode === 9 && !window.__CHAT_MODEL_STATUS__) {\n        const strGroup = window.__CHAT_MODEL_CMD_PROMPT__.match(/\\{([^{}]*)\\}/) || [];\n\n        if (strGroup[1]) {\n          searchInput.value = `/${window.__CHAT_MODEL_CMD__}` + ` {${strGroup[1]}}` + ' |-> ';\n          window.__CHAT_MODEL_STATUS__ = 1;\n        } else {\n          searchInput.value = window.__CHAT_MODEL_CMD_PROMPT__;\n          initDom();\n        }\n        event.preventDefault();\n      }\n\n      if (window.__CHAT_MODEL_STATUS__ === 1 && event.keyCode === 9) { // TAB\n        const data = searchInput.value.split('|->');\n        if (data[1]?.trim()) {\n          setPrompt(data[1]);\n          window.__CHAT_MODEL_STATUS__ = 2;\n        }\n        event.preventDefault();\n      }\n\n      // input text\n      if (window.__CHAT_MODEL_STATUS__ === 2 && event.keyCode === 9) { // TAB\n        searchInput.value = window.__CHAT_MODEL_CMD_PROMPT__;\n        modelDom.innerHTML = '';\n        delete window.__CHAT_MODEL_STATUS__;\n        event.preventDefault();\n      }\n\n      // ------------------ type in a space to complete the fill ------------------------------------\n      if (event.keyCode === 32) {\n        searchInput.value = window.__CHAT_MODEL_CMD_PROMPT__;\n        modelDom.innerHTML = '';\n        delete window.__CHAT_MODEL_CMD_PROMPT__;\n      }\n\n      // ------------------ send --------------------------------------------------------------------\n      if (event.keyCode === 13 && window.__CHAT_MODEL_CMD_PROMPT__) { // Enter\n        const data = searchInput.value.split('|->');\n        setPrompt(data[1]);\n\n        searchInput.value = window.__CHAT_MODEL_CMD_PROMPT__;\n\n        initDom();\n\n        event.preventDefault();\n      }\n    }\n    searchInput.removeEventListener('keydown', cmdKeydown, { capture: true });\n    searchInput.addEventListener('keydown', cmdKeydown, { capture: true });\n\n    function cmdInput() {\n      if (searchInput.value === '') {\n        initDom();\n      }\n\n      if (window.__CHAT_MODEL_STATUS__) return;\n\n      const query = searchInput.value;\n      if (!query || !/^\\//.test(query)) {\n        initDom();\n        return;\n      }\n\n      // all cmd result\n      if (query === '/') {\n        renderList(data);\n        return;\n      }\n\n      const result = data.filter(i => new RegExp(query.substring(1)).test(i.cmd));\n      if (result.length > 0) {\n        renderList(result);\n      } else {\n        initDom();\n      }\n    }\n    searchInput.removeEventListener('input', cmdInput);\n    searchInput.addEventListener('input', cmdInput);\n  }\n}\n\nfunction initDom() {\n  const modelDom = document.querySelector('.chat-model-cmd-list');\n  if (modelDom) {\n    modelDom.innerHTML = '';\n  }\n  delete window.__CHAT_MODEL_CMD_PROMPT__;\n  delete window.__CHAT_MODEL_CMD__;\n  delete window.__CHAT_MODEL_STATUS__;\n  delete window.__cmd_list;\n  delete window.__cmd_index;\n}\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/core.js",
    "content": "// *** Core Script - IPC ***\n\nconst uid = () => window.crypto.getRandomValues(new Uint32Array(1))[0];\nfunction transformCallback(callback = () => {}, once = false) {\n  const identifier = uid();\n  const prop = `_${identifier}`;\n  Object.defineProperty(window, prop, {\n    value: (result) => {\n      if (once) {\n        Reflect.deleteProperty(window, prop);\n      }\n      return callback(result)\n    },\n    writable: false,\n    configurable: true,\n  })\n  return identifier;\n}\nasync function invoke(cmd, args) {\n  return new Promise((resolve, reject) => {\n    if (!window.__TAURI_POST_MESSAGE__) reject('__TAURI_POST_MESSAGE__ does not exist!');\n    const callback = transformCallback((e) => {\n      resolve(e);\n      Reflect.deleteProperty(window, `_${error}`);\n    }, true)\n    const error = transformCallback((e) => {\n      reject(e);\n      Reflect.deleteProperty(window, `_${callback}`);\n    }, true)\n    window.__TAURI_POST_MESSAGE__({\n      cmd,\n      callback,\n      error,\n      ...args\n    });\n  });\n}\n\nasync function message(message) {\n  invoke('messageDialog', {\n    __tauriModule: 'Dialog',\n    message: {\n      cmd: 'messageDialog',\n      message: message.toString(),\n      title: null,\n      type: null,\n      buttonLabel: null\n    }\n  });\n}\n\nwindow.uid = uid;\nwindow.invoke = invoke;\nwindow.message = message;\nwindow.transformCallback = transformCallback;\n\nasync function init() {\n  if (__TAURI_METADATA__.__currentWindow.label === 'tray') {\n    document.getElementsByTagName('html')[0].style['font-size'] = '70%';\n  }\n\n  async function platform() {\n    return invoke('platform', {\n      __tauriModule: 'Os',\n      message: { cmd: 'platform' }\n    });\n  }\n\n  if (__TAURI_METADATA__.__currentWindow.label !== 'tray') {\n    const _platform = await platform();\n    const chatConf = await invoke('get_app_conf') || {};\n    if (/darwin/.test(_platform) && !chatConf.titlebar) {\n      const topStyleDom = document.createElement(\"style\");\n      topStyleDom.innerHTML = `#chatgpt-app-window-top{position:fixed;top:0;z-index:999999999;width:100%;height:24px;background:transparent;cursor:grab;cursor:-webkit-grab;user-select:none;-webkit-user-select:none;}#chatgpt-app-window-top:active {cursor:grabbing;cursor:-webkit-grabbing;}`;\n      document.head.appendChild(topStyleDom);\n      const topDom = document.createElement(\"div\");\n      topDom.id = \"chatgpt-app-window-top\";\n      document.body.appendChild(topDom);\n\n      if (window.location.host === 'chat.openai.com') {\n        const nav = document.body.querySelector('nav');\n        if (nav) {\n          const currentPaddingTop = parseInt(window.getComputedStyle(document.querySelector('nav'), null).getPropertyValue('padding-top').replace('px', ''), 10);\n          const navStyleDom = document.createElement(\"style\");\n          navStyleDom.innerHTML = `nav{padding-top:${currentPaddingTop + topDom.clientHeight}px !important}`;\n          document.head.appendChild(navStyleDom);\n        }\n      }\n\n      topDom.addEventListener(\"mousedown\", () => invoke(\"drag_window\"));\n      topDom.addEventListener(\"touchstart\", () => invoke(\"drag_window\"));\n      topDom.addEventListener(\"dblclick\", () => invoke(\"fullscreen\"));\n    }\n  }\n\n  document.addEventListener(\"click\", (e) => {\n    const origin = e.target.closest(\"a\");\n    if (!origin || !origin.target) return;\n    if (origin && origin.href && origin.target !== '_self') {\n      invoke('open_link', { url: origin.href });\n    }\n  });\n\n  // Fix Chinese input method \"Enter\" on Safari\n  document.addEventListener(\"keydown\", (e) => {\n    if(e.keyCode == 229) e.stopPropagation();\n  }, true)\n\n  if (window.location.host === 'chat.openai.com') {\n    window.__sync_prompts = async function() {\n      await invoke('sync_prompts', { time: Date.now() });\n    }\n  }\n\n  coreZoom();\n}\n\nfunction coreZoom() {\n  const styleDom = document.createElement('style');\n  styleDom.innerHTML = `\n  #ZoomTopTip {\n    display: none;\n    position: fixed;\n    top: 0;\n    right: 20px;\n    background: #2a2a2a;\n    color: #fafafa;\n    padding: 20px 15px;\n    border-bottom-left-radius: 5px;\n    border-bottom-right-radius: 5px;\n    font-size: 16px;\n    font-weight: bold;\n    z-index: 999999;\n    box-shadow: 0 2px 2px 2px #d8d8d8;\n  }\n  .ZoomTopTipAni {\n    transition: opacity 200ms, display 200ms;\n    display: none;\n    opacity: 0;\n  }\n  `;\n  document.head.append(styleDom);\n  const zoomTipDom = document.createElement('div');\n  zoomTipDom.id = 'ZoomTopTip';\n  document.body.appendChild(zoomTipDom);\n  function zoom(callback) {\n    if (window.zoomSetTimeout) clearTimeout(window.zoomSetTimeout);\n    const htmlZoom = window.localStorage.getItem(\"htmlZoom\") || \"100%\";\n    const html = document.getElementsByTagName(\"html\")[0];\n    const zoom = callback(htmlZoom);\n    html.style.zoom = zoom;\n    window.localStorage.setItem(\"htmlZoom\", zoom);\n    zoomTipDom.innerHTML = zoom;\n    zoomTipDom.style.display = 'block';\n    zoomTipDom.classList.remove('ZoomTopTipAni');\n    window.zoomSetTimeout = setTimeout(() => {\n      zoomTipDom.classList.add('ZoomTopTipAni');\n    }, 2500);\n  }\n  function zoomDefault() {\n    const htmlZoom = window.localStorage.getItem(\"htmlZoom\");\n    if (htmlZoom) {\n      document.getElementsByTagName(\"html\")[0].style.zoom = htmlZoom;\n    }\n  }\n  function zoomIn() {\n    zoom((htmlZoom) => `${Math.min(parseInt(htmlZoom) + 10, 200)}%`);\n  }\n  function zoomOut() {\n    zoom((htmlZoom) => `${Math.max(parseInt(htmlZoom) - 10, 30)}%`);\n  }\n  function zoom0() {\n    zoom(() => `100%`);\n  }\n  zoomDefault();\n  window.__zoomIn = zoomIn;\n  window.__zoomOut = zoomOut;\n  window.__zoom0 = zoom0;\n}\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/dalle2.js",
    "content": "// *** Core Script - DALL·E 2 ***\n\nfunction init() {\n  document.addEventListener(\"click\", (e) => {\n    const origin = e.target.closest(\"a\");\n    if (!origin || !origin.target) return;\n    if (origin && origin.href && origin.target !== '_self') {\n      if (/\\/(login|signup)$/.test(window.location.href)) {\n        origin.target = '_self';\n      } else {\n        invoke('open_link', { url: origin.href });\n      }\n    }\n  });\n\n  if (window.searchInterval) {\n    clearInterval(window.searchInterval);\n  }\n\n  window.searchInterval = setInterval(() => {\n    const searchInput = document.querySelector('.image-prompt-form-wrapper form>.text-input');\n    if (searchInput) {\n      clearInterval(window.searchInterval);\n\n      if (!window.__CHATGPT_QUERY__) return;\n      const query = decodeURIComponent(window.__CHATGPT_QUERY__);\n      searchInput.focus();\n      searchInput.value = query;\n    }\n  }, 200)\n}\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/export.js",
    "content": "// *** Core Script - Export ***\n\nasync function init() {\n  if (window.location.pathname === '/auth/login') return;\n  const buttonOuterHTMLFallback = `<button class=\"btn flex justify-center gap-2 btn-neutral\" id=\"download-png-button\">Try Again</button>`;\n  removeButtons();\n  if (window.buttonsInterval) {\n    clearInterval(window.buttonsInterval);\n  }\n  if (window.innerWidth < 767) return;\n\n  const chatConf = await invoke('get_app_conf') || {};\n  window.buttonsInterval = setInterval(() => {\n    const actionsArea = document.querySelector(\"form>div>div\");\n    if (!actionsArea) {\n      return;\n    }\n\n    if (shouldAddButtons(actionsArea)) {\n      let TryAgainButton = actionsArea.querySelector(\"button\");\n      if (!TryAgainButton) {\n        const parentNode = document.createElement(\"div\");\n        parentNode.innerHTML = buttonOuterHTMLFallback;\n        TryAgainButton = parentNode.querySelector(\"button\");\n      }\n      addActionsButtons(actionsArea, TryAgainButton, chatConf);\n    } else if (shouldRemoveButtons()) {\n      removeButtons();\n    }\n  }, 1000);\n\n  const Format = {\n    PNG: \"png\",\n    PDF: \"pdf\",\n  };\n\n  function shouldRemoveButtons() {\n    if (document.querySelector(\"form .text-2xl\")) {\n      return true;\n    }\n    return false;\n  }\n\n  function shouldAddButtons(actionsArea) {\n    // first, check if there's a \"Try Again\" button and no other buttons\n    const buttons = actionsArea.querySelectorAll(\"button\");\n\n    const hasTryAgainButton = Array.from(buttons).some((button) => {\n      return !/download-/.test(button.id);\n    });\n\n    const stopBtn = buttons?.[0]?.innerText;\n\n    if (/Stop generating/ig.test(stopBtn)) {\n      return false;\n    }\n\n    if (buttons.length === 2 && (/Regenerate response/ig.test(stopBtn) || buttons[1].innerText === '')) {\n      return true;\n    }\n\n    if (hasTryAgainButton && buttons.length === 1) {\n      return true;\n    }\n\n    // otherwise, check if open screen is not visible\n    const isOpenScreen = document.querySelector(\"h1.text-4xl\");\n    if (isOpenScreen) {\n      return false;\n    }\n\n    // check if the conversation is finished and there are no share buttons\n    const finishedConversation = document.querySelector(\"form button>svg\");\n    const hasShareButtons = actionsArea.querySelectorAll(\"button[share-ext]\");\n    if (finishedConversation && !hasShareButtons.length) {\n      return true;\n    }\n\n    return false;\n  }\n\n  function removeButtons() {\n    const downloadPngButton = document.getElementById(\"download-png-button\");\n    const downloadPdfButton = document.getElementById(\"download-pdf-button\");\n    const downloadMdButton = document.getElementById(\"download-markdown-button\");\n    const refreshButton = document.getElementById(\"refresh-page-button\");\n    if (downloadPngButton) {\n      downloadPngButton.remove();\n    }\n    if (downloadPdfButton) {\n      downloadPdfButton.remove();\n    }\n    if (downloadPdfButton) {\n      downloadMdButton.remove();\n    }\n    if (refreshButton) {\n      refreshButton.remove();\n    }\n  }\n\n  function addActionsButtons(actionsArea, TryAgainButton) {\n    // Export markdown\n    const exportMd = TryAgainButton.cloneNode(true);\n    exportMd.id = \"download-markdown-button\";\n    exportMd.setAttribute(\"share-ext\", \"true\");\n    exportMd.title = \"Export Markdown\";\n\n    exportMd.innerHTML = setIcon('md');\n    exportMd.onclick = () => {\n      exportMarkdown();\n    };\n    actionsArea.appendChild(exportMd);\n\n    // Generate PNG\n    const downloadPngButton = TryAgainButton.cloneNode(true);\n    downloadPngButton.id = \"download-png-button\";\n    downloadPngButton.setAttribute(\"share-ext\", \"true\");\n    downloadPngButton.title = \"Generate PNG\";\n    downloadPngButton.innerHTML = setIcon('png');\n    downloadPngButton.onclick = () => {\n      downloadThread();\n    };\n    actionsArea.appendChild(downloadPngButton);\n\n    // Generate PDF\n    const downloadPdfButton = TryAgainButton.cloneNode(true);\n    downloadPdfButton.id = \"download-pdf-button\";\n    downloadPdfButton.setAttribute(\"share-ext\", \"true\");\n    downloadPdfButton.title = \"Download PDF\";\n    downloadPdfButton.innerHTML = setIcon('pdf');\n    downloadPdfButton.onclick = () => {\n      downloadThread({ as: Format.PDF });\n    };\n    actionsArea.appendChild(downloadPdfButton);\n\n    // Refresh\n    const refreshButton = TryAgainButton.cloneNode(true);\n    refreshButton.id = \"refresh-page-button\";\n    refreshButton.title = \"Refresh the Page\";\n    refreshButton.innerHTML = setIcon('refresh');\n    refreshButton.onclick = () => {\n      window.location.reload();\n    };\n    actionsArea.appendChild(refreshButton);\n  }\n\n  async function exportMarkdown() {\n    const content = Array.from(document.querySelectorAll('main .items-center>div')).map(i => {\n      let j = i.cloneNode(true);\n      if (/dark\\:bg-gray-800/.test(i.getAttribute('class'))) {\n        j.innerHTML = `<blockquote>${i.innerHTML}</blockquote>`;\n      }\n      return j.innerHTML;\n    }).join('');\n    const data = ExportMD.turndown(content);\n    const { id, filename } = getName();\n    await invoke('save_file', { name: `notes/${id}.md`, content: data });\n    await invoke('download_list', { pathname: 'chat.notes.json', filename, id, dir: 'notes' });\n  }\n\n  function downloadThread({ as = Format.PNG } = {}) {\n    const elements = new Elements();\n    elements.fixLocation();\n    const pixelRatio = window.devicePixelRatio;\n    const minRatio = as === Format.PDF ? 2 : 2.5;\n    window.devicePixelRatio = Math.max(pixelRatio, minRatio);\n\n    html2canvas(elements.thread, {\n      letterRendering: true,\n    }).then(async function (canvas) {\n      elements.restoreLocation();\n      window.devicePixelRatio = pixelRatio;\n      const imgData = canvas.toDataURL(\"image/png\");\n      requestAnimationFrame(() => {\n        if (as === Format.PDF) {\n          return handlePdf(imgData, canvas, pixelRatio);\n        } else {\n          handleImg(imgData);\n        }\n      });\n    });\n  }\n\n  async function handleImg(imgData) {\n    const binaryData = atob(imgData.split(\"base64,\")[1]);\n    const data = [];\n    for (let i = 0; i < binaryData.length; i++) {\n      data.push(binaryData.charCodeAt(i));\n    }\n    const { pathname, id, filename } = getName();\n    await invoke('download', { name: `download/img/${id}.png`, blob: data });\n    await invoke('download_list', { pathname, filename, id, dir: 'download' });\n  }\n\n  async function handlePdf(imgData, canvas, pixelRatio) {\n    const { jsPDF } = window.jspdf;\n    const orientation = canvas.width > canvas.height ? \"l\" : \"p\";\n    var pdf = new jsPDF(orientation, \"pt\", [\n      canvas.width / pixelRatio,\n      canvas.height / pixelRatio,\n    ]);\n    var pdfWidth = pdf.internal.pageSize.getWidth();\n    var pdfHeight = pdf.internal.pageSize.getHeight();\n    pdf.addImage(imgData, \"PNG\", 0, 0, pdfWidth, pdfHeight, '', 'FAST');\n    const { pathname, id, filename } = getName();\n    const data = pdf.__private__.getArrayBuffer(pdf.__private__.buildDocument());\n    await invoke('download', { name: `download/pdf/${id}.pdf`, blob: Array.from(new Uint8Array(data)) });\n    await invoke('download_list', { pathname, filename, id, dir: 'download' });\n  }\n\n  function getName() {\n    const id = window.crypto.getRandomValues(new Uint32Array(1))[0].toString(36);\n    const name = document.querySelector('nav .overflow-y-auto a.hover\\\\:bg-gray-800')?.innerText?.trim() || '';\n    return { filename: name ? name : id, id, pathname: 'chat.download.json' };\n  }\n\n  class Elements {\n    constructor() {\n      this.init();\n    }\n    init() {\n      // this.threadWrapper = document.querySelector(\".cdfdFe\");\n      this.spacer = document.querySelector(\"[class*='h-48'].w-full.flex-shrink-0\");\n      this.thread = document.querySelector(\n        \"[class*='react-scroll-to-bottom']>[class*='react-scroll-to-bottom']>div\"\n      );\n\n      // fix: old chat https://github.com/lencx/ChatGPT/issues/185\n      if (!this.thread) {\n        this.thread = document.querySelector(\"main .overflow-y-auto\");\n      }\n\n      // h-full overflow-y-auto\n      this.positionForm = document.querySelector(\"form\").parentNode;\n      // this.styledThread = document.querySelector(\"main\");\n      // this.threadContent = document.querySelector(\".gAnhyd\");\n      this.scroller = Array.from(\n        document.querySelectorAll('[class*=\"react-scroll-to\"]')\n      ).filter((el) => el.classList.contains(\"h-full\"))[0];\n\n      // fix: old chat\n      if (!this.scroller) {\n        this.scroller = document.querySelector('main .overflow-y-auto');\n      }\n\n      this.hiddens = Array.from(document.querySelectorAll(\".overflow-hidden\"));\n      this.images = Array.from(document.querySelectorAll(\"img[srcset]\"));\n    }\n    fixLocation() {\n      this.hiddens.forEach((el) => {\n        el.classList.remove(\"overflow-hidden\");\n      });\n      this.spacer.style.display = \"none\";\n      this.thread.style.maxWidth = \"960px\";\n      this.thread.style.marginInline = \"auto\";\n      this.positionForm.style.display = \"none\";\n      this.scroller.classList.remove(\"h-full\");\n      this.scroller.style.minHeight = \"100vh\";\n      this.images.forEach((img) => {\n        const srcset = img.getAttribute(\"srcset\");\n        img.setAttribute(\"srcset_old\", srcset);\n        img.setAttribute(\"srcset\", \"\");\n      });\n      //Fix to the text shifting down when generating the canvas\n      document.body.style.lineHeight = \"0.5\";\n    }\n    restoreLocation() {\n      this.hiddens.forEach((el) => {\n        el.classList.add(\"overflow-hidden\");\n      });\n      this.spacer.style.display = null;\n      this.thread.style.maxWidth = null;\n      this.thread.style.marginInline = null;\n      this.positionForm.style.display = null;\n      this.scroller.classList.add(\"h-full\");\n      this.scroller.style.minHeight = null;\n      this.images.forEach((img) => {\n        const srcset = img.getAttribute(\"srcset_old\");\n        img.setAttribute(\"srcset\", srcset);\n        img.setAttribute(\"srcset_old\", \"\");\n      });\n      document.body.style.lineHeight = null;\n    }\n  }\n\n  function setIcon(type) {\n    return {\n      // link: `<svg class=\"chatappico\" viewBox=\"0 0 1024 1024\"><path d=\"M1007.382 379.672L655.374 75.702C624.562 49.092 576 70.694 576 112.03v160.106C254.742 275.814 0 340.2 0 644.652c0 122.882 79.162 244.618 166.666 308.264 27.306 19.862 66.222-5.066 56.154-37.262C132.132 625.628 265.834 548.632 576 544.17V720c0 41.4 48.6 62.906 79.374 36.328l352.008-304c22.142-19.124 22.172-53.506 0-72.656z\" p-id=\"8506\" fill=\"currentColor\"></path></svg>`,\n      png: `<svg class=\"chatappico\" viewBox=\"0 0 1070 1024\"><path d=\"M981.783273 0H85.224727C38.353455 0 0 35.374545 0 83.083636v844.893091c0 47.616 38.353455 86.574545 85.178182 86.574546h903.633454c46.917818 0 81.733818-38.958545 81.733819-86.574546V83.083636C1070.592 35.374545 1028.701091 0 981.783273 0zM335.825455 135.912727c74.193455 0 134.330182 60.974545 134.330181 136.285091 0 75.170909-60.136727 136.192-134.330181 136.192-74.286545 0-134.516364-61.021091-134.516364-136.192 0-75.264 60.229818-136.285091 134.516364-136.285091z m-161.512728 745.937455a41.890909 41.890909 0 0 1-27.648-10.379637 43.752727 43.752727 0 0 1-4.654545-61.067636l198.097454-255.162182a42.123636 42.123636 0 0 1 57.716364-6.702545l116.549818 128.139636 286.906182-352.814545c14.615273-18.711273 90.251636-106.775273 135.866182-6.935273 0.093091-0.093091 0.093091 112.965818 0.232727 247.761455 0.093091 140.8 0.093091 317.067636 0.093091 317.067636-1.024-0.093091-762.740364 0.093091-763.112727 0.093091z\" fill=\"currentColor\"></path></svg>`,\n      pdf: `<svg class=\"chatappico pdf\" viewBox=\"0 0 1024 1024\"><path d=\"M821.457602 118.382249H205.725895c-48.378584 0-87.959995 39.583368-87.959996 87.963909v615.731707c0 48.378584 39.581411 87.959995 87.959996 87.959996h615.733664c48.380541 0 87.961952-39.581411 87.961952-87.959996V206.346158c-0.001957-48.378584-39.583368-87.963909-87.963909-87.963909zM493.962468 457.544987c-10.112054 32.545237-21.72487 82.872662-38.806571 124.248336-8.806957 22.378397-8.380404 18.480717-15.001764 32.609808l5.71738-1.851007c58.760658-16.443827 99.901532-20.519564 138.162194-27.561607-7.67796-6.06371-14.350194-10.751884-19.631237-15.586807-26.287817-29.101504-35.464584-34.570387-70.440002-111.862636v0.003913z m288.36767 186.413594c-7.476424 8.356924-20.670227 13.191847-40.019704 13.191847-33.427694 0-63.808858-9.229597-107.79277-31.660824-75.648648 8.356924-156.097 17.214754-201.399704 31.729308-2.199293 0.876587-4.832967 1.759043-7.916674 3.077836-54.536215 93.237125-95.031389 132.767663-130.621199 131.19646-11.286054-0.49895-27.694661-7.044-32.973748-10.11988l-6.52157-6.196764-2.29517-4.353583c-3.07588-7.91863-3.954423-15.395054-2.197337-23.751977 4.838837-23.309771 29.907651-60.251638 82.686779-93.237126 8.356924-6.159587 27.430511-15.897917 45.020944-24.25484 13.311204-21.177004 19.45905-34.744531 36.341171-72.259702 19.102937-45.324228 36.505531-99.492589 47.500041-138.191543v-0.44025c-16.267727-53.219378-25.945401-89.310095-9.67376-147.80856 3.958337-16.71189 18.46702-33.864031 34.748444-33.864031h10.552304c10.115967 0 19.791684 3.520043 26.829814 10.552304 29.029107 29.031064 15.39114 103.824649 0.8805 162.323113-0.8805 2.63563-1.322707 4.832967-1.761 6.153717 17.59239 49.697378 45.400538 98.774492 73.108895 121.647926 11.436717 8.791304 22.638634 18.899444 36.71098 26.814161 19.791684-2.20125 37.517128-4.11487 55.547812-4.11487 54.540128 0 87.525615 9.67963 100.279169 30.351814 4.400543 7.034217 6.595923 15.389184 5.281043 24.1844-0.44025 10.996467-4.39663 21.112434-12.31526 29.031064z m-27.796407-36.748157c-4.394673-4.398587-17.024957-16.936907-78.601259-16.936907-3.073923 0-10.622744-0.784623-14.57521 3.612007 32.104987 14.072347 62.830525 24.757704 83.058545 24.757703 3.083707 0 5.72325-0.442207 8.356923-0.876586h1.759044c2.20125-0.8805 3.520043-1.324663 3.960293-5.71738-0.87463-1.324663-1.757087-3.083707-3.958336-4.838837z m-387.124553 63.041845c-9.237424 5.27713-16.71189 10.112054-21.112433 13.634053-31.226444 28.586901-51.018128 57.616008-53.217422 74.331812 19.789727-6.59788 45.737084-35.626987 74.329855-87.961952v-0.003913z m125.574957-297.822284l2.197336-1.761c3.079793-14.072347 5.232127-29.189554 7.87167-38.869184l1.318794-7.036174c4.39663-25.070771 2.71781-39.720334-4.76057-50.272637l-6.59788-2.20125a57.381208 57.381208 0 0 0-3.079794 5.27713c-7.474467 18.47289-7.063567 55.283661 3.0524 94.865072l-0.001956-0.001957z\" fill=\"currentColor\"></path></svg>`,\n      md: `<svg class=\"chatappico md\" viewBox=\"0 0 1024 1024\" width=\"200\" height=\"200\"><path d=\"M128 128h768a42.666667 42.666667 0 0 1 42.666667 42.666667v682.666666a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667V170.666667a42.666667 42.666667 0 0 1 42.666667-42.666667z m170.666667 533.333333v-170.666666l85.333333 85.333333 85.333333-85.333333v170.666666h85.333334v-298.666666h-85.333334l-85.333333 85.333333-85.333333-85.333333H213.333333v298.666666h85.333334z m469.333333-128v-170.666666h-85.333333v170.666666h-85.333334l128 128 128-128h-85.333333z\" p-id=\"1381\" fill=\"currentColor\"></path></svg>`,\n      refresh: `<svg class=\"chatappico refresh\" viewBox=\"0 0 1024 1024\"><path d=\"M512 63.5C264.3 63.5 63.5 264.3 63.5 512S264.3 960.5 512 960.5 960.5 759.7 960.5 512 759.7 63.5 512 63.5zM198 509.6h87.6c0-136.3 102.3-243.4 233.7-238.5 43.8 0 82.8 14.6 121.7 34.1L597.2 349c-24.4-9.8-53.6-19.5-82.8-19.5-92.5 0-170.4 77.9-170.4 180.1h87.6L314.8 631.3 198 509.6z m540.3-0.1c0 131.4-102.2 243.4-228.8 243.4-43.8 0-82.8-19.4-121.7-38.9l43.8-43.8c24.4 9.8 53.6 19.5 82.8 19.5 92.5 0 170.4-77.9 170.4-180.1h-92.5l116.9-121.7L826 509.5h-87.7z\" fill=\"currentColor\"></path></svg>`,\n    }[type];\n  }\n}\n\nwindow.addEventListener('resize', init);\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/markdown.export.js",
    "content": "var ExportMD = (function () {\n  if (!TurndownService || !turndownPluginGfm) return;\n  const hljsREG = /^.*(hljs).*(language-[a-z0-9]+).*$/i;\n  const gfm = turndownPluginGfm.gfm\n  const turndownService = new TurndownService({\n    hr: '---'\n  })\n    .use(gfm)\n    .addRule('code', {\n      filter: (node) => {\n        if (node.nodeName === 'CODE' && hljsREG.test(node.classList.value)) {\n          return 'code';\n        }\n      },\n      replacement: (content, node) => {\n        const classStr = node.getAttribute('class');\n        if (hljsREG.test(classStr)) {\n          const lang = classStr.match(/.*language-(\\w+)/)[1];\n          if (lang) {\n            return `\\`\\`\\`${lang}\\n${content}\\n\\`\\`\\``;\n          }\n          return `\\`\\`\\`\\n${content}\\n\\`\\`\\``;\n        }\n      }\n    })\n    .addRule('ignore', {\n      filter: ['button', 'img'],\n      replacement: () => '',\n    })\n    .addRule('table', {\n      filter: 'table',\n      replacement: function(content, node) {\n        return `\\`\\`\\`${content}\\n\\`\\`\\``;\n      },\n    });\n\n  return turndownService;\n}({}));\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/scripts/popup.core.js",
    "content": "// *** Core Script - DALL·E 2 Core ***\n\nasync function init() {\n  const chatConf = await invoke('get_app_conf') || {};\n  if (!chatConf.popup_search) return;\n  if (!window.FloatingUIDOM) return;\n\n  const styleDom = document.createElement('style');\n  styleDom.innerHTML = `\n  #chagpt-selection-menu {\n    display: none;\n    width: max-content;\n    position: absolute;\n    top: 0;\n    left: 0;\n    background: #4a4a4a;\n    color: white;\n    font-weight: bold;\n    padding: 3px 5px;\n    border-radius: 2px;\n    font-size: 10px;\n    cursor: pointer;\n  }\n  `;\n  document.head.append(styleDom);\n\n  const selectionMenu = document.createElement('div');\n  selectionMenu.id = 'chagpt-selection-menu';\n  selectionMenu.innerHTML = 'DALL·E 2';\n  document.body.appendChild(selectionMenu);\n  const { computePosition, flip, offset, shift } = window.FloatingUIDOM;\n\n  document.body.addEventListener('mousedown', async (e) => {\n    selectionMenu.style.display = 'none';\n    if (e.target.id === 'chagpt-selection-menu') {\n      await invoke('dalle2_search_window', { query: encodeURIComponent(window.__DALLE2_CONTENT__) });\n    } else {\n      delete window.__DALLE2_CONTENT__;\n    }\n  });\n\n  document.body.addEventListener(\"mouseup\", async (e) => {\n    selectionMenu.style.display = 'none';\n    const selection = window.getSelection();\n    window.__DALLE2_CONTENT__ = selection.toString().trim();\n\n    if (!window.__DALLE2_CONTENT__) return;\n\n    if (selection.rangeCount > 0) {\n      const range = selection.getRangeAt(0);\n      const rect = range.getClientRects()[0];\n\n      const rootEl = document.createElement('div');\n      rootEl.style.top = `${rect.top}px`;\n      rootEl.style.position = 'fixed';\n      rootEl.style.left = `${rect.left}px`;\n      document.body.appendChild(rootEl);\n\n      selectionMenu.style.display = 'block';\n      computePosition(rootEl, selectionMenu, {\n        placement: 'top',\n        middleware: [\n          flip(),\n          offset(5),\n          shift({ padding: 5 })\n        ]\n      }).then(({x, y}) => {\n        Object.assign(selectionMenu.style, {\n          left: `${x}px`,\n          top: `${y}px`,\n        });\n      });\n    }\n  });\n}\n\nif (\n  document.readyState === \"complete\" ||\n  document.readyState === \"interactive\"\n) {\n  init();\n} else {\n  document.addEventListener(\"DOMContentLoaded\", init);\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/utils.rs",
    "content": "use anyhow::Result;\nuse log::{error, info};\nuse regex::Regex;\nuse serde_json::Value;\nuse std::{\n  collections::HashMap,\n  fs::{self, File},\n  path::{Path, PathBuf},\n  process::Command,\n};\nuse tauri::updater::UpdateResponse;\nuse tauri::{utils::config::Config, AppHandle, Manager, Wry};\n\npub fn app_root() -> PathBuf {\n  tauri::api::path::home_dir().unwrap().join(\".chatgpt\")\n}\n\npub fn get_tauri_conf() -> Option<Config> {\n  let config_file = include_str!(\"../tauri.conf.json\");\n  let config: Config = serde_json::from_str(config_file).expect(\"failed to parse tauri.conf.json\");\n  Some(config)\n}\n\npub fn exists(path: &Path) -> bool {\n  Path::new(path).exists()\n}\n\npub fn create_file(path: &Path) -> Result<File> {\n  if let Some(p) = path.parent() {\n    fs::create_dir_all(p)?\n  }\n  File::create(path).map_err(Into::into)\n}\n\npub fn create_chatgpt_prompts() {\n  let sync_file = app_root().join(\"cache_model\").join(\"chatgpt_prompts.json\");\n  if !exists(&sync_file) {\n    create_file(&sync_file).unwrap();\n    fs::write(&sync_file, \"[]\").unwrap();\n  }\n}\n\npub fn script_path() -> PathBuf {\n  let script_file = app_root().join(\"main.js\");\n  if !exists(&script_file) {\n    create_file(&script_file).unwrap();\n    fs::write(\n      &script_file,\n      format!(\n        \"// *** ChatGPT User Script ***\\n// @github: https://github.com/lencx/ChatGPT \\n// @path: {}\\n\\nconsole.log('🤩 Hello ChatGPT!!!');\",\n        &script_file.to_string_lossy()\n      ),\n    )\n    .unwrap();\n  }\n\n  script_file\n}\n\npub fn user_script() -> String {\n  let user_script_content = fs::read_to_string(script_path()).unwrap_or_else(|_| \"\".to_string());\n  format!(\n    \"window.addEventListener('DOMContentLoaded', function() {{\\n{}\\n}})\",\n    user_script_content\n  )\n}\n\npub fn open_file(path: PathBuf) {\n  let pathname = convert_path(path.to_str().unwrap());\n  info!(\"open_file: {}\", pathname);\n  #[cfg(target_os = \"macos\")]\n  Command::new(\"open\")\n    .arg(\"-R\")\n    .arg(pathname)\n    .spawn()\n    .unwrap();\n\n  #[cfg(target_os = \"windows\")]\n  Command::new(\"explorer.exe\")\n    .arg(\"/select,\")\n    .arg(pathname)\n    .spawn()\n    .unwrap();\n\n  // https://askubuntu.com/a/31071\n  #[cfg(target_os = \"linux\")]\n  Command::new(\"xdg-open\").arg(pathname).spawn().unwrap();\n}\n\npub fn convert_path(path_str: &str) -> String {\n  if cfg!(target_os = \"windows\") {\n    path_str.replace('/', \"\\\\\")\n  } else {\n    String::from(path_str)\n  }\n}\n\npub fn clear_conf(app: &tauri::AppHandle) {\n  let root = app_root();\n  let msg = format!(\n    \"Path: {}\\n\n    Are you sure you want to clear all ChatGPT configurations? Performing this operation data can not be restored, please back up in advance.\\n\n    Note: The application will exit automatically after the configuration cleanup!\",\n    root.to_string_lossy()\n  );\n  tauri::api::dialog::ask(\n    app.get_window(\"core\").as_ref(),\n    \"Clear Config\",\n    msg,\n    move |is_ok| {\n      if is_ok {\n        fs::remove_dir_all(root).unwrap();\n        std::process::exit(0);\n      }\n    },\n  );\n}\n\npub fn merge(v: &Value, fields: &HashMap<String, Value>) -> Value {\n  match v {\n    Value::Object(m) => {\n      let mut m = m.clone();\n      for (k, v) in fields {\n        m.insert(k.clone(), v.clone());\n      }\n      Value::Object(m)\n    }\n    v => v.clone(),\n  }\n}\n\npub fn gen_cmd(name: String) -> String {\n  let re = Regex::new(r\"[^a-zA-Z0-9]\").unwrap();\n  re.replace_all(&name, \"_\").to_lowercase()\n}\n\npub async fn get_data(\n  url: &str,\n  app: Option<&tauri::AppHandle>,\n) -> Result<Option<String>, reqwest::Error> {\n  let res = reqwest::get(url).await?;\n  let is_ok = res.status() == 200;\n  let body = res.text().await?;\n\n  if is_ok {\n    Ok(Some(body))\n  } else {\n    error!(\"chatgpt_http: {}\", body);\n    if let Some(v) = app {\n      tauri::api::dialog::message(v.get_window(\"core\").as_ref(), \"ChatGPT HTTP\", body);\n    }\n    Ok(None)\n  }\n}\n\npub fn run_check_update(app: AppHandle<Wry>, silent: bool, has_msg: Option<bool>) {\n  info!(\"run_check_update: silent={} has_msg={:?}\", silent, has_msg);\n  tauri::async_runtime::spawn(async move {\n    if let Ok(update_resp) = app.updater().check().await {\n      if update_resp.is_update_available() {\n        if silent {\n          tauri::async_runtime::spawn(async move {\n            silent_install(app, update_resp).await.unwrap();\n          });\n        } else {\n          tauri::async_runtime::spawn(async move {\n            prompt_for_install(app, update_resp).await.unwrap();\n          });\n        }\n      } else if let Some(v) = has_msg {\n        if v {\n          tauri::api::dialog::message(\n            app.app_handle().get_window(\"core\").as_ref(),\n            \"ChatGPT\",\n            \"Your ChatGPT is up to date\",\n          );\n        }\n      }\n    }\n  });\n}\n\n// Copy private api in tauri/updater/mod.rs. TODO: refactor to public api\n// Prompt a dialog asking if the user want to install the new version\n// Maybe we should add an option to customize it in future versions.\npub async fn prompt_for_install(app: AppHandle<Wry>, update: UpdateResponse<Wry>) -> Result<()> {\n  info!(\"prompt_for_install\");\n  let windows = app.windows();\n  let parent_window = windows.values().next();\n  let package_info = app.package_info().clone();\n\n  let body = update.body().unwrap();\n  // todo(lemarier): We should review this and make sure we have\n  // something more conventional.\n  let should_install = tauri::api::dialog::blocking::ask(\n    parent_window,\n    format!(r#\"A new version of {} is available! \"#, package_info.name),\n    format!(\n      r#\"{} {} is now available -- you have {}.\n\nWould you like to install it now?\n\nRelease Notes:\n{}\"#,\n      package_info.name,\n      update.latest_version(),\n      package_info.version,\n      body\n    ),\n  );\n\n  if should_install {\n    // Launch updater download process\n    // macOS we display the `Ready to restart dialog` asking to restart\n    // Windows is closing the current App and launch the downloaded MSI when ready (the process stop here)\n    // Linux we replace the AppImage by launching a new install, it start a new AppImage instance, so we're closing the previous. (the process stop here)\n    update.download_and_install().await?;\n\n    // Ask user if we need to restart the application\n    let should_exit = tauri::api::dialog::blocking::ask(\n      parent_window,\n      \"Ready to Restart\",\n      \"The installation was successful, do you want to restart the application now?\",\n    );\n    if should_exit {\n      app.restart();\n    }\n  }\n\n  Ok(())\n}\n\npub async fn silent_install(app: AppHandle<Wry>, update: UpdateResponse<Wry>) -> Result<()> {\n  info!(\"silent_install\");\n  let windows = app.windows();\n  let parent_window = windows.values().next();\n\n  // Launch updater download process\n  // macOS we display the `Ready to restart dialog` asking to restart\n  // Windows is closing the current App and launch the downloaded MSI when ready (the process stop here)\n  // Linux we replace the AppImage by launching a new install, it start a new AppImage instance, so we're closing the previous. (the process stop here)\n  update.download_and_install().await?;\n\n  // Ask user if we need to restart the application\n  let should_exit = tauri::api::dialog::blocking::ask(\n    parent_window,\n    \"Ready to Restart\",\n    \"The silent installation was successful, do you want to restart the application now?\",\n  );\n  if should_exit {\n    app.restart();\n  }\n\n  Ok(())\n}\n\npub fn is_hidden(entry: &walkdir::DirEntry) -> bool {\n  entry\n    .file_name()\n    .to_str()\n    .map(|s| s.starts_with('.'))\n    .unwrap_or(false)\n}\n\npub fn vec_to_hashmap(\n  vec: impl Iterator<Item = serde_json::Value>,\n  key: &str,\n  map: &mut HashMap<String, serde_json::Value>,\n) {\n  for v in vec {\n    if let Some(kval) = v.get(key).and_then(serde_json::Value::as_str) {\n      map.insert(kval.to_string(), v);\n    }\n  }\n}\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/floating-ui-core.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],e):e((t=\"undefined\"!=typeof globalThis?globalThis:t||self).FloatingUICore={})}(this,(function(t){\"use strict\";function e(t){return t.split(\"-\")[1]}function n(t){return\"y\"===t?\"height\":\"width\"}function i(t){return t.split(\"-\")[0]}function o(t){return[\"top\",\"bottom\"].includes(i(t))?\"x\":\"y\"}function r(t,r,a){let{reference:l,floating:s}=t;const f=l.x+l.width/2-s.width/2,c=l.y+l.height/2-s.height/2,u=o(r),m=n(u),d=l[m]/2-s[m]/2,g=\"x\"===u;let p;switch(i(r)){case\"top\":p={x:f,y:l.y-s.height};break;case\"bottom\":p={x:f,y:l.y+l.height};break;case\"right\":p={x:l.x+l.width,y:c};break;case\"left\":p={x:l.x-s.width,y:c};break;default:p={x:l.x,y:l.y}}switch(e(r)){case\"start\":p[u]-=d*(a&&g?-1:1);break;case\"end\":p[u]+=d*(a&&g?-1:1)}return p}function a(t){return\"number\"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function s(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:f,strategy:c}=t,{boundary:u=\"clippingAncestors\",rootBoundary:m=\"viewport\",elementContext:d=\"floating\",altBoundary:g=!1,padding:p=0}=e,h=a(p),y=f[g?\"floating\"===d?\"reference\":\"floating\":d],x=l(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(f.floating)),boundary:u,rootBoundary:m,strategy:c})),w=\"floating\"===d?{...s.floating,x:i,y:o}:s.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(f.floating)),b=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},R=l(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:v,strategy:c}):w);return{top:(x.top-R.top+h.top)/b.y,bottom:(R.bottom-x.bottom+h.bottom)/b.y,left:(x.left-R.left+h.left)/b.x,right:(R.right-x.right+h.right)/b.x}}const f=Math.min,c=Math.max;function u(t,e,n){return c(t,f(e,n))}const m=[\"top\",\"right\",\"bottom\",\"left\"],d=m.reduce(((t,e)=>t.concat(e,e+\"-start\",e+\"-end\")),[]),g={left:\"right\",right:\"left\",bottom:\"top\",top:\"bottom\"};function p(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function h(t,i,r){void 0===r&&(r=!1);const a=e(t),l=o(t),s=n(l);let f=\"x\"===l?a===(r?\"end\":\"start\")?\"right\":\"left\":\"start\"===a?\"bottom\":\"top\";return i.reference[s]>i.floating[s]&&(f=p(f)),{main:f,cross:p(f)}}const y={start:\"end\",end:\"start\"};function x(t){return t.replace(/start|end/g,(t=>y[t]))}function w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function v(t){return m.some((e=>t[e]>=0))}function b(t){return\"x\"===t?\"y\":\"x\"}t.arrow=t=>({name:\"arrow\",options:t,async fn(i){const{element:r,padding:l=0}=t||{},{x:s,y:f,placement:c,rects:m,platform:d}=i;if(null==r)return{};const g=a(l),p={x:s,y:f},h=o(c),y=n(h),x=await d.getDimensions(r),w=\"y\"===h?\"top\":\"left\",v=\"y\"===h?\"bottom\":\"right\",b=m.reference[y]+m.reference[h]-p[h]-m.floating[y],R=p[h]-m.reference[h],A=await(null==d.getOffsetParent?void 0:d.getOffsetParent(r));let P=A?\"y\"===h?A.clientHeight||0:A.clientWidth||0:0;0===P&&(P=m.floating[y]);const T=b/2-R/2,O=g[w],D=P-x[y]-g[v],E=P/2-x[y]/2+T,L=u(O,E,D),k=null!=e(c)&&E!=L&&m.reference[y]/2-(E<O?g[w]:g[v])-x[y]/2<0;return{[h]:p[h]-(k?E<O?O-E:D-E:0),data:{[h]:L,centerOffset:E-L}}}}),t.autoPlacement=function(t){return void 0===t&&(t={}),{name:\"autoPlacement\",options:t,async fn(n){var o,r,a;const{rects:l,middlewareData:f,placement:c,platform:u,elements:m}=n,{alignment:g,allowedPlacements:p=d,autoAlignment:y=!0,...w}=t,v=void 0!==g||p===d?function(t,n,o){return(t?[...o.filter((n=>e(n)===t)),...o.filter((n=>e(n)!==t))]:o.filter((t=>i(t)===t))).filter((i=>!t||e(i)===t||!!n&&x(i)!==i))}(g||null,y,p):p,b=await s(n,w),R=(null==(o=f.autoPlacement)?void 0:o.index)||0,A=v[R];if(null==A)return{};const{main:P,cross:T}=h(A,l,await(null==u.isRTL?void 0:u.isRTL(m.floating)));if(c!==A)return{reset:{placement:v[0]}};const O=[b[i(A)],b[P],b[T]],D=[...(null==(r=f.autoPlacement)?void 0:r.overflows)||[],{placement:A,overflows:O}],E=v[R+1];if(E)return{data:{index:R+1,overflows:D},reset:{placement:E}};const L=D.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),k=null==(a=L.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:a.placement,C=k||L[0].placement;return C!==c?{data:{index:R+1,overflows:D},reset:{placement:C}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:i=\"bottom\",strategy:o=\"absolute\",middleware:a=[],platform:l}=n,s=a.filter(Boolean),f=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:m}=r(c,i,f),d=i,g={},p=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:y,y:x,data:w,reset:v}=await h({x:u,y:m,initialPlacement:i,placement:d,strategy:o,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});u=null!=y?y:u,m=null!=x?x:m,g={...g,[a]:{...g[a],...w}},v&&p<=50&&(p++,\"object\"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:u,y:m}=r(c,d,f))),n=-1)}return{x:u,y:m,placement:d,strategy:o,middlewareData:g}},t.detectOverflow=s,t.flip=function(t){return void 0===t&&(t={}),{name:\"flip\",options:t,async fn(n){var o;const{placement:r,middlewareData:a,rects:l,initialPlacement:f,platform:c,elements:u}=n,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:y=\"bestFit\",fallbackAxisSideDirection:w=\"none\",flipAlignment:v=!0,...b}=t,R=i(r),A=i(f)===f,P=await(null==c.isRTL?void 0:c.isRTL(u.floating)),T=g||(A||!v?[p(f)]:function(t){const e=p(t);return[x(t),e,x(e)]}(f));g||\"none\"===w||T.push(...function(t,n,o,r){const a=e(t);let l=function(t,e,n){const i=[\"left\",\"right\"],o=[\"right\",\"left\"],r=[\"top\",\"bottom\"],a=[\"bottom\",\"top\"];switch(t){case\"top\":case\"bottom\":return n?e?o:i:e?i:o;case\"left\":case\"right\":return e?r:a;default:return[]}}(i(t),\"start\"===o,r);return a&&(l=l.map((t=>t+\"-\"+a)),n&&(l=l.concat(l.map(x)))),l}(f,v,w,P));const O=[f,...T],D=await s(n,b),E=[];let L=(null==(o=a.flip)?void 0:o.overflows)||[];if(m&&E.push(D[R]),d){const{main:t,cross:e}=h(r,l,P);E.push(D[t],D[e])}if(L=[...L,{placement:r,overflows:E}],!E.every((t=>t<=0))){var k;const t=((null==(k=a.flip)?void 0:k.index)||0)+1,e=O[t];if(e)return{data:{index:t,overflows:L},reset:{placement:e}};let n=\"bottom\";switch(y){case\"bestFit\":{var C;const t=null==(C=L.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:C[0].placement;t&&(n=t);break}case\"initialPlacement\":n=f}if(r!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:\"hide\",options:t,async fn(e){const{strategy:n=\"referenceHidden\",...i}=t,{rects:o}=e;switch(n){case\"referenceHidden\":{const t=w(await s(e,{...i,elementContext:\"reference\"}),o.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:v(t)}}}case\"escaped\":{const t=w(await s(e,{...i,altBoundary:!0}),o.floating);return{data:{escapedOffsets:t,escaped:v(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:\"inline\",options:t,async fn(e){const{placement:n,elements:r,rects:s,platform:u,strategy:m}=e,{padding:d=2,x:g,y:p}=t,h=l(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({rect:s.reference,offsetParent:await(null==u.getOffsetParent?void 0:u.getOffsetParent(r.floating)),strategy:m}):s.reference),y=await(null==u.getClientRects?void 0:u.getClientRects(r.reference))||[],x=a(d);const w=await u.getElementRects({reference:{getBoundingClientRect:function(){if(2===y.length&&y[0].left>y[1].right&&null!=g&&null!=p)return y.find((t=>g>t.left-x.left&&g<t.right+x.right&&p>t.top-x.top&&p<t.bottom+x.bottom))||h;if(y.length>=2){if(\"x\"===o(n)){const t=y[0],e=y[y.length-1],o=\"top\"===i(n),r=t.top,a=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:a,left:l,right:s,width:s-l,height:a-r,x:l,y:r}}const t=\"left\"===i(n),e=c(...y.map((t=>t.right))),r=f(...y.map((t=>t.left))),a=y.filter((n=>t?n.left===r:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:r,right:e,width:e-r,height:s-l,x:r,y:l}}return h}},floating:r.floating,strategy:m});return s.reference.x!==w.reference.x||s.reference.y!==w.reference.y||s.reference.width!==w.reference.width||s.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:a,rects:l,middlewareData:s}=e,{offset:f=0,mainAxis:c=!0,crossAxis:u=!0}=t,m={x:n,y:r},d=o(a),g=b(d);let p=m[d],h=m[g];const y=\"function\"==typeof f?f(e):f,x=\"number\"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const t=\"y\"===d?\"height\":\"width\",e=l.reference[d]-l.floating[t]+x.mainAxis,n=l.reference[d]+l.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(u){var w,v;const t=\"y\"===d?\"width\":\"height\",e=[\"top\",\"left\"].includes(i(a)),n=l.reference[g]-l.floating[t]+(e&&(null==(w=s.offset)?void 0:w[g])||0)+(e?0:x.crossAxis),o=l.reference[g]+l.reference[t]+(e?0:(null==(v=s.offset)?void 0:v[g])||0)-(e?x.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[d]:p,[g]:h}}}},t.offset=function(t){return void 0===t&&(t=0),{name:\"offset\",options:t,async fn(n){const{x:r,y:a}=n,l=await async function(t,n){const{placement:r,platform:a,elements:l}=t,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),f=i(r),c=e(r),u=\"x\"===o(r),m=[\"left\",\"top\"].includes(f)?-1:1,d=s&&u?-1:1,g=\"function\"==typeof n?n(t):n;let{mainAxis:p,crossAxis:h,alignmentAxis:y}=\"number\"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return c&&\"number\"==typeof y&&(h=\"end\"===c?-1*y:y),u?{x:h*d,y:p*m}:{x:p*m,y:h*d}}(n,t);return{x:r+l.x,y:a+l.y,data:l}}}},t.rectToClientRect=l,t.shift=function(t){return void 0===t&&(t={}),{name:\"shift\",options:t,async fn(e){const{x:n,y:r,placement:a}=e,{mainAxis:l=!0,crossAxis:f=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=t,d={x:n,y:r},g=await s(e,m),p=o(i(a)),h=b(p);let y=d[p],x=d[h];if(l){const t=\"y\"===p?\"bottom\":\"right\";y=u(y+g[\"y\"===p?\"top\":\"left\"],y,y-g[t])}if(f){const t=\"y\"===h?\"bottom\":\"right\";x=u(x+g[\"y\"===h?\"top\":\"left\"],x,x-g[t])}const w=c.fn({...e,[p]:y,[h]:x});return{...w,data:{x:w.x-n,y:w.y-r}}}}},t.size=function(t){return void 0===t&&(t={}),{name:\"size\",options:t,async fn(n){const{placement:o,rects:r,platform:a,elements:l}=n,{apply:f=(()=>{}),...u}=t,m=await s(n,u),d=i(o),g=e(o);let p,h;\"top\"===d||\"bottom\"===d?(p=d,h=g===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?\"start\":\"end\")?\"left\":\"right\"):(h=d,p=\"end\"===g?\"top\":\"bottom\");const y=c(m.left,0),x=c(m.right,0),w=c(m.top,0),v=c(m.bottom,0),b={availableHeight:r.floating.height-([\"left\",\"right\"].includes(o)?2*(0!==w||0!==v?w+v:c(m.top,m.bottom)):m[p]),availableWidth:r.floating.width-([\"top\",\"bottom\"].includes(o)?2*(0!==y||0!==x?y+x:c(m.left,m.right)):m[h])};await f({...n,...b});const R=await a.getDimensions(l.floating);return r.floating.width!==R.width||r.floating.height!==R.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,\"__esModule\",{value:!0})}));"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/floating-ui-dom.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"@floating-ui/core\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"@floating-ui/core\"],e):e((t=\"undefined\"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){\"use strict\";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}function i(t){return s(t)?(t.nodeName||\"\").toLowerCase():\"\"}let r;function l(){if(r)return r;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(r=t.brands.map((t=>t.brand+\"/\"+t.version)).join(\" \"),r):navigator.userAgent}function c(t){return t instanceof n(t).HTMLElement}function f(t){return t instanceof n(t).Element}function s(t){return t instanceof n(t).Node}function u(t){if(\"undefined\"==typeof ShadowRoot)return!1;return t instanceof n(t).ShadowRoot||t instanceof ShadowRoot}function a(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&![\"inline\",\"contents\"].includes(r)}function d(t){return[\"table\",\"td\",\"th\"].includes(i(t))}function h(t){const e=/firefox/i.test(l()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return\"none\"!==n.transform||\"none\"!==n.perspective||!!i&&\"none\"!==i||e&&\"filter\"===n.willChange||e&&!!n.filter&&\"none\"!==n.filter||[\"transform\",\"perspective\"].some((t=>n.willChange.includes(t)))||[\"paint\",\"layout\",\"strict\",\"content\"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function p(){return!/^((?!chrome|android).)*safari/i.test(l())}function g(t){return[\"html\",\"body\",\"#document\"].includes(i(t))}const m=Math.min,y=Math.max,b=Math.round;function w(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const r=t.offsetWidth,l=t.offsetHeight,c=b(n)!==r||b(i)!==l;return c&&(n=r,i=l),{width:n,height:i,fallback:c}}function x(t){return f(t)?t:t.contextElement}const v={x:1,y:1};function L(t){const e=x(t);if(!c(e))return v;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:r}=w(e);let l=(r?b(n.width):n.width)/o,f=(r?b(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),f&&Number.isFinite(f)||(f=1),{x:l,y:f}}function T(t,e,o,i){var r,l;void 0===e&&(e=!1),void 0===o&&(o=!1);const c=t.getBoundingClientRect(),s=x(t);let u=v;e&&(i?f(i)&&(u=L(i)):u=L(t));const a=s?n(s):window,d=!p()&&o;let h=(c.left+(d&&(null==(r=a.visualViewport)?void 0:r.offsetLeft)||0))/u.x,g=(c.top+(d&&(null==(l=a.visualViewport)?void 0:l.offsetTop)||0))/u.y,m=c.width/u.x,y=c.height/u.y;if(s){const t=n(s),e=i&&f(i)?n(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=L(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,h*=t.x,g*=t.y,m*=t.x,y*=t.y,h+=e.x,g+=e.y,o=n(o).frameElement}}return{width:m,height:y,top:g,right:h+m,bottom:g+y,left:h,x:h,y:g}}function O(t){return((s(t)?t.ownerDocument:t.document)||window.document).documentElement}function P(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function R(t){return T(O(t)).left+P(t).scrollLeft}function E(t,e,n){const o=c(e),r=O(e),l=T(t,!0,\"fixed\"===n,e);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&\"fixed\"!==n)if((\"body\"!==i(e)||a(r))&&(f=P(e)),c(e)){const t=T(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=R(r));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function C(t){if(\"html\"===i(t))return t;const e=t.assignedSlot||t.parentNode||(u(t)?t.host:null)||O(t);return u(e)?e.host:e}function j(t){return c(t)&&\"fixed\"!==o(t).position?t.offsetParent:null}function F(t){const e=n(t);let r=j(t);for(;r&&d(r)&&\"static\"===o(r).position;)r=j(r);return r&&(\"html\"===i(r)||\"body\"===i(r)&&\"static\"===o(r).position&&!h(r))?e:r||function(t){let e=C(t);for(;c(e)&&!g(e);){if(h(e))return e;e=C(e)}return null}(t)||e}function D(t){const e=C(t);return g(e)?t.ownerDocument.body:c(e)&&a(e)?e:D(e)}function S(t,e){var o;void 0===e&&(e=[]);const i=D(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=n(i);return r?e.concat(l,l.visualViewport||[],a(i)?i:[]):e.concat(i,S(i))}function W(t,i,r){return\"viewport\"===i?e.rectToClientRect(function(t,e){const o=n(t),i=O(t),r=o.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=p();(t||!t&&\"fixed\"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(t,r)):f(i)?function(t,e){const n=T(t,!0,\"fixed\"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=c(t)?L(t):{x:1,y:1},l=t.clientWidth*r.x,f=t.clientHeight*r.y,s=i*r.x,u=o*r.y;return{top:u,left:s,right:s+l,bottom:u+f,x:s,y:u,width:l,height:f}}(i,r):e.rectToClientRect(function(t){var e;const n=O(t),i=P(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=y(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=y(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-i.scrollLeft+R(t);const s=-i.scrollTop;return\"rtl\"===o(r||n).direction&&(f+=y(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(O(t)))}const A={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const c=\"clippingAncestors\"===n?function(t,e){const n=e.get(t);if(n)return n;let r=S(t).filter((t=>f(t)&&\"body\"!==i(t))),l=null;const c=\"fixed\"===o(t).position;let s=c?C(t):t;for(;f(s)&&!g(s);){const t=o(s),e=h(s);(c?e||l:e||\"static\"!==t.position||!l||![\"absolute\",\"fixed\"].includes(l.position))?l=t:r=r.filter((t=>t!==s)),s=C(s)}return e.set(t,r),r}(e,this._c):[].concat(n),s=[...c,r],u=s[0],a=s.reduce(((t,n)=>{const o=W(e,n,l);return t.top=y(o.top,t.top),t.right=m(o.right,t.right),t.bottom=m(o.bottom,t.bottom),t.left=y(o.left,t.left),t}),W(e,u,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=c(n),l=O(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((r||!r&&\"fixed\"!==o)&&((\"body\"!==i(n)||a(l))&&(f=P(n)),c(n))){const t=T(n);s=L(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-f.scrollLeft*s.x+u.x,y:e.y*s.y-f.scrollTop*s.y+u.y}},isElement:f,getDimensions:function(t){return w(t)},getOffsetParent:F,getDocumentElement:O,getScale:L,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||F,r=this.getDimensions;return{reference:E(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>\"rtl\"===o(t).direction};Object.defineProperty(t,\"arrow\",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,\"autoPlacement\",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,\"detectOverflow\",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,\"flip\",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,\"hide\",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,\"inline\",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,\"limitShift\",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,\"offset\",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,\"shift\",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,\"size\",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,u=s||r?[...f(t)?S(t):t.contextElement?S(t.contextElement):[],...S(e)]:[];u.forEach((t=>{s&&t.addEventListener(\"scroll\",n,{passive:!0}),r&&t.addEventListener(\"resize\",n)}));let a,d=null;if(l){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),f(t)&&!c&&d.observe(t),f(t)||!t.contextElement||c||d.observe(t.contextElement),d.observe(e)}let h=c?T(t):null;return c&&function e(){const o=T(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,a=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{s&&t.removeEventListener(\"scroll\",n),r&&t.removeEventListener(\"resize\",n)})),null==(t=d)||t.disconnect(),d=null,c&&cancelAnimationFrame(a)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:A,...o},l={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:l})},t.getOverflowAncestors=S,t.platform=A,Object.defineProperty(t,\"__esModule\",{value:!0})}));"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/html2canvas.js",
    "content": "/*!\n * html2canvas 1.4.1 <https://html2canvas.hertzen.com>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n!function(A,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(A=\"undefined\"!=typeof globalThis?globalThis:A||self).html2canvas=e()}(this,function(){\"use strict\";\n/*! *****************************************************************************\n    Copyright (c) Microsoft Corporation.\n\n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n    PERFORMANCE OF THIS SOFTWARE.\n    ***************************************************************************** */var r=function(A,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(A,e)};function A(A,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function t(){this.constructor=A}r(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var h=function(){return(h=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var B in e=arguments[t])Object.prototype.hasOwnProperty.call(e,B)&&(A[B]=e[B]);return A}).apply(this,arguments)};function a(A,s,o,i){return new(o=o||Promise)(function(t,e){function r(A){try{n(i.next(A))}catch(A){e(A)}}function B(A){try{n(i.throw(A))}catch(A){e(A)}}function n(A){var e;A.done?t(A.value):((e=A.value)instanceof o?e:new o(function(A){A(e)})).then(r,B)}n((i=i.apply(A,s||[])).next())})}function H(t,r){var B,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},A={next:e(0),throw:e(1),return:e(2)};return\"function\"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function e(e){return function(A){return function(e){if(B)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(B=1,n&&(s=2&e[0]?n.return:e[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,e[1])).done)return s;switch(n=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,n=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){o.label=e[1];break}if(6===e[0]&&o.label<s[1]){o.label=s[1],s=e;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(e);break}s[2]&&o.ops.pop(),o.trys.pop();continue}e=r.call(t,o)}catch(A){e=[6,A],n=0}finally{B=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,A])}}}function t(A,e,t){if(t||2===arguments.length)for(var r,B=0,n=e.length;B<n;B++)!r&&B in e||((r=r||Array.prototype.slice.call(e,0,B))[B]=e[B]);return A.concat(r||e)}var d=(B.prototype.add=function(A,e,t,r){return new B(this.left+A,this.top+e,this.width+t,this.height+r)},B.fromClientRect=function(A,e){return new B(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},B.fromDOMRectList=function(A,e){e=Array.from(e).find(function(A){return 0!==A.width});return e?new B(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height):B.EMPTY},B.EMPTY=new B(0,0,0,0),B);function B(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}for(var f=function(A,e){return d.fromClientRect(A,e.getBoundingClientRect())},Q=function(A){for(var e=[],t=0,r=A.length;t<r;){var B,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<r?56320==(64512&(B=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--):e.push(n)}return e},g=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return\"\";for(var r=[],B=-1,n=\"\";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(B+1===t||16384<r.length)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",n=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<e.length;s++)n[e.charCodeAt(s)]=s;for(var o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",c=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256),i=0;i<o.length;i++)c[o.charCodeAt(i)]=i;function w(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var U=(l.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},l);function l(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}for(var C=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",u=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256),F=0;F<C.length;F++)u[C.charCodeAt(F)]=F;function p(A,e,t,r){var B=r[t];if(Array.isArray(A)?-1!==A.indexOf(B):A===B)for(var n=t;n<=r.length;){if((o=r[++n])===e)return 1;if(o!==D)break}if(B===D)for(n=t;0<n;){var s=r[--n];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o,i=t;i<=r.length;){if((o=r[++i])===e)return 1;if(o!==D)break}if(s!==D)break}}function E(A,e){for(var t=A;0<=t;){var r=e[t];if(r!==D)return r;t--}return 0}function I(t,A){var e=(B=function(A,r){void 0===r&&(r=\"strict\");var B=[],n=[],s=[];return A.forEach(function(A,e){var t=rA.get(A);if(50<t?(s.push(!0),t-=50):s.push(!1),-1!==[\"normal\",\"auto\",\"loose\"].indexOf(r)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(e),B.push(16);if(4!==t&&11!==t)return n.push(e),31===t?B.push(\"strict\"===r?O:q):t===AA||29===t?B.push(J):43===t?131072<=A&&A<=196605||196608<=A&&A<=262141?B.push(q):B.push(J):void B.push(t);if(0===e)return n.push(e),B.push(J);t=B[e-1];return-1===iA.indexOf(t)?(n.push(n[e-1]),B.push(t)):(n.push(e),B.push(J))}),[n,B,s]}(t,(A=A||{lineBreak:\"normal\",wordBreak:\"normal\"}).lineBreak))[0],r=B[1],B=B[2];return[e,r=\"break-all\"===A.wordBreak||\"break-word\"===A.wordBreak?r.map(function(A){return-1!==[R,J,AA].indexOf(A)?q:A}):r,\"keep-all\"===A.wordBreak?B.map(function(A,e){return A&&19968<=t[e]&&t[e]<=40959}):void 0]}var y,K,m,L,b,D=10,v=13,x=15,M=17,S=18,T=19,G=20,O=21,V=22,k=24,R=25,N=26,P=27,X=28,J=30,Y=32,W=33,Z=34,_=35,q=37,j=38,z=39,$=40,AA=42,eA=[9001,65288],tA=\"×\",rA=(m=function(A){var e,t,r,B,n=.75*A.length,s=A.length,o=0;\"=\"===A[A.length-1]&&(n--,\"=\"===A[A.length-2]&&n--);for(var n=new(\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n),i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=c[A.charCodeAt(Q)],t=c[A.charCodeAt(Q+1)],r=c[A.charCodeAt(Q+2)],B=c[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|r>>2,i[o++]=(3&r)<<6|63&B;return n}(y=\"KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==\"),L=Array.isArray(m)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(m):new Uint32Array(m),b=Array.isArray(m)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(m):new Uint16Array(m),y=w(b,12,L[4]/2),K=2===L[5]?w(b,(24+L[4])/2):(m=L,b=Math.ceil((24+L[4])/4),m.slice?m.slice(b,K):new Uint32Array(Array.prototype.slice.call(m,b,K))),new U(L[0],L[1],L[2],L[3],y,K)),BA=[J,36],nA=[1,2,3,5],sA=[D,8],oA=[P,N],iA=nA.concat(sA),QA=[j,z,$,Z,_],cA=[x,v],aA=(gA.prototype.slice=function(){return g.apply(void 0,this.codePoints.slice(this.start,this.end))},gA);function gA(A,e,t,r){this.codePoints=A,this.required=\"!\"===e,this.start=t,this.end=r}function wA(A,e){var t=Q(A),r=(e=I(t,e))[0],B=e[1],n=e[2],s=t.length,o=0,i=0;return{next:function(){if(s<=i)return{done:!0,value:null};for(var A=tA;i<s&&(A=function(A,e,t,r,B){if(0===t[r])return tA;var n=r-1;if(Array.isArray(B)&&!0===B[n])return tA;var s=n-1,o=1+n,i=e[n],r=0<=s?e[s]:0,B=e[o];if(2===i&&3===B)return tA;if(-1!==nA.indexOf(i))return\"!\";if(-1!==nA.indexOf(B))return tA;if(-1!==sA.indexOf(B))return tA;if(8===E(n,e))return\"÷\";if(11===rA.get(A[n]))return tA;if((i===Y||i===W)&&11===rA.get(A[o]))return tA;if(7===i||7===B)return tA;if(9===i)return tA;if(-1===[D,v,x].indexOf(i)&&9===B)return tA;if(-1!==[M,S,T,k,X].indexOf(B))return tA;if(E(n,e)===V)return tA;if(p(23,V,n,e))return tA;if(p([M,S],O,n,e))return tA;if(p(12,12,n,e))return tA;if(i===D)return\"÷\";if(23===i||23===B)return tA;if(16===B||16===i)return\"÷\";if(-1!==[v,x,O].indexOf(B)||14===i)return tA;if(36===r&&-1!==cA.indexOf(i))return tA;if(i===X&&36===B)return tA;if(B===G)return tA;if(-1!==BA.indexOf(B)&&i===R||-1!==BA.indexOf(i)&&B===R)return tA;if(i===P&&-1!==[q,Y,W].indexOf(B)||-1!==[q,Y,W].indexOf(i)&&B===N)return tA;if(-1!==BA.indexOf(i)&&-1!==oA.indexOf(B)||-1!==oA.indexOf(i)&&-1!==BA.indexOf(B))return tA;if(-1!==[P,N].indexOf(i)&&(B===R||-1!==[V,x].indexOf(B)&&e[1+o]===R)||-1!==[V,x].indexOf(i)&&B===R||i===R&&-1!==[R,X,k].indexOf(B))return tA;if(-1!==[R,X,k,M,S].indexOf(B))for(var Q=n;0<=Q;){if((c=e[Q])===R)return tA;if(-1===[X,k].indexOf(c))break;Q--}if(-1!==[P,N].indexOf(B))for(var c,Q=-1!==[M,S].indexOf(i)?s:n;0<=Q;){if((c=e[Q])===R)return tA;if(-1===[X,k].indexOf(c))break;Q--}if(j===i&&-1!==[j,z,Z,_].indexOf(B)||-1!==[z,Z].indexOf(i)&&-1!==[z,$].indexOf(B)||-1!==[$,_].indexOf(i)&&B===$)return tA;if(-1!==QA.indexOf(i)&&-1!==[G,N].indexOf(B)||-1!==QA.indexOf(B)&&i===P)return tA;if(-1!==BA.indexOf(i)&&-1!==BA.indexOf(B))return tA;if(i===k&&-1!==BA.indexOf(B))return tA;if(-1!==BA.concat(R).indexOf(i)&&B===V&&-1===eA.indexOf(A[o])||-1!==BA.concat(R).indexOf(B)&&i===S)return tA;if(41===i&&41===B){for(var a=t[n],g=1;0<a&&41===e[--a];)g++;if(g%2!=0)return tA}return i===Y&&B===W?tA:\"÷\"}(t,B,r,++i,n))===tA;);if(A===tA&&i!==s)return{done:!0,value:null};var e=new aA(t,A,o,i);return o=i,{value:e,done:!1}}}}function UA(A){return 48<=A&&A<=57}function lA(A){return UA(A)||65<=A&&A<=70||97<=A&&A<=102}function CA(A){return 10===A||9===A||32===A}function uA(A){return 97<=(t=e=A)&&t<=122||65<=(e=e)&&e<=90||128<=A||95===A;var e,t}function FA(A){return uA(A)||UA(A)||45===A}function hA(A,e){return 92===A&&10!==e}function dA(A,e,t){return 45===A?uA(e)||hA(e,t):!!uA(A)||92===A&&10!==e}function fA(A,e,t){return 43===A||45===A?!!UA(e)||46===e&&UA(t):UA(46===A?e:A)}var HA={type:2},pA={type:3},EA={type:4},IA={type:13},yA={type:8},KA={type:21},mA={type:9},LA={type:10},bA={type:11},DA={type:12},vA={type:14},xA={type:23},MA={type:1},SA={type:25},TA={type:24},GA={type:26},OA={type:27},VA={type:28},kA={type:29},RA={type:31},NA={type:32},PA=(XA.prototype.write=function(A){this._value=this._value.concat(Q(A))},XA.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==NA;)A.push(e),e=this.consumeToken();return A},XA.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(FA(e)||hA(t,r)){var B=dA(e,t,r)?2:1;return{type:5,value:this.consumeName(),flags:B}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case 39:return this.consumeStringToken(39);case 40:return HA;case 41:return pA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),vA;break;case 43:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return EA;case 45:var r=A,B=this.peekCodePoint(0),n=this.peekCodePoint(1);if(fA(r,B,n))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(dA(r,B,n))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===B&&62===n)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 46:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(-1===s)return this.consumeToken()}break;case 58:return GA;case 59:return OA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),SA;break;case 64:var n=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);if(dA(n,o,i))return{type:7,value:this.consumeName()};break;case 91:return VA;case 92:if(hA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return kA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),yA;break;case 123:return bA;case 125:return DA;case 117:case 85:o=this.peekCodePoint(0),i=this.peekCodePoint(1);return 43!==o||!lA(i)&&63!==i||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),mA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),KA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),LA;break;case-1:return NA}return CA(A)?(this.consumeWhiteSpace(),RA):UA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):uA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:g(A)}},XA.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},XA.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},XA.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},XA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();lA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(g.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(g.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var r=parseInt(g.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&lA(this.peekCodePoint(1))){this.consumeCodePoint();for(var e=this.consumeCodePoint(),B=[];lA(e)&&B.length<6;)B.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(g.apply(void 0,B),16)}}return{type:30,start:r,end:r}},XA.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return\"url\"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},XA.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:22,value:\"\"};var e,t=this.peekCodePoint(0);if(39===t||34===t){t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),xA)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:22,value:g.apply(void 0,A)};if(CA(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:g.apply(void 0,A)}):(this.consumeBadUrlRemnants(),xA);if(34===r||39===r||40===r||(0<=(e=r)&&e<=8||11===e||14<=e&&e<=31||127===e))return this.consumeBadUrlRemnants(),xA;if(92===r){if(!hA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),xA;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},XA.prototype.consumeWhiteSpace=function(){for(;CA(this.peekCodePoint(0));)this.consumeCodePoint()},XA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;hA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},XA.prototype.consumeStringSlice=function(A){for(var e=\"\";0<A;){var t=Math.min(5e4,A);e+=g.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},XA.prototype.consumeStringToken=function(A){for(var e=\"\",t=0;;){var r,B=this._value[t];if(-1===B||void 0===B||B===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===B)return this._value.splice(0,t),MA;92!==B||-1!==(r=this._value[t+1])&&void 0!==r&&(10===r?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):hA(B,r)&&(e+=this.consumeStringSlice(t),e+=g(this.consumeEscapedCodePoint()),t=-1)),t++}},XA.prototype.consumeNumber=function(){var A=[],e=4;for(43!==(t=this.peekCodePoint(0))&&45!==t||A.push(this.consumeCodePoint());UA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());var t=this.peekCodePoint(0),r=this.peekCodePoint(1);if(46===t&&UA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;UA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1),B=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&UA(B)||UA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;UA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[function(A){var e=0,t=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(t=-1),e++);for(var r=[];UA(A[e]);)r.push(A[e++]);var B=r.length?parseInt(g.apply(void 0,r),10):0;46===A[e]&&e++;for(var n=[];UA(A[e]);)n.push(A[e++]);var s=n.length,o=s?parseInt(g.apply(void 0,n),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(i=-1),e++);for(var Q=[];UA(A[e]);)Q.push(A[e++]);var c=Q.length?parseInt(g.apply(void 0,Q),10):0;return t*(B+o*Math.pow(10,-s))*Math.pow(10,i*c)}(A),e]},XA.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),B=this.peekCodePoint(1),A=this.peekCodePoint(2);return dA(r,B,A)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},XA.prototype.consumeEscapedCodePoint=function(){var A,e=this.consumeCodePoint();if(lA(e)){for(var t=g(e);lA(this.peekCodePoint(0))&&t.length<6;)t+=g(this.consumeCodePoint());CA(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return 0===r||55296<=(A=r)&&A<=57343||1114111<r?65533:r}return-1===e?65533:e},XA.prototype.consumeName=function(){for(var A=\"\";;){var e=this.consumeCodePoint();if(FA(e))A+=g(e);else{if(!hA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=g(this.consumeEscapedCodePoint())}}},XA);function XA(){this._value=[]}var JA=(YA.create=function(A){var e=new PA;return e.write(A),new YA(e.read())},YA.parseValue=function(A){return YA.create(A).parseComponentValue()},YA.parseValues=function(A){return YA.create(A).parseComponentValues()},YA.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError(\"Error parsing CSS component value, unexpected EOF\");this.reconsumeToken(A);for(var e=this.consumeComponentValue();31===(A=this.consumeToken()).type;);if(32===A.type)return e;throw new SyntaxError(\"Error parsing CSS component value, multiple values found when expecting only one\")},YA.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},YA.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},YA.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||ce(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},YA.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},YA.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?NA:A},YA.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},YA);function YA(A){this._tokens=A}function WA(A){return 15===A.type}function ZA(A){return 17===A.type}function _A(A){return 20===A.type}function qA(A){return 0===A.type}function jA(A,e){return _A(A)&&A.value===e}function zA(A){return 31!==A.type}function $A(A){return 31!==A.type&&4!==A.type}function Ae(A){var e=[],t=[];return A.forEach(function(A){if(4===A.type){if(0===t.length)throw new Error(\"Error parsing function args, zero tokens for arg\");return e.push(t),void(t=[])}31!==A.type&&t.push(A)}),t.length&&e.push(t),e}function ee(A){return 17===A.type||15===A.type}function te(A){return 16===A.type||ee(A)}function re(A){return 1<A.length?[A[0],A[1]]:[A[0]]}function Be(A,e,t){var r=A[0],A=A[1];return[Ue(r,e),Ue(void 0!==A?A:r,t)]}function ne(A){return 15===A.type&&(\"deg\"===A.unit||\"grad\"===A.unit||\"rad\"===A.unit||\"turn\"===A.unit)}function se(A){switch(A.filter(_A).map(function(A){return A.value}).join(\" \")){case\"to bottom right\":case\"to right bottom\":case\"left top\":case\"top left\":return[ae,ae];case\"to top\":case\"bottom\":return Ce(0);case\"to bottom left\":case\"to left bottom\":case\"right top\":case\"top right\":return[ae,we];case\"to right\":case\"left\":return Ce(90);case\"to top left\":case\"to left top\":case\"right bottom\":case\"bottom right\":return[we,we];case\"to bottom\":case\"top\":return Ce(180);case\"to top right\":case\"to right top\":case\"left bottom\":case\"bottom left\":return[we,ae];case\"to left\":case\"right\":return Ce(270)}return 0}function oe(A){return 0==(255&A)}function ie(A){var e=255&A,t=255&A>>8,r=255&A>>16,A=255&A>>24;return e<255?\"rgba(\"+A+\",\"+r+\",\"+t+\",\"+e/255+\")\":\"rgb(\"+A+\",\"+r+\",\"+t+\")\"}function Qe(A,e){if(17===A.type)return A.number;if(16!==A.type)return 0;var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}var ce=function(A,e){return 11===e&&12===A.type||(28===e&&29===A.type||2===e&&3===A.type)},ae={type:17,number:0,flags:4},ge={type:16,number:50,flags:4},we={type:16,number:100,flags:4},Ue=function(A,e){if(16===A.type)return A.number/100*e;if(WA(A))switch(A.unit){case\"rem\":case\"em\":return 16*A.number;default:return A.number}return A.number},le=function(A,e){if(15===e.type)switch(e.unit){case\"deg\":return Math.PI*e.number/180;case\"grad\":return Math.PI/200*e.number;case\"rad\":return e.number;case\"turn\":return 2*Math.PI*e.number}throw new Error(\"Unsupported angle type\")},Ce=function(A){return Math.PI*A/180},ue=function(A,e){if(18===e.type){var t=me[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function \"'+e.name+'\"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3);return Fe(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),1)}if(4===e.value.length){var r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3),s=e.value.substring(3,4);return Fe(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(6===e.value.length){r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6);return Fe(parseInt(r,16),parseInt(B,16),parseInt(n,16),1)}if(8===e.value.length){r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6),s=e.value.substring(6,8);return Fe(parseInt(r,16),parseInt(B,16),parseInt(n,16),parseInt(s,16)/255)}}if(20===e.type){e=Le[e.value.toUpperCase()];if(void 0!==e)return e}return Le.TRANSPARENT},Fe=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0},he=function(A,e){e=e.filter($A);if(3===e.length){var t=e.map(Qe),r=t[0],B=t[1],t=t[2];return Fe(r,B,t,1)}if(4!==e.length)return 0;e=e.map(Qe),r=e[0],B=e[1],t=e[2],e=e[3];return Fe(r,B,t,e)};function de(A,e,t){return t<0&&(t+=1),1<=t&&--t,t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function fe(A,e){return ue(A,JA.create(e).parseComponentValue())}function He(A,e){return A=ue(A,e[0]),(e=e[1])&&te(e)?{color:A,stop:e}:{color:A,stop:null}}function pe(A,t){var e=A[0],r=A[A.length-1];null===e.stop&&(e.stop=ae),null===r.stop&&(r.stop=we);for(var B=[],n=0,s=0;s<A.length;s++){var o=A[s].stop;null!==o?(n<(o=Ue(o,t))?B.push(o):B.push(n),n=o):B.push(null)}for(var i=null,s=0;s<B.length;s++){var Q=B[s];if(null===Q)null===i&&(i=s);else if(null!==i){for(var c=s-i,a=(Q-B[i-1])/(1+c),g=1;g<=c;g++)B[i+g-1]=a*g;i=null}}return A.map(function(A,e){return{color:A.color,stop:Math.max(Math.min(1,B[e]/t),0)}})}function Ee(A,e,t){var r=\"number\"==typeof A?A:(s=e/2,r=(n=t)/2,s=Ue((B=A)[0],e)-s,n=r-Ue(B[1],n),(Math.atan2(n,s)+2*Math.PI)%(2*Math.PI)),B=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),n=e/2,s=t/2,e=B/2,t=Math.sin(r-Math.PI/2)*e,e=Math.cos(r-Math.PI/2)*e;return[B,n-e,n+e,s-t,s+t]}function Ie(A,e){return Math.sqrt(A*A+e*e)}function ye(A,e,B,n,s){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var t=e[0],r=e[1],r=Ie(B-t,n-r);return(s?r<A.optimumDistance:r>A.optimumDistance)?{optimumCorner:e,optimumDistance:r}:A},{optimumDistance:s?1/0:-1/0,optimumCorner:null}).optimumCorner}var Ke=function(A,e){var t=e.filter($A),r=t[0],B=t[1],n=t[2],e=t[3],t=(17===r.type?Ce(r.number):le(A,r))/(2*Math.PI),A=te(B)?B.number/100:0,r=te(n)?n.number/100:0,B=void 0!==e&&te(e)?Ue(e,1):1;if(0==A)return Fe(255*r,255*r,255*r,1);n=r<=.5?r*(1+A):r+A-r*A,e=2*r-n,A=de(e,n,t+1/3),r=de(e,n,t),t=de(e,n,t-1/3);return Fe(255*A,255*r,255*t,B)},me={hsl:Ke,hsla:Ke,rgb:he,rgba:he},Le={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},be={name:\"background-clip\",initialValue:\"border-box\",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(_A(A))switch(A.value){case\"padding-box\":return 1;case\"content-box\":return 2}return 0})}},De={name:\"background-color\",initialValue:\"transparent\",prefix:!1,type:3,format:\"color\"},Ke=function(t,A){var r=Ce(180),B=[];return Ae(A).forEach(function(A,e){if(0===e){e=A[0];if(20===e.type&&-1!==[\"top\",\"left\",\"right\",\"bottom\"].indexOf(e.value))return void(r=se(A));if(ne(e))return void(r=(le(t,e)+Ce(270))%Ce(360))}A=He(t,A);B.push(A)}),{angle:r,stops:B,type:1}},ve=\"closest-side\",xe=\"farthest-side\",Me=\"closest-corner\",Se=\"farthest-corner\",Te=\"ellipse\",Ge=\"contain\",he=function(r,A){var B=0,n=3,s=[],o=[];return Ae(A).forEach(function(A,e){var t=!0;0===e?t=A.reduce(function(A,e){if(_A(e))switch(e.value){case\"center\":return o.push(ge),!1;case\"top\":case\"left\":return o.push(ae),!1;case\"right\":case\"bottom\":return o.push(we),!1}else if(te(e)||ee(e))return o.push(e),!1;return A},t):1===e&&(t=A.reduce(function(A,e){if(_A(e))switch(e.value){case\"circle\":return B=0,!1;case Te:return!(B=1);case Ge:case ve:return n=0,!1;case xe:return!(n=1);case Me:return!(n=2);case\"cover\":case Se:return!(n=3)}else if(ee(e)||te(e))return(n=!Array.isArray(n)?[]:n).push(e),!1;return A},t)),t&&(A=He(r,A),s.push(A))}),{size:n,shape:B,stops:s,position:o,type:2}},Oe=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18!==e.type)throw new Error(\"Unsupported image type \"+e.type);t=ke[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function \"'+e.name+'\"');return t(A,e.values)};var Ve,ke={\"linear-gradient\":function(t,A){var r=Ce(180),B=[];return Ae(A).forEach(function(A,e){if(0===e){e=A[0];if(20===e.type&&\"to\"===e.value)return void(r=se(A));if(ne(e))return void(r=le(t,e))}A=He(t,A);B.push(A)}),{angle:r,stops:B,type:1}},\"-moz-linear-gradient\":Ke,\"-ms-linear-gradient\":Ke,\"-o-linear-gradient\":Ke,\"-webkit-linear-gradient\":Ke,\"radial-gradient\":function(B,A){var n=0,s=3,o=[],i=[];return Ae(A).forEach(function(A,e){var t,r=!0;0===e&&(t=!1,r=A.reduce(function(A,e){if(t)if(_A(e))switch(e.value){case\"center\":return i.push(ge),A;case\"top\":case\"left\":return i.push(ae),A;case\"right\":case\"bottom\":return i.push(we),A}else(te(e)||ee(e))&&i.push(e);else if(_A(e))switch(e.value){case\"circle\":return n=0,!1;case Te:return!(n=1);case\"at\":return!(t=!0);case ve:return s=0,!1;case\"cover\":case xe:return!(s=1);case Ge:case Me:return!(s=2);case Se:return!(s=3)}else if(ee(e)||te(e))return(s=!Array.isArray(s)?[]:s).push(e),!1;return A},r)),r&&(A=He(B,A),o.push(A))}),{size:s,shape:n,stops:o,position:i,type:2}},\"-moz-radial-gradient\":he,\"-ms-radial-gradient\":he,\"-o-radial-gradient\":he,\"-webkit-radial-gradient\":he,\"-webkit-gradient\":function(r,A){var e=Ce(180),B=[],n=1;return Ae(A).forEach(function(A,e){var t,A=A[0];if(0===e){if(_A(A)&&\"linear\"===A.value)return void(n=1);if(_A(A)&&\"radial\"===A.value)return void(n=2)}18===A.type&&(\"from\"===A.name?(t=ue(r,A.values[0]),B.push({stop:ae,color:t})):\"to\"===A.name?(t=ue(r,A.values[0]),B.push({stop:we,color:t})):\"color-stop\"!==A.name||2===(A=A.values.filter($A)).length&&(t=ue(r,A[1]),A=A[0],ZA(A)&&B.push({stop:{type:16,number:100*A.number,flags:A.flags},color:t})))}),1===n?{angle:(e+Ce(180))%Ce(360),stops:B,type:n}:{size:3,shape:0,stops:B,position:[],type:n}}},Re={name:\"background-image\",initialValue:\"none\",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&\"none\"===t.value?[]:A.filter(function(A){return $A(A)&&!(20===(A=A).type&&\"none\"===A.value||18===A.type&&!ke[A.name])}).map(function(A){return Oe(e,A)})}},Ne={name:\"background-origin\",initialValue:\"border-box\",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(_A(A))switch(A.value){case\"padding-box\":return 1;case\"content-box\":return 2}return 0})}},Pe={name:\"background-position\",initialValue:\"0% 0%\",type:1,prefix:!1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(te)}).map(re)}},Xe={name:\"background-repeat\",initialValue:\"repeat\",prefix:!1,type:1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(_A).map(function(A){return A.value}).join(\" \")}).map(Je)}},Je=function(A){switch(A){case\"no-repeat\":return 1;case\"repeat-x\":case\"repeat no-repeat\":return 2;case\"repeat-y\":case\"no-repeat repeat\":return 3;default:return 0}};(he=Ve=Ve||{}).AUTO=\"auto\",he.CONTAIN=\"contain\";function Ye(A,e){return _A(A)&&\"normal\"===A.value?1.2*e:17===A.type?e*A.number:te(A)?Ue(A,e):e}var We,Ze,_e={name:\"background-size\",initialValue:\"0\",prefix:!(he.COVER=\"cover\"),type:1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(qe)})}},qe=function(A){return _A(A)||te(A)},he=function(A){return{name:\"border-\"+A+\"-color\",initialValue:\"transparent\",prefix:!1,type:3,format:\"color\"}},je=he(\"top\"),ze=he(\"right\"),$e=he(\"bottom\"),At=he(\"left\"),he=function(A){return{name:\"border-radius-\"+A,initialValue:\"0 0\",prefix:!1,type:1,parse:function(A,e){return re(e.filter(te))}}},et=he(\"top-left\"),tt=he(\"top-right\"),rt=he(\"bottom-right\"),Bt=he(\"bottom-left\"),he=function(A){return{name:\"border-\"+A+\"-style\",initialValue:\"solid\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"none\":return 0;case\"dashed\":return 2;case\"dotted\":return 3;case\"double\":return 4}return 1}}},nt=he(\"top\"),st=he(\"right\"),ot=he(\"bottom\"),it=he(\"left\"),he=function(A){return{name:\"border-\"+A+\"-width\",initialValue:\"0\",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:0}}},Qt=he(\"top\"),ct=he(\"right\"),at=he(\"bottom\"),gt=he(\"left\"),wt={name:\"color\",initialValue:\"transparent\",prefix:!1,type:3,format:\"color\"},Ut={name:\"direction\",initialValue:\"ltr\",prefix:!1,type:2,parse:function(A,e){return\"rtl\"!==e?0:1}},lt={name:\"display\",initialValue:\"inline-block\",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).reduce(function(A,e){return A|Ct(e.value)},0)}},Ct=function(A){switch(A){case\"block\":case\"-webkit-box\":return 2;case\"inline\":return 4;case\"run-in\":return 8;case\"flow\":return 16;case\"flow-root\":return 32;case\"table\":return 64;case\"flex\":case\"-webkit-flex\":return 128;case\"grid\":case\"-ms-grid\":return 256;case\"ruby\":return 512;case\"subgrid\":return 1024;case\"list-item\":return 2048;case\"table-row-group\":return 4096;case\"table-header-group\":return 8192;case\"table-footer-group\":return 16384;case\"table-row\":return 32768;case\"table-cell\":return 65536;case\"table-column-group\":return 131072;case\"table-column\":return 262144;case\"table-caption\":return 524288;case\"ruby-base\":return 1048576;case\"ruby-text\":return 2097152;case\"ruby-base-container\":return 4194304;case\"ruby-text-container\":return 8388608;case\"contents\":return 16777216;case\"inline-block\":return 33554432;case\"inline-list-item\":return 67108864;case\"inline-table\":return 134217728;case\"inline-flex\":return 268435456;case\"inline-grid\":return 536870912}return 0},ut={name:\"float\",initialValue:\"none\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"left\":return 1;case\"right\":return 2;case\"inline-start\":return 3;case\"inline-end\":return 4}return 0}},Ft={name:\"letter-spacing\",initialValue:\"0\",prefix:!1,type:0,parse:function(A,e){return!(20===e.type&&\"normal\"===e.value||17!==e.type&&15!==e.type)?e.number:0}},ht={name:\"line-break\",initialValue:(he=We=We||{}).NORMAL=\"normal\",prefix:!(he.STRICT=\"strict\"),type:2,parse:function(A,e){return\"strict\"!==e?We.NORMAL:We.STRICT}},dt={name:\"line-height\",initialValue:\"normal\",prefix:!1,type:4},ft={name:\"list-style-image\",initialValue:\"none\",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&\"none\"===e.value?null:Oe(A,e)}},Ht={name:\"list-style-position\",initialValue:\"outside\",prefix:!1,type:2,parse:function(A,e){return\"inside\"!==e?1:0}},pt={name:\"list-style-type\",initialValue:\"none\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"disc\":return 0;case\"circle\":return 1;case\"square\":return 2;case\"decimal\":return 3;case\"cjk-decimal\":return 4;case\"decimal-leading-zero\":return 5;case\"lower-roman\":return 6;case\"upper-roman\":return 7;case\"lower-greek\":return 8;case\"lower-alpha\":return 9;case\"upper-alpha\":return 10;case\"arabic-indic\":return 11;case\"armenian\":return 12;case\"bengali\":return 13;case\"cambodian\":return 14;case\"cjk-earthly-branch\":return 15;case\"cjk-heavenly-stem\":return 16;case\"cjk-ideographic\":return 17;case\"devanagari\":return 18;case\"ethiopic-numeric\":return 19;case\"georgian\":return 20;case\"gujarati\":return 21;case\"gurmukhi\":case\"hebrew\":return 22;case\"hiragana\":return 23;case\"hiragana-iroha\":return 24;case\"japanese-formal\":return 25;case\"japanese-informal\":return 26;case\"kannada\":return 27;case\"katakana\":return 28;case\"katakana-iroha\":return 29;case\"khmer\":return 30;case\"korean-hangul-formal\":return 31;case\"korean-hanja-formal\":return 32;case\"korean-hanja-informal\":return 33;case\"lao\":return 34;case\"lower-armenian\":return 35;case\"malayalam\":return 36;case\"mongolian\":return 37;case\"myanmar\":return 38;case\"oriya\":return 39;case\"persian\":return 40;case\"simp-chinese-formal\":return 41;case\"simp-chinese-informal\":return 42;case\"tamil\":return 43;case\"telugu\":return 44;case\"thai\":return 45;case\"tibetan\":return 46;case\"trad-chinese-formal\":return 47;case\"trad-chinese-informal\":return 48;case\"upper-armenian\":return 49;case\"disclosure-open\":return 50;case\"disclosure-closed\":return 51;default:return-1}}},he=function(A){return{name:\"margin-\"+A,initialValue:\"0\",prefix:!1,type:4}},Et=he(\"top\"),It=he(\"right\"),yt=he(\"bottom\"),Kt=he(\"left\"),mt={name:\"overflow\",initialValue:\"visible\",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).map(function(A){switch(A.value){case\"hidden\":return 1;case\"scroll\":return 2;case\"clip\":return 3;case\"auto\":return 4;default:return 0}})}},Lt={name:\"overflow-wrap\",initialValue:\"normal\",prefix:!1,type:2,parse:function(A,e){return\"break-word\"!==e?\"normal\":\"break-word\"}},he=function(A){return{name:\"padding-\"+A,initialValue:\"0\",prefix:!1,type:3,format:\"length-percentage\"}},bt=he(\"top\"),Dt=he(\"right\"),vt=he(\"bottom\"),xt=he(\"left\"),Mt={name:\"text-align\",initialValue:\"left\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"right\":return 2;case\"center\":case\"justify\":return 1;default:return 0}}},St={name:\"position\",initialValue:\"static\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"relative\":return 1;case\"absolute\":return 2;case\"fixed\":return 3;case\"sticky\":return 4}return 0}},Tt={name:\"text-shadow\",initialValue:\"none\",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&jA(A[0],\"none\")?[]:Ae(A).map(function(A){for(var e={color:Le.TRANSPARENT,offsetX:ae,offsetY:ae,blur:ae},t=0,r=0;r<A.length;r++){var B=A[r];ee(B)?(0===t?e.offsetX=B:1===t?e.offsetY=B:e.blur=B,t++):e.color=ue(n,B)}return e})}},Gt={name:\"text-transform\",initialValue:\"none\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"uppercase\":return 2;case\"lowercase\":return 1;case\"capitalize\":return 3}return 0}},Ot={name:\"transform\",initialValue:\"none\",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&\"none\"===e.value)return null;if(18!==e.type)return null;var t=Vt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function \"'+e.name+'\"');return t(e.values)}},Vt={matrix:function(A){A=A.filter(function(A){return 17===A.type}).map(function(A){return A.number});return 6===A.length?A:null},matrix3d:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number}),t=e[0],r=e[1];e[2],e[3];var B=e[4],n=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],A=e[13];return e[14],e[15],16===e.length?[t,r,B,n,s,A]:null}},he={type:16,number:50,flags:4},kt=[he,he],Rt={name:\"transform-origin\",initialValue:\"50% 50%\",prefix:!0,type:1,parse:function(A,e){e=e.filter(te);return 2!==e.length?kt:[e[0],e[1]]}},Nt={name:\"visible\",initialValue:\"none\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"hidden\":return 1;case\"collapse\":return 2;default:return 0}}};(he=Ze=Ze||{}).NORMAL=\"normal\",he.BREAK_ALL=\"break-all\";function Pt(A,e){return 0!=(A&e)}function Xt(A,e,t){return(A=A&&A[Math.min(e,A.length-1)])?t?A.open:A.close:\"\"}var Jt={name:\"word-break\",initialValue:\"normal\",prefix:!(he.KEEP_ALL=\"keep-all\"),type:2,parse:function(A,e){switch(e){case\"break-all\":return Ze.BREAK_ALL;case\"keep-all\":return Ze.KEEP_ALL;default:return Ze.NORMAL}}},Yt={name:\"z-index\",initialValue:\"auto\",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(ZA(e))return{auto:!1,order:e.number};throw new Error(\"Invalid z-index number parsed\")}},Wt=function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case\"s\":return 1e3*e.number;case\"ms\":return e.number}throw new Error(\"Unsupported time type\")},Zt={name:\"opacity\",initialValue:\"1\",type:0,prefix:!1,parse:function(A,e){return ZA(e)?e.number:1}},_t={name:\"text-decoration-color\",initialValue:\"transparent\",prefix:!1,type:3,format:\"color\"},qt={name:\"text-decoration-line\",initialValue:\"none\",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).map(function(A){switch(A.value){case\"underline\":return 1;case\"overline\":return 2;case\"line-through\":return 3;case\"none\":return 4}return 0}).filter(function(A){return 0!==A})}},jt={name:\"font-family\",initialValue:\"\",prefix:!1,type:1,parse:function(A,e){var t=[],r=[];return e.forEach(function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:r.push(t.join(\" \")),t.length=0}}),t.length&&r.push(t.join(\" \")),r.map(function(A){return-1===A.indexOf(\" \")?A:\"'\"+A+\"'\"})}},zt={name:\"font-size\",initialValue:\"0\",prefix:!1,type:3,format:\"length\"},$t={name:\"font-weight\",initialValue:\"normal\",type:0,prefix:!1,parse:function(A,e){return ZA(e)?e.number:!_A(e)||\"bold\"!==e.value?400:700}},Ar={name:\"font-variant\",initialValue:\"none\",type:1,prefix:!1,parse:function(A,e){return e.filter(_A).map(function(A){return A.value})}},er={name:\"font-style\",initialValue:\"normal\",prefix:!1,type:2,parse:function(A,e){switch(e){case\"oblique\":return\"oblique\";case\"italic\":return\"italic\";default:return\"normal\"}}},tr={name:\"content\",initialValue:\"none\",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&\"none\"===t.value?[]:e}},rr={name:\"counter-increment\",initialValue:\"none\",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&\"none\"===t.value)return null;for(var r=[],B=e.filter(zA),n=0;n<B.length;n++){var s=B[n],o=B[n+1];20===s.type&&(o=o&&ZA(o)?o.number:1,r.push({counter:s.value,increment:o}))}return r}},Br={name:\"counter-reset\",initialValue:\"none\",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],r=e.filter(zA),B=0;B<r.length;B++){var n=r[B],s=r[B+1];_A(n)&&\"none\"!==n.value&&(s=s&&ZA(s)?s.number:0,t.push({counter:n.value,reset:s}))}return t}},nr={name:\"duration\",initialValue:\"0s\",prefix:!1,type:1,parse:function(e,A){return A.filter(WA).map(function(A){return Wt(e,A)})}},sr={name:\"quotes\",initialValue:\"none\",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&\"none\"===t.value)return null;var r=[],B=e.filter(qA);if(B.length%2!=0)return null;for(var n=0;n<B.length;n+=2){var s=B[n].value,o=B[n+1].value;r.push({open:s,close:o})}return r}},or={name:\"box-shadow\",initialValue:\"none\",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&jA(A[0],\"none\")?[]:Ae(A).map(function(A){for(var e={color:255,offsetX:ae,offsetY:ae,blur:ae,spread:ae,inset:!1},t=0,r=0;r<A.length;r++){var B=A[r];jA(B,\"inset\")?e.inset=!0:ee(B)?(0===t?e.offsetX=B:1===t?e.offsetY=B:2===t?e.blur=B:e.spread=B,t++):e.color=ue(n,B)}return e})}},ir={name:\"paint-order\",initialValue:\"normal\",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(_A).forEach(function(A){switch(A.value){case\"stroke\":t.push(1);break;case\"fill\":t.push(0);break;case\"markers\":t.push(2)}}),[0,1,2].forEach(function(A){-1===t.indexOf(A)&&t.push(A)}),t}},Qr={name:\"-webkit-text-stroke-color\",initialValue:\"currentcolor\",prefix:!1,type:3,format:\"color\"},cr={name:\"-webkit-text-stroke-width\",initialValue:\"0\",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:0}},ar=(gr.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&0===this.visibility},gr.prototype.isTransparent=function(){return oe(this.backgroundColor)},gr.prototype.isTransformed=function(){return null!==this.transform},gr.prototype.isPositioned=function(){return 0!==this.position},gr.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},gr.prototype.isFloating=function(){return 0!==this.float},gr.prototype.isInlineLevel=function(){return Pt(this.display,4)||Pt(this.display,33554432)||Pt(this.display,268435456)||Pt(this.display,536870912)||Pt(this.display,67108864)||Pt(this.display,134217728)},gr);function gr(A,e){this.animationDuration=lr(A,nr,e.animationDuration),this.backgroundClip=lr(A,be,e.backgroundClip),this.backgroundColor=lr(A,De,e.backgroundColor),this.backgroundImage=lr(A,Re,e.backgroundImage),this.backgroundOrigin=lr(A,Ne,e.backgroundOrigin),this.backgroundPosition=lr(A,Pe,e.backgroundPosition),this.backgroundRepeat=lr(A,Xe,e.backgroundRepeat),this.backgroundSize=lr(A,_e,e.backgroundSize),this.borderTopColor=lr(A,je,e.borderTopColor),this.borderRightColor=lr(A,ze,e.borderRightColor),this.borderBottomColor=lr(A,$e,e.borderBottomColor),this.borderLeftColor=lr(A,At,e.borderLeftColor),this.borderTopLeftRadius=lr(A,et,e.borderTopLeftRadius),this.borderTopRightRadius=lr(A,tt,e.borderTopRightRadius),this.borderBottomRightRadius=lr(A,rt,e.borderBottomRightRadius),this.borderBottomLeftRadius=lr(A,Bt,e.borderBottomLeftRadius),this.borderTopStyle=lr(A,nt,e.borderTopStyle),this.borderRightStyle=lr(A,st,e.borderRightStyle),this.borderBottomStyle=lr(A,ot,e.borderBottomStyle),this.borderLeftStyle=lr(A,it,e.borderLeftStyle),this.borderTopWidth=lr(A,Qt,e.borderTopWidth),this.borderRightWidth=lr(A,ct,e.borderRightWidth),this.borderBottomWidth=lr(A,at,e.borderBottomWidth),this.borderLeftWidth=lr(A,gt,e.borderLeftWidth),this.boxShadow=lr(A,or,e.boxShadow),this.color=lr(A,wt,e.color),this.direction=lr(A,Ut,e.direction),this.display=lr(A,lt,e.display),this.float=lr(A,ut,e.cssFloat),this.fontFamily=lr(A,jt,e.fontFamily),this.fontSize=lr(A,zt,e.fontSize),this.fontStyle=lr(A,er,e.fontStyle),this.fontVariant=lr(A,Ar,e.fontVariant),this.fontWeight=lr(A,$t,e.fontWeight),this.letterSpacing=lr(A,Ft,e.letterSpacing),this.lineBreak=lr(A,ht,e.lineBreak),this.lineHeight=lr(A,dt,e.lineHeight),this.listStyleImage=lr(A,ft,e.listStyleImage),this.listStylePosition=lr(A,Ht,e.listStylePosition),this.listStyleType=lr(A,pt,e.listStyleType),this.marginTop=lr(A,Et,e.marginTop),this.marginRight=lr(A,It,e.marginRight),this.marginBottom=lr(A,yt,e.marginBottom),this.marginLeft=lr(A,Kt,e.marginLeft),this.opacity=lr(A,Zt,e.opacity);var t=lr(A,mt,e.overflow);this.overflowX=t[0],this.overflowY=t[1<t.length?1:0],this.overflowWrap=lr(A,Lt,e.overflowWrap),this.paddingTop=lr(A,bt,e.paddingTop),this.paddingRight=lr(A,Dt,e.paddingRight),this.paddingBottom=lr(A,vt,e.paddingBottom),this.paddingLeft=lr(A,xt,e.paddingLeft),this.paintOrder=lr(A,ir,e.paintOrder),this.position=lr(A,St,e.position),this.textAlign=lr(A,Mt,e.textAlign),this.textDecorationColor=lr(A,_t,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=lr(A,qt,null!==(t=e.textDecorationLine)&&void 0!==t?t:e.textDecoration),this.textShadow=lr(A,Tt,e.textShadow),this.textTransform=lr(A,Gt,e.textTransform),this.transform=lr(A,Ot,e.transform),this.transformOrigin=lr(A,Rt,e.transformOrigin),this.visibility=lr(A,Nt,e.visibility),this.webkitTextStrokeColor=lr(A,Qr,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=lr(A,cr,e.webkitTextStrokeWidth),this.wordBreak=lr(A,Jt,e.wordBreak),this.zIndex=lr(A,Yt,e.zIndex)}for(var wr=function(A,e){this.content=lr(A,tr,e.content),this.quotes=lr(A,sr,e.quotes)},Ur=function(A,e){this.counterIncrement=lr(A,rr,e.counterIncrement),this.counterReset=lr(A,Br,e.counterReset)},lr=function(A,e,t){var r=new PA,t=null!=t?t.toString():e.initialValue;r.write(t);var B=new JA(r.read());switch(e.type){case 2:var n=B.parseComponentValue();return e.parse(A,_A(n)?n.value:e.initialValue);case 0:return e.parse(A,B.parseComponentValue());case 1:return e.parse(A,B.parseComponentValues());case 4:return B.parseComponentValue();case 3:switch(e.format){case\"angle\":return le(A,B.parseComponentValue());case\"color\":return ue(A,B.parseComponentValue());case\"image\":return Oe(A,B.parseComponentValue());case\"length\":var s=B.parseComponentValue();return ee(s)?s:ae;case\"length-percentage\":s=B.parseComponentValue();return te(s)?s:ae;case\"time\":return Wt(A,B.parseComponentValue())}}},Cr=function(A,e){A=function(A){switch(A.getAttribute(\"data-html2canvas-debug\")){case\"all\":return 1;case\"clone\":return 2;case\"parse\":return 3;case\"render\":return 4;default:return 0}}(A);return 1===A||e===A},ur=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Cr(e,3),this.styles=new ar(A,window.getComputedStyle(e,null)),JB(e)&&(this.styles.animationDuration.some(function(A){return 0<A})&&(e.style.animationDuration=\"0s\"),null!==this.styles.transform&&(e.style.transform=\"none\")),this.bounds=f(this.context,e),Cr(e,4)&&(this.flags|=16)},Fr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",hr=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256),dr=0;dr<Fr.length;dr++)hr[Fr.charCodeAt(dr)]=dr;function fr(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var Hr=(pr.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},pr);function pr(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}for(var Er=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",Ir=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256),yr=0;yr<Er.length;yr++)Ir[Er.charCodeAt(yr)]=yr;function Kr(A){return kr.get(A)}function mr(A){var t=function(A){for(var e=[],t=0,r=A.length;t<r;){var B,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<r?56320==(64512&(B=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--):e.push(n)}return e}(A),r=t.length,B=0,n=0,s=t.map(Kr);return{next:function(){if(r<=B)return{done:!0,value:null};for(var A=Rr;B<r&&(A=function(A,e){var t=e-2,r=A[t],B=A[e-1],e=A[e];if(2===B&&3===e)return Rr;if(2===B||3===B||4===B)return\"÷\";if(2===e||3===e||4===e)return\"÷\";if(B===Tr&&-1!==[Tr,Gr,Or,Vr].indexOf(e))return Rr;if(!(B!==Or&&B!==Gr||e!==Gr&&10!==e))return Rr;if((B===Vr||10===B)&&10===e)return Rr;if(13===e||5===e)return Rr;if(7===e)return Rr;if(1===B)return Rr;if(13===B&&14===e){for(;5===r;)r=A[--t];if(14===r)return Rr}if(15===B&&15===e){for(var n=0;15===r;)n++,r=A[--t];if(n%2==0)return Rr}return\"÷\"}(s,++B))===Rr;);if(A===Rr&&B!==r)return{done:!0,value:null};var e=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return\"\";for(var r=[],B=-1,n=\"\";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(B+1===t||16384<r.length)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n}.apply(null,t.slice(n,B));return n=B,{value:e,done:!1}}}}function Lr(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var br,Dr,vr,xr,Mr,Sr,Tr=8,Gr=9,Or=11,Vr=12,kr=(vr=function(A){var e,t,r,B,n=.75*A.length,s=A.length,o=0;\"=\"===A[A.length-1]&&(n--,\"=\"===A[A.length-2]&&n--);for(var n=new(\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n),i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=hr[A.charCodeAt(Q)],t=hr[A.charCodeAt(Q+1)],r=hr[A.charCodeAt(Q+2)],B=hr[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|r>>2,i[o++]=(3&r)<<6|63&B;return n}(br=\"AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=\"),xr=Array.isArray(vr)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(vr):new Uint32Array(vr),Mr=Array.isArray(vr)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(vr):new Uint16Array(vr),br=fr(Mr,12,xr[4]/2),Dr=2===xr[5]?fr(Mr,(24+xr[4])/2):(vr=xr,Mr=Math.ceil((24+xr[4])/4),vr.slice?vr.slice(Mr,Dr):new Uint32Array(Array.prototype.slice.call(vr,Mr,Dr))),new Hr(xr[0],xr[1],xr[2],xr[3],br,Dr)),Rr=\"×\",Nr=function(A,e,t,r,B){var n=\"http://www.w3.org/2000/svg\",s=document.createElementNS(n,\"svg\"),n=document.createElementNS(n,\"foreignObject\");return s.setAttributeNS(null,\"width\",A.toString()),s.setAttributeNS(null,\"height\",e.toString()),n.setAttributeNS(null,\"width\",\"100%\"),n.setAttributeNS(null,\"height\",\"100%\"),n.setAttributeNS(null,\"x\",t.toString()),n.setAttributeNS(null,\"y\",r.toString()),n.setAttributeNS(null,\"externalResourcesRequired\",\"true\"),s.appendChild(n),n.appendChild(B),s},Pr=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src=\"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent((new XMLSerializer).serializeToString(r))})},Xr={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement(\"boundtest\");t.style.height=\"123px\",t.style.display=\"block\",A.body.appendChild(t),e.selectNode(t);e=e.getBoundingClientRect(),e=Math.round(e.height);if(A.body.removeChild(t),123===e)return!0}}return!1}(document);return Object.defineProperty(Xr,\"SUPPORT_RANGE_BOUNDS\",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Xr.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement(\"boundtest\");e.style.width=\"50px\",e.style.display=\"block\",e.style.fontSize=\"12px\",e.style.letterSpacing=\"0px\",e.style.wordSpacing=\"0px\",A.body.appendChild(e);var r=A.createRange();e.innerHTML=\"function\"==typeof\"\".repeat?\"&#128104;\".repeat(10):\"\";var B=e.firstChild,t=Q(B.data).map(function(A){return g(A)}),n=0,s={},t=t.every(function(A,e){r.setStart(B,n),r.setEnd(B,n+A.length);var t=r.getBoundingClientRect();n+=A.length;A=t.x>s.x||t.y>s.y;return s=t,0===e||A});return A.body.removeChild(e),t}(document);return Object.defineProperty(Xr,\"SUPPORT_WORD_BREAKING\",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement(\"canvas\"),A=t.getContext(\"2d\");if(!A)return!1;e.src=\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>\";try{A.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Xr,\"SUPPORT_SVG_DRAWING\",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A=\"function\"==typeof Array.from&&\"function\"==typeof window.fetch?function(t){var A=t.createElement(\"canvas\"),r=100;A.width=r,A.height=r;var B=A.getContext(\"2d\");if(!B)return Promise.reject(!1);B.fillStyle=\"rgb(0, 255, 0)\",B.fillRect(0,0,r,r);var e=new Image,n=A.toDataURL();e.src=n;e=Nr(r,r,0,0,e);return B.fillStyle=\"red\",B.fillRect(0,0,r,r),Pr(e).then(function(A){B.drawImage(A,0,0);var e=B.getImageData(0,0,r,r).data;B.fillStyle=\"red\",B.fillRect(0,0,r,r);A=t.createElement(\"div\");return A.style.backgroundImage=\"url(\"+n+\")\",A.style.height=\"100px\",Lr(e)?Pr(Nr(r,r,0,0,A)):Promise.reject(!1)}).then(function(A){return B.drawImage(A,0,0),Lr(B.getImageData(0,0,r,r).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Xr,\"SUPPORT_FOREIGNOBJECT_DRAWING\",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Xr,\"SUPPORT_CORS_IMAGES\",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A=\"string\"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Xr,\"SUPPORT_RESPONSE_TYPE\",{value:A}),A},get SUPPORT_CORS_XHR(){var A=\"withCredentials\"in new XMLHttpRequest;return Object.defineProperty(Xr,\"SUPPORT_CORS_XHR\",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!(\"undefined\"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Xr,\"SUPPORT_NATIVE_TEXT_SEGMENTATION\",{value:A}),A}},Jr=function(A,e){this.text=A,this.bounds=e},Yr=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement(\"html2canvaswrapper\");r.appendChild(e.cloneNode(!0));t=e.parentNode;if(t){t.replaceChild(r,e);A=f(A,r);return r.firstChild&&t.replaceChild(r.firstChild,r),A}}return d.EMPTY},Wr=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error(\"Node has no owner document\");r=r.createRange();return r.setStart(A,e),r.setEnd(A,e+t),r},Zr=function(A){if(Xr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:\"grapheme\"});return Array.from(e.segment(A)).map(function(A){return A.segment})}return function(A){for(var e,t=mr(A),r=[];!(e=t.next()).done;)e.value&&r.push(e.value.slice());return r}(A)},_r=function(A,e){return 0!==e.letterSpacing?Zr(A):function(A,e){if(Xr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:\"word\"});return Array.from(t.segment(A)).map(function(A){return A.segment})}return jr(A,e)}(A,e)},qr=[32,160,4961,65792,65793,4153,4241],jr=function(A,e){for(var t,r=wA(A,{lineBreak:e.lineBreak,wordBreak:\"break-word\"===e.overflowWrap?\"break-word\":e.wordBreak}),B=[];!(t=r.next()).done;)!function(){var A,e;t.value&&(A=t.value.slice(),A=Q(A),e=\"\",A.forEach(function(A){-1===qr.indexOf(A)?e+=g(A):(e.length&&B.push(e),B.push(g(A)),e=\"\")}),e.length&&B.push(e))}();return B},zr=function(A,e,t){var B,n,s,o,i;this.text=$r(e.data,t.textTransform),this.textBounds=(B=A,A=this.text,s=e,A=_r(A,n=t),o=[],i=0,A.forEach(function(A){var e,t,r;n.textDecorationLine.length||0<A.trim().length?Xr.SUPPORT_RANGE_BOUNDS?1<(r=Wr(s,i,A.length).getClientRects()).length?(e=Zr(A),t=0,e.forEach(function(A){o.push(new Jr(A,d.fromDOMRectList(B,Wr(s,t+i,A.length).getClientRects()))),t+=A.length})):o.push(new Jr(A,d.fromDOMRectList(B,r))):(r=s.splitText(A.length),o.push(new Jr(A,Yr(B,s))),s=r):Xr.SUPPORT_RANGE_BOUNDS||(s=s.splitText(A.length)),i+=A.length}),o)},$r=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(AB,eB);case 2:return A.toUpperCase();default:return A}},AB=/(^|\\s|:|-|\\(|\\))([a-z])/g,eB=function(A,e,t){return 0<A.length?e+t.toUpperCase():A},tB=(A(rB,Sr=ur),rB);function rB(A,e){A=Sr.call(this,A,e)||this;return A.src=e.currentSrc||e.src,A.intrinsicWidth=e.naturalWidth,A.intrinsicHeight=e.naturalHeight,A.context.cache.addImage(A.src),A}var BB,nB=(A(sB,BB=ur),sB);function sB(A,e){A=BB.call(this,A,e)||this;return A.canvas=e,A.intrinsicWidth=e.width,A.intrinsicHeight=e.height,A}var oB,iB=(A(QB,oB=ur),QB);function QB(A,e){var t=oB.call(this,A,e)||this,r=new XMLSerializer,A=f(A,e);return e.setAttribute(\"width\",A.width+\"px\"),e.setAttribute(\"height\",A.height+\"px\"),t.svg=\"data:image/svg+xml,\"+encodeURIComponent(r.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,t.context.cache.addImage(t.svg),t}var cB,aB=(A(gB,cB=ur),gB);function gB(A,e){A=cB.call(this,A,e)||this;return A.value=e.value,A}var wB,UB=(A(lB,wB=ur),lB);function lB(A,e){A=wB.call(this,A,e)||this;return A.start=e.start,A.reversed=\"boolean\"==typeof e.reversed&&!0===e.reversed,A}var CB,uB=[{type:15,flags:0,unit:\"px\",number:3}],FB=[{type:16,flags:0,number:50}],hB=\"checkbox\",dB=\"radio\",fB=\"password\",HB=707406591,pB=(A(EB,CB=ur),EB);function EB(A,e){var t=CB.call(this,A,e)||this;switch(t.type=e.type.toLowerCase(),t.checked=e.checked,t.value=0===(e=(A=e).type===fB?new Array(A.value.length+1).join(\"•\"):A.value).length?A.placeholder||\"\":e,t.type!==hB&&t.type!==dB||(t.styles.backgroundColor=3739148031,t.styles.borderTopColor=t.styles.borderRightColor=t.styles.borderBottomColor=t.styles.borderLeftColor=2779096575,t.styles.borderTopWidth=t.styles.borderRightWidth=t.styles.borderBottomWidth=t.styles.borderLeftWidth=1,t.styles.borderTopStyle=t.styles.borderRightStyle=t.styles.borderBottomStyle=t.styles.borderLeftStyle=1,t.styles.backgroundClip=[0],t.styles.backgroundOrigin=[0],t.bounds=(e=t.bounds).width>e.height?new d(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new d(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e),t.type){case hB:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=uB;break;case dB:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=FB}return t}var IB,yB=(A(KB,IB=ur),KB);function KB(A,e){A=IB.call(this,A,e)||this,e=e.options[e.selectedIndex||0];return A.value=e&&e.text||\"\",A}var mB,LB=(A(bB,mB=ur),bB);function bB(A,e){A=mB.call(this,A,e)||this;return A.value=e.value,A}var DB,vB=(A(xB,DB=ur),xB);function xB(A,e){var t,r,B=DB.call(this,A,e)||this;B.src=e.src,B.width=parseInt(e.width,10)||0,B.height=parseInt(e.height,10)||0,B.backgroundColor=B.styles.backgroundColor;try{e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&(B.tree=kB(A,e.contentWindow.document.documentElement),t=e.contentWindow.document.documentElement?fe(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Le.TRANSPARENT,r=e.contentWindow.document.body?fe(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):Le.TRANSPARENT,B.backgroundColor=oe(t)?oe(r)?B.styles.backgroundColor:r:t)}catch(A){}return B}function MB(A){return\"VIDEO\"===A.tagName}function SB(A){return\"STYLE\"===A.tagName}function TB(A){return 0<A.tagName.indexOf(\"-\")}var GB=[\"OL\",\"UL\",\"MENU\"],OB=function(e,A,t,r){for(var B=A.firstChild;B;B=s){var n,s=B.nextSibling;PB(B)&&0<B.data.trim().length?t.textNodes.push(new zr(e,B,t.styles)):XB(B)&&(rn(B)&&B.assignedNodes?B.assignedNodes().forEach(function(A){return OB(e,A,t,r)}):(n=VB(e,B)).styles.isVisible()&&(RB(B,n,r)?n.flags|=4:NB(n.styles)&&(n.flags|=2),-1!==GB.indexOf(B.tagName)&&(n.flags|=8),t.elements.push(n),B.slot,B.shadowRoot?OB(e,B.shadowRoot,n,r):en(B)||qB(B)||tn(B)||OB(e,B,n,r)))}},VB=function(A,e){return new($B(e)?tB:zB(e)?nB:qB(e)?iB:WB(e)?aB:ZB(e)?UB:_B(e)?pB:tn(e)?yB:en(e)?LB:An(e)?vB:ur)(A,e)},kB=function(A,e){var t=VB(A,e);return t.flags|=4,OB(A,e,t,t),t},RB=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||jB(A)&&t.styles.isTransparent()},NB=function(A){return A.isPositioned()||A.isFloating()},PB=function(A){return A.nodeType===Node.TEXT_NODE},XB=function(A){return A.nodeType===Node.ELEMENT_NODE},JB=function(A){return XB(A)&&void 0!==A.style&&!YB(A)},YB=function(A){return\"object\"==typeof A.className},WB=function(A){return\"LI\"===A.tagName},ZB=function(A){return\"OL\"===A.tagName},_B=function(A){return\"INPUT\"===A.tagName},qB=function(A){return\"svg\"===A.tagName},jB=function(A){return\"BODY\"===A.tagName},zB=function(A){return\"CANVAS\"===A.tagName},$B=function(A){return\"IMG\"===A.tagName},An=function(A){return\"IFRAME\"===A.tagName},en=function(A){return\"TEXTAREA\"===A.tagName},tn=function(A){return\"SELECT\"===A.tagName},rn=function(A){return\"SLOT\"===A.tagName},Bn=(nn.prototype.getCounterValue=function(A){A=this.counters[A];return A&&A.length?A[A.length-1]:1},nn.prototype.getCounterValues=function(A){A=this.counters[A];return A||[]},nn.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},nn.prototype.parse=function(A){var t=this,e=A.counterIncrement,A=A.counterReset,r=!0;null!==e&&e.forEach(function(A){var e=t.counters[A.counter];e&&0!==A.increment&&(r=!1,e.length||e.push(1),e[Math.max(0,e.length-1)]+=A.increment)});var B=[];return r&&A.forEach(function(A){var e=t.counters[A.counter];B.push(A.counter),(e=e||(t.counters[A.counter]=[])).push(A.reset)}),B},nn);function nn(){this.counters={}}function sn(r,A,e,B,t,n){return r<A||e<r?Fn(r,t,0<n.length):B.integers.reduce(function(A,e,t){for(;e<=r;)r-=e,A+=B.values[t];return A},\"\")+n}function on(A,e,t,r){for(var B=\"\";t||A--,B=r(A)+B,e<=(A/=e)*e;);return B}function Qn(A,e,t,r,B){var n=t-e+1;return(A<0?\"-\":\"\")+(on(Math.abs(A),n,r,function(A){return g(Math.floor(A%n)+e)})+B)}function cn(A,e,t){void 0===t&&(t=\". \");var r=e.length;return on(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t}function an(A,e,t,r,B,n){if(A<-9999||9999<A)return Fn(A,4,0<B.length);var s=Math.abs(A),o=B;if(0===s)return e[0]+o;for(var i=0;0<s&&i<=4;i++){var Q=s%10;0==Q&&Pt(n,1)&&\"\"!==o?o=e[Q]+o:1<Q||1==Q&&0===i||1==Q&&1===i&&Pt(n,2)||1==Q&&1===i&&Pt(n,4)&&100<A||1==Q&&1<i&&Pt(n,8)?o=e[Q]+(0<i?t[i-1]:\"\")+o:1==Q&&0<i&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:\"\")+o}var gn,wn={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:[\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"]},Un={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:[\"Ք\",\"Փ\",\"Ւ\",\"Ց\",\"Ր\",\"Տ\",\"Վ\",\"Ս\",\"Ռ\",\"Ջ\",\"Պ\",\"Չ\",\"Ո\",\"Շ\",\"Ն\",\"Յ\",\"Մ\",\"Ճ\",\"Ղ\",\"Ձ\",\"Հ\",\"Կ\",\"Ծ\",\"Խ\",\"Լ\",\"Ի\",\"Ժ\",\"Թ\",\"Ը\",\"Է\",\"Զ\",\"Ե\",\"Դ\",\"Գ\",\"Բ\",\"Ա\"]},ln={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:[\"י׳\",\"ט׳\",\"ח׳\",\"ז׳\",\"ו׳\",\"ה׳\",\"ד׳\",\"ג׳\",\"ב׳\",\"א׳\",\"ת\",\"ש\",\"ר\",\"ק\",\"צ\",\"פ\",\"ע\",\"ס\",\"נ\",\"מ\",\"ל\",\"כ\",\"יט\",\"יח\",\"יז\",\"טז\",\"טו\",\"י\",\"ט\",\"ח\",\"ז\",\"ו\",\"ה\",\"ד\",\"ג\",\"ב\",\"א\"]},Cn={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:[\"ჵ\",\"ჰ\",\"ჯ\",\"ჴ\",\"ხ\",\"ჭ\",\"წ\",\"ძ\",\"ც\",\"ჩ\",\"შ\",\"ყ\",\"ღ\",\"ქ\",\"ფ\",\"ჳ\",\"ტ\",\"ს\",\"რ\",\"ჟ\",\"პ\",\"ო\",\"ჲ\",\"ნ\",\"მ\",\"ლ\",\"კ\",\"ი\",\"თ\",\"ჱ\",\"ზ\",\"ვ\",\"ე\",\"დ\",\"გ\",\"ბ\",\"ა\"]},un=\"마이너스\",Fn=function(A,e,t){var r=t?\". \":\"\",B=t?\"、\":\"\",n=t?\", \":\"\",s=t?\" \":\"\";switch(e){case 0:return\"•\"+s;case 1:return\"◦\"+s;case 2:return\"◾\"+s;case 5:var o=Qn(A,48,57,!0,r);return o.length<4?\"0\"+o:o;case 4:return cn(A,\"〇一二三四五六七八九\",B);case 6:return sn(A,1,3999,wn,3,r).toLowerCase();case 7:return sn(A,1,3999,wn,3,r);case 8:return Qn(A,945,969,!1,r);case 9:return Qn(A,97,122,!1,r);case 10:return Qn(A,65,90,!1,r);case 11:return Qn(A,1632,1641,!0,r);case 12:case 49:return sn(A,1,9999,Un,3,r);case 35:return sn(A,1,9999,Un,3,r).toLowerCase();case 13:return Qn(A,2534,2543,!0,r);case 14:case 30:return Qn(A,6112,6121,!0,r);case 15:return cn(A,\"子丑寅卯辰巳午未申酉戌亥\",B);case 16:return cn(A,\"甲乙丙丁戊己庚辛壬癸\",B);case 17:case 48:return an(A,\"零一二三四五六七八九\",\"十百千萬\",\"負\",B,14);case 47:return an(A,\"零壹貳參肆伍陸柒捌玖\",\"拾佰仟萬\",\"負\",B,15);case 42:return an(A,\"零一二三四五六七八九\",\"十百千萬\",\"负\",B,14);case 41:return an(A,\"零壹贰叁肆伍陆柒捌玖\",\"拾佰仟萬\",\"负\",B,15);case 26:return an(A,\"〇一二三四五六七八九\",\"十百千万\",\"マイナス\",B,0);case 25:return an(A,\"零壱弐参四伍六七八九\",\"拾百千万\",\"マイナス\",B,7);case 31:return an(A,\"영일이삼사오육칠팔구\",\"십백천만\",un,n,7);case 33:return an(A,\"零一二三四五六七八九\",\"十百千萬\",un,n,0);case 32:return an(A,\"零壹貳參四五六七八九\",\"拾百千\",un,n,7);case 18:return Qn(A,2406,2415,!0,r);case 20:return sn(A,1,19999,Cn,3,r);case 21:return Qn(A,2790,2799,!0,r);case 22:return Qn(A,2662,2671,!0,r);case 22:return sn(A,1,10999,ln,3,r);case 23:return cn(A,\"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん\");case 24:return cn(A,\"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす\");case 27:return Qn(A,3302,3311,!0,r);case 28:return cn(A,\"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン\",B);case 29:return cn(A,\"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス\",B);case 34:return Qn(A,3792,3801,!0,r);case 37:return Qn(A,6160,6169,!0,r);case 38:return Qn(A,4160,4169,!0,r);case 39:return Qn(A,2918,2927,!0,r);case 40:return Qn(A,1776,1785,!0,r);case 43:return Qn(A,3046,3055,!0,r);case 44:return Qn(A,3174,3183,!0,r);case 45:return Qn(A,3664,3673,!0,r);case 46:return Qn(A,3872,3881,!0,r);default:return Qn(A,48,57,!0,r)}},hn=\"data-html2canvas-ignore\",dn=(fn.prototype.toIFrame=function(A,r){var e=this,B=pn(A,r);if(!B.contentWindow)return Promise.reject(\"Unable to find iframe window\");var t=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,s=B.contentWindow,o=s.document,A=In(B).then(function(){return a(e,void 0,void 0,function(){var e,t;return H(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(bn),s&&(s.scrollTo(r.left,r.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===r.top&&s.scrollX===r.left||(this.context.logger.warn(\"Unable to restore scroll position for cloned document\"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-r.left,s.scrollY-r.top,0,0))),e=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject(\"Error finding the \"+this.referenceElement.nodeName+\" in the cloned document\")]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:A.sent(),A.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,En(o)]:[3,4];case 3:A.sent(),A.label=4;case 4:return\"function\"==typeof e?[2,Promise.resolve().then(function(){return e(o,t)}).then(function(){return B})]:[2,B]}})})});return o.open(),o.write(mn(document.doctype)+\"<html></html>\"),Ln(this.referenceElement.ownerDocument,t,n),o.replaceChild(o.adoptNode(this.documentElement),o.documentElement),o.close(),A},fn.prototype.createElementClone=function(A){if(Cr(A,2),zB(A))return this.createCanvasClone(A);if(MB(A))return this.createVideoClone(A);if(SB(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return $B(e)&&($B(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=\"\"),\"lazy\"===e.loading&&(e.loading=\"eager\")),TB(e)?this.createCustomElementClone(e):e},fn.prototype.createCustomElementClone=function(A){var e=document.createElement(\"html2canvascustomelement\");return Kn(A.style,e),e},fn.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&\"string\"==typeof e.cssText?A+e.cssText:A},\"\"),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(this.context.logger.error(\"Unable to access cssRules property\",A),\"SecurityError\"!==A.name)throw A}return A.cloneNode(!1)},fn.prototype.createCanvasClone=function(e){var A;if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement(\"img\");try{return t.src=e.toDataURL(),t}catch(A){this.context.logger.info(\"Unable to inline canvas contents, canvas is tainted\",e)}}t=e.cloneNode(!1);try{t.width=e.width,t.height=e.height;var r,B,n=e.getContext(\"2d\"),s=t.getContext(\"2d\");return s&&(!this.options.allowTaint&&n?s.putImageData(n.getImageData(0,0,e.width,e.height),0,0):(!(r=null!==(A=e.getContext(\"webgl2\"))&&void 0!==A?A:e.getContext(\"webgl\"))||!1===(null==(B=r.getContextAttributes())?void 0:B.preserveDrawingBuffer)&&this.context.logger.warn(\"Unable to clone WebGL context as it has preserveDrawingBuffer=false\",e),s.drawImage(e,0,0))),t}catch(A){this.context.logger.info(\"Unable to clone canvas as it is tainted\",e)}return t},fn.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement(\"canvas\");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext(\"2d\");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info(\"Unable to clone video as it is tainted\",e)}A=e.ownerDocument.createElement(\"canvas\");return A.width=e.offsetWidth,A.height=e.offsetHeight,A},fn.prototype.appendChildNode=function(A,e,t){XB(e)&&(\"SCRIPT\"===e.tagName||e.hasAttribute(hn)||\"function\"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&XB(e)&&SB(e)||A.appendChild(this.cloneNode(e,t))},fn.prototype.cloneChildNodes=function(A,e,t){for(var r,B=this,n=(A.shadowRoot||A).firstChild;n;n=n.nextSibling)XB(n)&&rn(n)&&\"function\"==typeof n.assignedNodes?(r=n.assignedNodes()).length&&r.forEach(function(A){return B.appendChildNode(e,A,t)}):this.appendChildNode(e,n,t)},fn.prototype.cloneNode=function(A,e){if(PB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&XB(A)&&(JB(A)||YB(A))){var r=this.createElementClone(A);r.style.transitionProperty=\"none\";var B=t.getComputedStyle(A),n=t.getComputedStyle(A,\":before\"),s=t.getComputedStyle(A,\":after\");this.referenceElement===A&&JB(r)&&(this.clonedReferenceElement=r),jB(r)&&Mn(r);t=this.counters.parse(new Ur(this.context,B)),n=this.resolvePseudoContent(A,r,n,gn.BEFORE);TB(A)&&(e=!0),MB(A)||this.cloneChildNodes(A,r,e),n&&r.insertBefore(n,r.firstChild);s=this.resolvePseudoContent(A,r,s,gn.AFTER);return s&&r.appendChild(s),this.counters.pop(t),(B&&(this.options.copyStyles||YB(A))&&!An(A)||e)&&Kn(B,r),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(en(A)||tn(A))&&(en(r)||tn(r))&&(r.value=A.value),r}return A.cloneNode(!1)},fn.prototype.resolvePseudoContent=function(o,A,e,t){var i=this;if(e){var r=e.content,Q=A.ownerDocument;if(Q&&r&&\"none\"!==r&&\"-moz-alt-content\"!==r&&\"none\"!==e.display){this.counters.parse(new Ur(this.context,e));var c=new wr(this.context,e),a=Q.createElement(\"html2canvaspseudoelement\");Kn(e,a),c.content.forEach(function(A){if(0===A.type)a.appendChild(Q.createTextNode(A.value));else if(22===A.type){var e=Q.createElement(\"img\");e.src=A.value,e.style.opacity=\"1\",a.appendChild(e)}else if(18===A.type){var t,r,B,n,s;\"attr\"===A.name?(e=A.values.filter(_A)).length&&a.appendChild(Q.createTextNode(o.getAttribute(e[0].value)||\"\")):\"counter\"===A.name?(B=(r=A.values.filter($A))[0],r=r[1],B&&_A(B)&&(t=i.counters.getCounterValue(B.value),s=r&&_A(r)?pt.parse(i.context,r.value):3,a.appendChild(Q.createTextNode(Fn(t,s,!1))))):\"counters\"===A.name&&(B=(t=A.values.filter($A))[0],s=t[1],r=t[2],B&&_A(B)&&(B=i.counters.getCounterValues(B.value),n=r&&_A(r)?pt.parse(i.context,r.value):3,s=s&&0===s.type?s.value:\"\",s=B.map(function(A){return Fn(A,n,!1)}).join(s),a.appendChild(Q.createTextNode(s))))}else if(20===A.type)switch(A.value){case\"open-quote\":a.appendChild(Q.createTextNode(Xt(c.quotes,i.quoteDepth++,!0)));break;case\"close-quote\":a.appendChild(Q.createTextNode(Xt(c.quotes,--i.quoteDepth,!1)));break;default:a.appendChild(Q.createTextNode(A.value))}}),a.className=Dn+\" \"+vn;t=t===gn.BEFORE?\" \"+Dn:\" \"+vn;return YB(A)?A.className.baseValue+=t:A.className+=t,a}}},fn.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},fn);function fn(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Bn,this.quoteDepth=0,!e.ownerDocument)throw new Error(\"Cloned element does not have an owner document\");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}(he=gn=gn||{})[he.BEFORE=0]=\"BEFORE\",he[he.AFTER=1]=\"AFTER\";function Hn(e){return new Promise(function(A){!e.complete&&e.src?(e.onload=A,e.onerror=A):A()})}var pn=function(A,e){var t=A.createElement(\"iframe\");return t.className=\"html2canvas-container\",t.style.visibility=\"hidden\",t.style.position=\"fixed\",t.style.left=\"-10000px\",t.style.top=\"0px\",t.style.border=\"0\",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling=\"no\",t.setAttribute(hn,\"true\"),A.body.appendChild(t),t},En=function(A){return Promise.all([].slice.call(A.images,0).map(Hn))},In=function(B){return new Promise(function(e,A){var t=B.contentWindow;if(!t)return A(\"No window assigned for iframe\");var r=t.document;t.onload=B.onload=function(){t.onload=B.onload=null;var A=setInterval(function(){0<r.body.childNodes.length&&\"complete\"===r.readyState&&(clearInterval(A),e(B))},50)}})},yn=[\"all\",\"d\",\"content\"],Kn=function(A,e){for(var t=A.length-1;0<=t;t--){var r=A.item(t);-1===yn.indexOf(r)&&e.style.setProperty(r,A.getPropertyValue(r))}return e},mn=function(A){var e=\"\";return A&&(e+=\"<!DOCTYPE \",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='\"'+A.publicId+'\"'),A.systemId&&(e+='\"'+A.systemId+'\"'),e+=\">\"),e},Ln=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},bn=function(A){var e=A[0],t=A[1],A=A[2];e.scrollLeft=t,e.scrollTop=A},Dn=\"___html2canvas___pseudoelement_before\",vn=\"___html2canvas___pseudoelement_after\",xn='{\\n    content: \"\" !important;\\n    display: none !important;\\n}',Mn=function(A){Sn(A,\".\"+Dn+\":before\"+xn+\"\\n         .\"+vn+\":after\"+xn)},Sn=function(A,e){var t=A.ownerDocument;t&&((t=t.createElement(\"style\")).textContent=e,A.appendChild(t))},Tn=(Gn.getOrigin=function(A){var e=Gn._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):\"about:blank\"},Gn.isSameOrigin=function(A){return Gn.getOrigin(A)===Gn._origin},Gn.setContext=function(A){Gn._link=A.document.createElement(\"a\"),Gn._origin=Gn.getOrigin(A.location.href)},Gn._origin=\"about:blank\",Gn);function Gn(){}var On=(Vn.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Yn(A)||Pn(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},Vn.prototype.match=function(A){return this._cache[A]},Vn.prototype.loadImage=function(s){return a(this,void 0,void 0,function(){var e,r,t,B,n=this;return H(this,function(A){switch(A.label){case 0:return(e=Tn.isSameOrigin(s),r=!Xn(s)&&!0===this._options.useCORS&&Xr.SUPPORT_CORS_IMAGES&&!e,t=!Xn(s)&&!e&&!Yn(s)&&\"string\"==typeof this._options.proxy&&Xr.SUPPORT_CORS_XHR&&!r,e||!1!==this._options.allowTaint||Xn(s)||Yn(s)||t||r)?(B=s,t?[4,this.proxy(B)]:[3,2]):[2];case 1:B=A.sent(),A.label=2;case 2:return this.context.logger.debug(\"Added image \"+s.substring(0,256)),[4,new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(Jn(B)||r)&&(t.crossOrigin=\"anonymous\"),t.src=B,!0===t.complete&&setTimeout(function(){return A(t)},500),0<n._options.imageTimeout&&setTimeout(function(){return e(\"Timed out (\"+n._options.imageTimeout+\"ms) loading image\")},n._options.imageTimeout)})];case 3:return[2,A.sent()]}})})},Vn.prototype.has=function(A){return void 0!==this._cache[A]},Vn.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Vn.prototype.proxy=function(s){var o=this,i=this._options.proxy;if(!i)throw new Error(\"No proxy defined\");var Q=s.substring(0,256);return new Promise(function(e,t){var r=Xr.SUPPORT_RESPONSE_TYPE?\"blob\":\"text\",B=new XMLHttpRequest;B.onload=function(){var A;200===B.status?\"text\"==r?e(B.response):((A=new FileReader).addEventListener(\"load\",function(){return e(A.result)},!1),A.addEventListener(\"error\",function(A){return t(A)},!1),A.readAsDataURL(B.response)):t(\"Failed to proxy resource \"+Q+\" with status code \"+B.status)},B.onerror=t;var A,n=-1<i.indexOf(\"?\")?\"&\":\"?\";B.open(\"GET\",i+n+\"url=\"+encodeURIComponent(s)+\"&responseType=\"+r),\"text\"!=r&&B instanceof XMLHttpRequest&&(B.responseType=r),o._options.imageTimeout&&(A=o._options.imageTimeout,B.timeout=A,B.ontimeout=function(){return t(\"Timed out (\"+A+\"ms) proxying \"+Q)}),B.send()})},Vn);function Vn(A,e){this.context=A,this._options=e,this._cache={}}var kn=/^data:image\\/svg\\+xml/i,Rn=/^data:image\\/.*;base64,/i,Nn=/^data:image\\/.*/i,Pn=function(A){return Xr.SUPPORT_SVG_DRAWING||!Wn(A)},Xn=function(A){return Nn.test(A)},Jn=function(A){return Rn.test(A)},Yn=function(A){return\"blob\"===A.substr(0,4)},Wn=function(A){return\"svg\"===A.substr(-3).toLowerCase()||kn.test(A)},Zn=(_n.prototype.add=function(A,e){return new _n(this.x+A,this.y+e)},_n);function _n(A,e){this.type=0,this.x=A,this.y=e}function qn(A,e,t){return new Zn(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var jn=(zn.prototype.subdivide=function(A,e){var t=qn(this.start,this.startControl,A),r=qn(this.startControl,this.endControl,A),B=qn(this.endControl,this.end,A),n=qn(t,r,A),r=qn(r,B,A),A=qn(n,r,A);return e?new zn(this.start,t,n,A):new zn(A,r,B,this.end)},zn.prototype.add=function(A,e){return new zn(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},zn.prototype.reverse=function(){return new zn(this.end,this.endControl,this.startControl,this.start)},zn);function zn(A,e,t,r){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=r}function $n(A){return 1===A.type}var As,es=function(A){var e=A.styles,t=A.bounds,r=(C=Be(e.borderTopLeftRadius,t.width,t.height))[0],B=C[1],n=(u=Be(e.borderTopRightRadius,t.width,t.height))[0],s=u[1],o=(F=Be(e.borderBottomRightRadius,t.width,t.height))[0],i=F[1],Q=(h=Be(e.borderBottomLeftRadius,t.width,t.height))[0],c=h[1];(d=[]).push((r+n)/t.width),d.push((Q+o)/t.width),d.push((B+c)/t.height),d.push((s+i)/t.height),1<(f=Math.max.apply(Math,d))&&(r/=f,B/=f,n/=f,s/=f,o/=f,i/=f,Q/=f,c/=f);var a=t.width-n,g=t.height-i,w=t.width-o,U=t.height-c,l=e.borderTopWidth,C=e.borderRightWidth,u=e.borderBottomWidth,F=e.borderLeftWidth,h=Ue(e.paddingTop,A.bounds.width),d=Ue(e.paddingRight,A.bounds.width),f=Ue(e.paddingBottom,A.bounds.width),A=Ue(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=0<r||0<B?ss(t.left+F/3,t.top+l/3,r-F/3,B-l/3,As.TOP_LEFT):new Zn(t.left+F/3,t.top+l/3),this.topRightBorderDoubleOuterBox=0<r||0<B?ss(t.left+a,t.top+l/3,n-C/3,s-l/3,As.TOP_RIGHT):new Zn(t.left+t.width-C/3,t.top+l/3),this.bottomRightBorderDoubleOuterBox=0<o||0<i?ss(t.left+w,t.top+g,o-C/3,i-u/3,As.BOTTOM_RIGHT):new Zn(t.left+t.width-C/3,t.top+t.height-u/3),this.bottomLeftBorderDoubleOuterBox=0<Q||0<c?ss(t.left+F/3,t.top+U,Q-F/3,c-u/3,As.BOTTOM_LEFT):new Zn(t.left+F/3,t.top+t.height-u/3),this.topLeftBorderDoubleInnerBox=0<r||0<B?ss(t.left+2*F/3,t.top+2*l/3,r-2*F/3,B-2*l/3,As.TOP_LEFT):new Zn(t.left+2*F/3,t.top+2*l/3),this.topRightBorderDoubleInnerBox=0<r||0<B?ss(t.left+a,t.top+2*l/3,n-2*C/3,s-2*l/3,As.TOP_RIGHT):new Zn(t.left+t.width-2*C/3,t.top+2*l/3),this.bottomRightBorderDoubleInnerBox=0<o||0<i?ss(t.left+w,t.top+g,o-2*C/3,i-2*u/3,As.BOTTOM_RIGHT):new Zn(t.left+t.width-2*C/3,t.top+t.height-2*u/3),this.bottomLeftBorderDoubleInnerBox=0<Q||0<c?ss(t.left+2*F/3,t.top+U,Q-2*F/3,c-2*u/3,As.BOTTOM_LEFT):new Zn(t.left+2*F/3,t.top+t.height-2*u/3),this.topLeftBorderStroke=0<r||0<B?ss(t.left+F/2,t.top+l/2,r-F/2,B-l/2,As.TOP_LEFT):new Zn(t.left+F/2,t.top+l/2),this.topRightBorderStroke=0<r||0<B?ss(t.left+a,t.top+l/2,n-C/2,s-l/2,As.TOP_RIGHT):new Zn(t.left+t.width-C/2,t.top+l/2),this.bottomRightBorderStroke=0<o||0<i?ss(t.left+w,t.top+g,o-C/2,i-u/2,As.BOTTOM_RIGHT):new Zn(t.left+t.width-C/2,t.top+t.height-u/2),this.bottomLeftBorderStroke=0<Q||0<c?ss(t.left+F/2,t.top+U,Q-F/2,c-u/2,As.BOTTOM_LEFT):new Zn(t.left+F/2,t.top+t.height-u/2),this.topLeftBorderBox=0<r||0<B?ss(t.left,t.top,r,B,As.TOP_LEFT):new Zn(t.left,t.top),this.topRightBorderBox=0<n||0<s?ss(t.left+a,t.top,n,s,As.TOP_RIGHT):new Zn(t.left+t.width,t.top),this.bottomRightBorderBox=0<o||0<i?ss(t.left+w,t.top+g,o,i,As.BOTTOM_RIGHT):new Zn(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=0<Q||0<c?ss(t.left,t.top+U,Q,c,As.BOTTOM_LEFT):new Zn(t.left,t.top+t.height),this.topLeftPaddingBox=0<r||0<B?ss(t.left+F,t.top+l,Math.max(0,r-F),Math.max(0,B-l),As.TOP_LEFT):new Zn(t.left+F,t.top+l),this.topRightPaddingBox=0<n||0<s?ss(t.left+Math.min(a,t.width-C),t.top+l,a>t.width+C?0:Math.max(0,n-C),Math.max(0,s-l),As.TOP_RIGHT):new Zn(t.left+t.width-C,t.top+l),this.bottomRightPaddingBox=0<o||0<i?ss(t.left+Math.min(w,t.width-F),t.top+Math.min(g,t.height-u),Math.max(0,o-C),Math.max(0,i-u),As.BOTTOM_RIGHT):new Zn(t.left+t.width-C,t.top+t.height-u),this.bottomLeftPaddingBox=0<Q||0<c?ss(t.left+F,t.top+Math.min(U,t.height-u),Math.max(0,Q-F),Math.max(0,c-u),As.BOTTOM_LEFT):new Zn(t.left+F,t.top+t.height-u),this.topLeftContentBox=0<r||0<B?ss(t.left+F+A,t.top+l+h,Math.max(0,r-(F+A)),Math.max(0,B-(l+h)),As.TOP_LEFT):new Zn(t.left+F+A,t.top+l+h),this.topRightContentBox=0<n||0<s?ss(t.left+Math.min(a,t.width+F+A),t.top+l+h,a>t.width+F+A?0:n-F+A,s-(l+h),As.TOP_RIGHT):new Zn(t.left+t.width-(C+d),t.top+l+h),this.bottomRightContentBox=0<o||0<i?ss(t.left+Math.min(w,t.width-(F+A)),t.top+Math.min(g,t.height+l+h),Math.max(0,o-(C+d)),i-(u+f),As.BOTTOM_RIGHT):new Zn(t.left+t.width-(C+d),t.top+t.height-(u+f)),this.bottomLeftContentBox=0<Q||0<c?ss(t.left+F+A,t.top+U,Math.max(0,Q-(F+A)),c-(u+f),As.BOTTOM_LEFT):new Zn(t.left+F+A,t.top+t.height-(u+f))};(he=As=As||{})[he.TOP_LEFT=0]=\"TOP_LEFT\",he[he.TOP_RIGHT=1]=\"TOP_RIGHT\",he[he.BOTTOM_RIGHT=2]=\"BOTTOM_RIGHT\",he[he.BOTTOM_LEFT=3]=\"BOTTOM_LEFT\";function ts(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]}function rs(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]}function Bs(A){return 1===A.type}function ns(A,t){return A.length===t.length&&A.some(function(A,e){return A===t[e]})}var ss=function(A,e,t,r,B){var n=(Math.sqrt(2)-1)/3*4,s=t*n,o=r*n,i=A+t,Q=e+r;switch(B){case As.TOP_LEFT:return new jn(new Zn(A,Q),new Zn(A,Q-o),new Zn(i-s,e),new Zn(i,e));case As.TOP_RIGHT:return new jn(new Zn(A,e),new Zn(A+s,e),new Zn(i,Q-o),new Zn(i,Q));case As.BOTTOM_RIGHT:return new jn(new Zn(i,e),new Zn(i,e+o),new Zn(A+s,Q),new Zn(A,Q));default:As.BOTTOM_LEFT;return new jn(new Zn(i,Q),new Zn(i-s,Q),new Zn(A,e+o),new Zn(A,e))}},os=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},is=function(A,e){this.path=A,this.target=e,this.type=1},Qs=function(A){this.opacity=A,this.type=2,this.target=6},cs=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},as=(gs.prototype.getEffects=function(e){for(var A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var B,n,s=t.effects.filter(function(A){return!Bs(A)});A||0!==t.container.styles.position||!t.parent?(r.unshift.apply(r,s),A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX&&(B=ts(t.curves),n=rs(t.curves),ns(B,n)||r.unshift(new is(n,6)))):r.unshift.apply(r,s),t=t.parent}return r.filter(function(A){return Pt(A.target,e)})},gs);function gs(A,e){var t,r;this.container=A,this.parent=e,this.effects=[],this.curves=new es(this.container),this.container.styles.opacity<1&&this.effects.push(new Qs(this.container.styles.opacity)),null!==this.container.styles.transform&&(e=this.container.bounds.left+this.container.styles.transformOrigin[0].number,t=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform,this.effects.push(new os(e,t,r))),0!==this.container.styles.overflowX&&(t=ts(this.curves),r=rs(this.curves),ns(t,r)?this.effects.push(new is(t,6)):(this.effects.push(new is(t,2)),this.effects.push(new is(r,4))))}function ws(A,e){switch(e){case 0:return Hs(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Hs(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Hs(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Hs(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}function Us(A){var e=A.bounds,A=A.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))}function ls(A){var e=A.styles,t=A.bounds,r=Ue(e.paddingLeft,t.width),B=Ue(e.paddingRight,t.width),n=Ue(e.paddingTop,t.width),A=Ue(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,n+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+B),-(e.borderTopWidth+e.borderBottomWidth+n+A))}function Cs(A,e,t){var r=(B=Es(A.styles.backgroundOrigin,e),n=A,0===B?n.bounds:(2===B?ls:Us)(n)),B=(s=Es(A.styles.backgroundClip,e),o=A,0===s?o.bounds:(2===s?ls:Us)(o)),n=ps(Es(A.styles.backgroundSize,e),t,r),s=n[0],o=n[1],t=Be(Es(A.styles.backgroundPosition,e),r.width-s,r.height-o);return[Is(Es(A.styles.backgroundRepeat,e),t,n,r,B),Math.round(r.left+t[0]),Math.round(r.top+t[1]),s,o]}function us(A){return _A(A)&&A.value===Ve.AUTO}function Fs(A){return\"number\"==typeof A}var hs=function(Q,c,a,g){Q.container.elements.forEach(function(A){var e=Pt(A.flags,4),t=Pt(A.flags,2),r=new as(A,Q);Pt(A.styles.display,2048)&&g.push(r);var B,n,s,o,i=Pt(A.flags,8)?[]:g;e||t?(B=e||A.styles.isPositioned()?a:c,t=new cs(r),A.styles.isPositioned()||A.styles.opacity<1||A.styles.isTransformed()?(n=A.styles.zIndex.order)<0?(s=0,B.negativeZIndex.some(function(A,e){return n>A.element.container.styles.zIndex.order?(s=e,!1):0<s}),B.negativeZIndex.splice(s,0,t)):0<n?(o=0,B.positiveZIndex.some(function(A,e){return n>=A.element.container.styles.zIndex.order?(o=e+1,!1):0<o}),B.positiveZIndex.splice(o,0,t)):B.zeroOrAutoZIndexOrTransformedOrOpacity.push(t):(A.styles.isFloating()?B.nonPositionedFloats:B.nonPositionedInlineLevel).push(t),hs(r,t,e?t:a,i)):((A.styles.isInlineLevel()?c.inlineLevel:c.nonInlineLevel).push(r),hs(r,c,a,i)),Pt(A.flags,8)&&ds(A,i)})},ds=function(A,e){for(var t=A instanceof UB?A.start:1,r=A instanceof UB&&A.reversed,B=0;B<e.length;B++){var n=e[B];n.container instanceof aB&&\"number\"==typeof n.container.value&&0!==n.container.value&&(t=n.container.value),n.listValue=Fn(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},fs=function(A,e){var t=[];return $n(A)?t.push(A.subdivide(.5,!1)):t.push(A),$n(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Hs=function(A,e,t,r){var B=[];return $n(A)?B.push(A.subdivide(.5,!1)):B.push(A),$n(t)?B.push(t.subdivide(.5,!0)):B.push(t),$n(r)?B.push(r.subdivide(.5,!0).reverse()):B.push(r),$n(e)?B.push(e.subdivide(.5,!1).reverse()):B.push(e),B},ps=function(A,e,t){var r=e[0],B=e[1],n=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(te(s)&&o&&te(o))return[Ue(s,t.width),Ue(o,t.height)];var i=Fs(n);if(_A(s)&&(s.value===Ve.CONTAIN||s.value===Ve.COVER))return Fs(n)?t.width/t.height<n!=(s.value===Ve.COVER)?[t.width,t.width/n]:[t.height*n,t.height]:[t.width,t.height];var Q=Fs(r),e=Fs(B),A=Q||e;if(us(s)&&(!o||us(o)))return Q&&e?[r,B]:i||A?A&&i?[Q?r:B*n,e?B:r/n]:[Q?r:t.width,e?B:t.height]:[t.width,t.height];if(i){var c=0,a=0;return te(s)?c=Ue(s,t.width):te(o)&&(a=Ue(o,t.height)),us(s)?c=a*n:o&&!us(o)||(a=c/n),[c,a]}c=null,a=null;if(te(s)?c=Ue(s,t.width):o&&te(o)&&(a=Ue(o,t.height)),null!==(c=null!==(a=null!==c&&(!o||us(o))?Q&&e?c/r*B:t.height:a)&&us(s)?Q&&e?a/B*r:t.width:c)&&null!==a)return[c,a];throw new Error(\"Unable to calculate background-size for element\")},Es=function(A,e){e=A[e];return void 0===e?A[0]:e},Is=function(A,e,t,r,B){var n=e[0],s=e[1],o=t[0],i=t[1];switch(A){case 2:return[new Zn(Math.round(r.left),Math.round(r.top+s)),new Zn(Math.round(r.left+r.width),Math.round(r.top+s)),new Zn(Math.round(r.left+r.width),Math.round(i+r.top+s)),new Zn(Math.round(r.left),Math.round(i+r.top+s))];case 3:return[new Zn(Math.round(r.left+n),Math.round(r.top)),new Zn(Math.round(r.left+n+o),Math.round(r.top)),new Zn(Math.round(r.left+n+o),Math.round(r.height+r.top)),new Zn(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new Zn(Math.round(r.left+n),Math.round(r.top+s)),new Zn(Math.round(r.left+n+o),Math.round(r.top+s)),new Zn(Math.round(r.left+n+o),Math.round(r.top+s+i)),new Zn(Math.round(r.left+n),Math.round(r.top+s+i))];default:return[new Zn(Math.round(B.left),Math.round(B.top)),new Zn(Math.round(B.left+B.width),Math.round(B.top)),new Zn(Math.round(B.left+B.width),Math.round(B.height+B.top)),new Zn(Math.round(B.left),Math.round(B.height+B.top))]}},ys=\"Hidden Text\",Ks=(ms.prototype.parseMetrics=function(A,e){var t=this._document.createElement(\"div\"),r=this._document.createElement(\"img\"),B=this._document.createElement(\"span\"),n=this._document.body;t.style.visibility=\"hidden\",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin=\"0\",t.style.padding=\"0\",t.style.whiteSpace=\"nowrap\",n.appendChild(t),r.src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\",r.width=1,r.height=1,r.style.margin=\"0\",r.style.padding=\"0\",r.style.verticalAlign=\"baseline\",B.style.fontFamily=A,B.style.fontSize=e,B.style.margin=\"0\",B.style.padding=\"0\",B.appendChild(this._document.createTextNode(ys)),t.appendChild(B),t.appendChild(r);e=r.offsetTop-B.offsetTop+2;t.removeChild(B),t.appendChild(this._document.createTextNode(ys)),t.style.lineHeight=\"normal\",r.style.verticalAlign=\"super\";r=r.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:e,middle:r}},ms.prototype.getMetrics=function(A,e){var t=A+\" \"+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},ms);function ms(A){this._data={},this._document=A}var Ls,he=function(A,e){this.context=A,this.options=e},bs=(A(Ds,Ls=he),Ds.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach(function(A){return e.applyEffect(A)})},Ds.prototype.applyEffect=function(A){this.ctx.save(),2===A.type&&(this.ctx.globalAlpha=A.opacity),0===A.type&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),Bs(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},Ds.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},Ds.prototype.renderStack=function(e){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:A.sent(),A.label=2;case 2:return[2]}})})},Ds.prototype.renderNode=function(e){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return Pt(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(e)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},Ds.prototype.renderTextWithLetterSpacing=function(t,A,r){var B=this;0===A?this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+r):Zr(t.text).reduce(function(A,e){return B.ctx.fillText(e,A,t.bounds.top+r),A+B.ctx.measureText(e).width},t.bounds.left)},Ds.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return\"normal\"===A||\"small-caps\"===A}).join(\"\"),t=Gs(A.fontFamily).join(\", \"),r=WA(A.fontSize)?\"\"+A.fontSize.number+A.fontSize.unit:A.fontSize.number+\"px\";return[[A.fontStyle,e,A.fontWeight,r,t].join(\" \"),t,r]},Ds.prototype.renderTextNode=function(i,Q){return a(this,void 0,void 0,function(){var e,t,r,B,n,s,o=this;return H(this,function(A){return r=this.createFontStyle(Q),e=r[0],t=r[1],r=r[2],this.ctx.font=e,this.ctx.direction=1===Q.direction?\"rtl\":\"ltr\",this.ctx.textAlign=\"left\",this.ctx.textBaseline=\"alphabetic\",r=this.fontMetrics.getMetrics(t,r),B=r.baseline,n=r.middle,s=Q.paintOrder,i.textBounds.forEach(function(t){s.forEach(function(A){switch(A){case 0:o.ctx.fillStyle=ie(Q.color),o.renderTextWithLetterSpacing(t,Q.letterSpacing,B);var e=Q.textShadow;e.length&&t.text.trim().length&&(e.slice(0).reverse().forEach(function(A){o.ctx.shadowColor=ie(A.color),o.ctx.shadowOffsetX=A.offsetX.number*o.options.scale,o.ctx.shadowOffsetY=A.offsetY.number*o.options.scale,o.ctx.shadowBlur=A.blur.number,o.renderTextWithLetterSpacing(t,Q.letterSpacing,B)}),o.ctx.shadowColor=\"\",o.ctx.shadowOffsetX=0,o.ctx.shadowOffsetY=0,o.ctx.shadowBlur=0),Q.textDecorationLine.length&&(o.ctx.fillStyle=ie(Q.textDecorationColor||Q.color),Q.textDecorationLine.forEach(function(A){switch(A){case 1:o.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top+B),t.bounds.width,1);break;case 2:o.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top),t.bounds.width,1);break;case 3:o.ctx.fillRect(t.bounds.left,Math.ceil(t.bounds.top+n),t.bounds.width,1)}}));break;case 1:Q.webkitTextStrokeWidth&&t.text.trim().length&&(o.ctx.strokeStyle=ie(Q.webkitTextStrokeColor),o.ctx.lineWidth=Q.webkitTextStrokeWidth,o.ctx.lineJoin=window.chrome?\"miter\":\"round\",o.ctx.strokeText(t.text,t.bounds.left,t.bounds.top+B)),o.ctx.strokeStyle=\"\",o.ctx.lineWidth=0,o.ctx.lineJoin=\"miter\"}})}),[2]})})},Ds.prototype.renderReplacedElement=function(A,e,t){var r;t&&0<A.intrinsicWidth&&0<A.intrinsicHeight&&(r=ls(A),e=rs(e),this.path(e),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore())},Ds.prototype.renderNodeContent=function(w){return a(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,Q,c,a,g;return H(this,function(A){switch(A.label){case 0:this.applyEffects(w.getEffects(4)),e=w.container,t=w.curves,r=e.styles,B=0,n=e.textNodes,A.label=1;case 1:return B<n.length?(s=n[B],[4,this.renderTextNode(s,r)]):[3,4];case 2:A.sent(),A.label=3;case 3:return B++,[3,1];case 4:if(!(e instanceof tB))return[3,8];A.label=5;case 5:return A.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return Q=A.sent(),this.renderReplacedElement(e,t,Q),[3,8];case 7:return A.sent(),this.context.logger.error(\"Error loading image \"+e.src),[3,8];case 8:if(e instanceof nB&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof iB))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return Q=A.sent(),this.renderReplacedElement(e,t,Q),[3,12];case 11:return A.sent(),this.context.logger.error(\"Error loading svg \"+e.svg.substring(0,255)),[3,12];case 12:return e instanceof vB&&e.tree?[4,new Ds(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:s=A.sent(),e.width&&e.height&&this.ctx.drawImage(s,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),A.label=14;case 14:if(e instanceof pB&&(i=Math.min(e.bounds.width,e.bounds.height),e.type===hB?e.checked&&(this.ctx.save(),this.path([new Zn(e.bounds.left+.39363*i,e.bounds.top+.79*i),new Zn(e.bounds.left+.16*i,e.bounds.top+.5549*i),new Zn(e.bounds.left+.27347*i,e.bounds.top+.44071*i),new Zn(e.bounds.left+.39694*i,e.bounds.top+.5649*i),new Zn(e.bounds.left+.72983*i,e.bounds.top+.23*i),new Zn(e.bounds.left+.84*i,e.bounds.top+.34085*i),new Zn(e.bounds.left+.39363*i,e.bounds.top+.79*i)]),this.ctx.fillStyle=ie(HB),this.ctx.fill(),this.ctx.restore()):e.type===dB&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+i/2,e.bounds.top+i/2,i/4,0,2*Math.PI,!0),this.ctx.fillStyle=ie(HB),this.ctx.fill(),this.ctx.restore())),xs(e)&&e.value.length){switch(c=this.createFontStyle(r),a=c[0],i=c[1],c=this.fontMetrics.getMetrics(a,i).baseline,this.ctx.font=a,this.ctx.fillStyle=ie(r.color),this.ctx.textBaseline=\"alphabetic\",this.ctx.textAlign=Ss(e.styles.textAlign),g=ls(e),o=0,e.styles.textAlign){case 1:o+=g.width/2;break;case 2:o+=g.width}i=g.add(o,0,0,-g.height/2+1),this.ctx.save(),this.path([new Zn(g.left,g.top),new Zn(g.left+g.width,g.top),new Zn(g.left+g.width,g.top+g.height),new Zn(g.left,g.top+g.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Jr(e.value,i),r.letterSpacing,c),this.ctx.restore(),this.ctx.textBaseline=\"alphabetic\",this.ctx.textAlign=\"left\"}if(!Pt(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(c=e.styles.listStyleImage).type)return[3,18];Q=void 0,c=c.url,A.label=15;case 15:return A.trys.push([15,17,,18]),[4,this.context.cache.match(c)];case 16:return Q=A.sent(),this.ctx.drawImage(Q,e.bounds.left-(Q.width+10),e.bounds.top),[3,18];case 17:return A.sent(),this.context.logger.error(\"Error loading list-style-image \"+c),[3,18];case 18:return[3,20];case 19:w.listValue&&-1!==e.styles.listStyleType&&(a=this.createFontStyle(r)[0],this.ctx.font=a,this.ctx.fillStyle=ie(r.color),this.ctx.textBaseline=\"middle\",this.ctx.textAlign=\"right\",g=new d(e.bounds.left,e.bounds.top+Ue(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ye(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Jr(w.listValue,g),r.letterSpacing,Ye(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline=\"bottom\",this.ctx.textAlign=\"left\"),A.label=20;case 20:return[2]}})})},Ds.prototype.renderStackContent=function(C){return a(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,Q,c,a,g,w,U,l;return H(this,function(A){switch(A.label){case 0:return Pt(C.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(C.element)];case 1:A.sent(),e=0,t=C.negativeZIndex,A.label=2;case 2:return e<t.length?(l=t[e],[4,this.renderStack(l)]):[3,5];case 3:A.sent(),A.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(C.element)];case 6:A.sent(),r=0,B=C.nonInlineLevel,A.label=7;case 7:return r<B.length?(l=B[r],[4,this.renderNode(l)]):[3,10];case 8:A.sent(),A.label=9;case 9:return r++,[3,7];case 10:n=0,s=C.nonPositionedFloats,A.label=11;case 11:return n<s.length?(l=s[n],[4,this.renderStack(l)]):[3,14];case 12:A.sent(),A.label=13;case 13:return n++,[3,11];case 14:o=0,i=C.nonPositionedInlineLevel,A.label=15;case 15:return o<i.length?(l=i[o],[4,this.renderStack(l)]):[3,18];case 16:A.sent(),A.label=17;case 17:return o++,[3,15];case 18:Q=0,c=C.inlineLevel,A.label=19;case 19:return Q<c.length?(l=c[Q],[4,this.renderNode(l)]):[3,22];case 20:A.sent(),A.label=21;case 21:return Q++,[3,19];case 22:a=0,g=C.zeroOrAutoZIndexOrTransformedOrOpacity,A.label=23;case 23:return a<g.length?(l=g[a],[4,this.renderStack(l)]):[3,26];case 24:A.sent(),A.label=25;case 25:return a++,[3,23];case 26:w=0,U=C.positiveZIndex,A.label=27;case 27:return w<U.length?(l=U[w],[4,this.renderStack(l)]):[3,30];case 28:A.sent(),A.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},Ds.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},Ds.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},Ds.prototype.formatPath=function(A){var r=this;A.forEach(function(A,e){var t=$n(A)?A.start:A;0===e?r.ctx.moveTo(t.x,t.y):r.ctx.lineTo(t.x,t.y),$n(A)&&r.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},Ds.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},Ds.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var r=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement(\"canvas\");return r.width=Math.max(1,e),r.height=Math.max(1,t),r.getContext(\"2d\").drawImage(A,0,0,A.width,A.height,0,0,e,t),r},Ds.prototype.renderBackgroundImage=function(f){return a(this,void 0,void 0,function(){var h,e,d,t,r,B;return H(this,function(A){switch(A.label){case 0:h=f.styles.backgroundImage.length-1,e=function(e){var t,r,B,n,s,o,i,Q,c,a,g,w,U,l,C,u,F;return H(this,function(A){switch(A.label){case 0:if(0!==e.type)return[3,5];t=void 0,r=e.url,A.label=1;case 1:return A.trys.push([1,3,,4]),[4,d.context.cache.match(r)];case 2:return t=A.sent(),[3,4];case 3:return A.sent(),d.context.logger.error(\"Error loading background-image \"+r),[3,4];case 4:return t&&(B=Cs(f,h,[t.width,t.height,t.width/t.height]),o=B[0],g=B[1],w=B[2],c=B[3],a=B[4],s=d.ctx.createPattern(d.resizeImage(t,c,a),\"repeat\"),d.renderRepeat(o,s,g,w)),[3,6];case 5:1===e.type?(F=Cs(f,h,[null,null,null]),o=F[0],g=F[1],w=F[2],c=F[3],a=F[4],C=Ee(e.angle,c,a),l=C[0],B=C[1],i=C[2],u=C[3],Q=C[4],(F=document.createElement(\"canvas\")).width=c,F.height=a,C=F.getContext(\"2d\"),n=C.createLinearGradient(B,u,i,Q),pe(e.stops,l).forEach(function(A){return n.addColorStop(A.stop,ie(A.color))}),C.fillStyle=n,C.fillRect(0,0,c,a),0<c&&0<a&&(s=d.ctx.createPattern(F,\"repeat\"),d.renderRepeat(o,s,g,w))):2===e.type&&(u=Cs(f,h,[null,null,null]),o=u[0],i=u[1],Q=u[2],c=u[3],a=u[4],l=0===e.position.length?[ge]:e.position,g=Ue(l[0],c),w=Ue(l[l.length-1],a),C=function(A,e,t,r,B){var n,s,o,i,Q=0,c=0;switch(A.size){case 0:0===A.shape?Q=c=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(Q=Math.min(Math.abs(e),Math.abs(e-r)),c=Math.min(Math.abs(t),Math.abs(t-B)));break;case 2:0===A.shape?Q=c=Math.min(Ie(e,t),Ie(e,t-B),Ie(e-r,t),Ie(e-r,t-B)):1===A.shape&&(n=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(e),Math.abs(e-r)),o=(s=ye(r,B,e,t,!0))[0],i=s[1],c=n*(Q=Ie(o-e,(i-t)/n)));break;case 1:0===A.shape?Q=c=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(Q=Math.max(Math.abs(e),Math.abs(e-r)),c=Math.max(Math.abs(t),Math.abs(t-B)));break;case 3:0===A.shape?Q=c=Math.max(Ie(e,t),Ie(e,t-B),Ie(e-r,t),Ie(e-r,t-B)):1===A.shape&&(n=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(e),Math.abs(e-r)),o=(s=ye(r,B,e,t,!1))[0],i=s[1],c=n*(Q=Ie(o-e,(i-t)/n)))}return Array.isArray(A.size)&&(Q=Ue(A.size[0],r),c=2===A.size.length?Ue(A.size[1],B):Q),[Q,c]}(e,g,w,c,a),F=C[0],u=C[1],0<F&&0<u&&(U=d.ctx.createRadialGradient(i+g,Q+w,0,i+g,Q+w,F),pe(e.stops,2*F).forEach(function(A){return U.addColorStop(A.stop,ie(A.color))}),d.path(o),d.ctx.fillStyle=U,F!==u?(l=f.bounds.left+.5*f.bounds.width,C=f.bounds.top+.5*f.bounds.height,F=1/(u=u/F),d.ctx.save(),d.ctx.translate(l,C),d.ctx.transform(1,0,0,u,0,0),d.ctx.translate(-l,-C),d.ctx.fillRect(i,F*(Q-C)+C,c,a*F),d.ctx.restore()):d.ctx.fill())),A.label=6;case 6:return h--,[2]}})},d=this,t=0,r=f.styles.backgroundImage.slice(0).reverse(),A.label=1;case 1:return t<r.length?(B=r[t],[5,e(B)]):[3,4];case 2:A.sent(),A.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},Ds.prototype.renderSolidBorder=function(e,t,r){return a(this,void 0,void 0,function(){return H(this,function(A){return this.path(ws(r,t)),this.ctx.fillStyle=ie(e),this.ctx.fill(),[2]})})},Ds.prototype.renderDoubleBorder=function(t,r,B,n){return a(this,void 0,void 0,function(){var e;return H(this,function(A){switch(A.label){case 0:return r<3?[4,this.renderSolidBorder(t,B,n)]:[3,2];case 1:return A.sent(),[2];case 2:return e=function(A,e){switch(e){case 0:return Hs(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Hs(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Hs(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Hs(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,B),this.path(e),this.ctx.fillStyle=ie(t),this.ctx.fill(),e=function(A,e){switch(e){case 0:return Hs(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Hs(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Hs(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Hs(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,B),this.path(e),this.ctx.fill(),[2]}})})},Ds.prototype.renderNodeBackgroundAndBorders=function(c){return a(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,Q=this;return H(this,function(A){switch(A.label){case 0:return(this.applyEffects(c.getEffects(2)),e=c.container.styles,t=!oe(e.backgroundColor)||e.backgroundImage.length,r=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],B=Ms(Es(e.backgroundClip,0),c.curves),t||e.boxShadow.length)?(this.ctx.save(),this.path(B),this.ctx.clip(),oe(e.backgroundColor)||(this.ctx.fillStyle=ie(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(c.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(A){Q.ctx.save();var t,r,B,n,e=ts(c.curves),s=A.inset?0:1e4,o=(t=-s+(A.inset?1:-1)*A.spread.number,r=(A.inset?1:-1)*A.spread.number,B=A.spread.number*(A.inset?-2:2),n=A.spread.number*(A.inset?-2:2),e.map(function(A,e){switch(e){case 0:return A.add(t,r);case 1:return A.add(t+B,r);case 2:return A.add(t+B,r+n);case 3:return A.add(t,r+n)}return A}));A.inset?(Q.path(e),Q.ctx.clip(),Q.mask(o)):(Q.mask(e),Q.ctx.clip(),Q.path(o)),Q.ctx.shadowOffsetX=A.offsetX.number+s,Q.ctx.shadowOffsetY=A.offsetY.number,Q.ctx.shadowColor=ie(A.color),Q.ctx.shadowBlur=A.blur.number,Q.ctx.fillStyle=A.inset?ie(A.color):\"rgba(0,0,0,1)\",Q.ctx.fill(),Q.ctx.restore()}),A.label=2;case 2:s=n=0,o=r,A.label=3;case 3:return s<o.length?0!==(i=o[s]).style&&!oe(i.color)&&0<i.width?2!==i.style?[3,5]:[4,this.renderDashedDottedBorder(i.color,i.width,n,c.curves,2)]:[3,11]:[3,13];case 4:return A.sent(),[3,11];case 5:return 3!==i.style?[3,7]:[4,this.renderDashedDottedBorder(i.color,i.width,n,c.curves,3)];case 6:return A.sent(),[3,11];case 7:return 4!==i.style?[3,9]:[4,this.renderDoubleBorder(i.color,i.width,n,c.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(i.color,n,c.curves)];case 10:A.sent(),A.label=11;case 11:n++,A.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},Ds.prototype.renderDashedDottedBorder=function(g,w,U,l,C){return a(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,Q,c,a;return H(this,function(A){return this.ctx.save(),Q=function(A,e){switch(e){case 0:return fs(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return fs(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return fs(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return fs(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(l,U),e=ws(l,U),2===C&&(this.path(e),this.ctx.clip()),s=$n(e[0])?(t=e[0].start.x,e[0].start.y):(t=e[0].x,e[0].y),o=$n(e[1])?(r=e[1].end.x,e[1].end.y):(r=e[1].x,e[1].y),B=0===U||2===U?Math.abs(t-r):Math.abs(s-o),this.ctx.beginPath(),3===C?this.formatPath(Q):this.formatPath(e.slice(0,2)),n=w<3?3*w:2*w,s=w<3?2*w:w,3===C&&(s=n=w),o=!0,B<=2*n?o=!1:B<=2*n+s?(n*=i=B/(2*n+s),s*=i):(Q=Math.floor((B+s)/(n+s)),i=(B-Q*n)/(Q-1),s=(Q=(B-(Q+1)*n)/Q)<=0||Math.abs(s-i)<Math.abs(s-Q)?i:Q),o&&(3===C?this.ctx.setLineDash([0,n+s]):this.ctx.setLineDash([n,s])),3===C?(this.ctx.lineCap=\"round\",this.ctx.lineWidth=w):this.ctx.lineWidth=2*w+1.1,this.ctx.strokeStyle=ie(g),this.ctx.stroke(),this.ctx.setLineDash([]),2===C&&($n(e[0])&&(c=e[3],a=e[0],this.ctx.beginPath(),this.formatPath([new Zn(c.end.x,c.end.y),new Zn(a.start.x,a.start.y)]),this.ctx.stroke()),$n(e[1])&&(c=e[1],a=e[2],this.ctx.beginPath(),this.formatPath([new Zn(c.end.x,c.end.y),new Zn(a.start.x,a.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},Ds.prototype.render=function(B){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ie(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=new as(e=B,null),r=new cs(t),hs(t,r,r,e=[]),ds(t.container,e),[4,this.renderStack(r)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}var e,t,r})})},Ds);function Ds(A,e){A=Ls.call(this,A,e)||this;return A._activeEffects=[],A.canvas=e.canvas||document.createElement(\"canvas\"),A.ctx=A.canvas.getContext(\"2d\"),e.canvas||(A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+\"px\",A.canvas.style.height=e.height+\"px\"),A.fontMetrics=new Ks(document),A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.ctx.textBaseline=\"bottom\",A._activeEffects=[],A.context.logger.debug(\"Canvas renderer initialized (\"+e.width+\"x\"+e.height+\") with scale \"+e.scale),A}var vs,xs=function(A){return A instanceof LB||(A instanceof yB||A instanceof pB&&A.type!==dB&&A.type!==hB)},Ms=function(A,e){switch(A){case 0:return ts(e);case 2:return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox];default:return rs(e)}},Ss=function(A){switch(A){case 1:return\"center\";case 2:return\"right\";default:return\"left\"}},Ts=[\"-apple-system\",\"system-ui\"],Gs=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===Ts.indexOf(A)}):A},Os=(A(Vs,vs=he),Vs.prototype.render=function(t){return a(this,void 0,void 0,function(){var e;return H(this,function(A){switch(A.label){case 0:return e=Nr(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,ks(e)];case 1:return e=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ie(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},Vs);function Vs(A,e){A=vs.call(this,A,e)||this;return A.canvas=e.canvas||document.createElement(\"canvas\"),A.ctx=A.canvas.getContext(\"2d\"),A.options=e,A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+\"px\",A.canvas.style.height=e.height+\"px\",A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.context.logger.debug(\"EXPERIMENTAL ForeignObject renderer initialized (\"+e.width+\"x\"+e.height+\" at \"+e.x+\",\"+e.y+\") with scale \"+e.scale),A}var ks=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src=\"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent((new XMLSerializer).serializeToString(r))})},Rs=(Ns.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(\"undefined\"!=typeof window&&window.console&&\"function\"==typeof console.debug?console.debug.apply(console,t([this.id,this.getTime()+\"ms\"],A)):this.info.apply(this,A))},Ns.prototype.getTime=function(){return Date.now()-this.start},Ns.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&\"undefined\"!=typeof window&&window.console&&\"function\"==typeof console.info&&console.info.apply(console,t([this.id,this.getTime()+\"ms\"],A))},Ns.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(\"undefined\"!=typeof window&&window.console&&\"function\"==typeof console.warn?console.warn.apply(console,t([this.id,this.getTime()+\"ms\"],A)):this.info.apply(this,A))},Ns.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(\"undefined\"!=typeof window&&window.console&&\"function\"==typeof console.error?console.error.apply(console,t([this.id,this.getTime()+\"ms\"],A)):this.info.apply(this,A))},Ns.instances={},Ns);function Ns(A){var e=A.id,A=A.enabled;this.id=e,this.enabled=A,this.start=Date.now()}var Ps=(Xs.instanceCount=1,Xs);function Xs(A,e){this.windowBounds=e,this.instanceName=\"#\"+Xs.instanceCount++,this.logger=new Rs({id:this.instanceName,enabled:A.logging}),this.cache=null!==(e=A.cache)&&void 0!==e?e:new On(this,A)}\"undefined\"!=typeof window&&Tn.setContext(window);var Js=function(u,F){return a(void 0,void 0,void 0,function(){var e,t,r,B,n,s,o,i,Q,c,a,g,w,U,l,C;return H(this,function(A){switch(A.label){case 0:if(!u||\"object\"!=typeof u)return[2,Promise.reject(\"Invalid element provided as first argument\")];if(!(e=u.ownerDocument))throw new Error(\"Element is not attached to a Document\");if(!(t=e.defaultView))throw new Error(\"Document is not attached to a Window\");return w={allowTaint:null!==(U=F.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(c=F.imageTimeout)&&void 0!==c?c:15e3,proxy:F.proxy,useCORS:null!==(a=F.useCORS)&&void 0!==a&&a},U=h({logging:null===(g=F.logging)||void 0===g||g,cache:F.cache},w),c={windowWidth:null!==(c=F.windowWidth)&&void 0!==c?c:t.innerWidth,windowHeight:null!==(a=F.windowHeight)&&void 0!==a?a:t.innerHeight,scrollX:null!==(g=F.scrollX)&&void 0!==g?g:t.pageXOffset,scrollY:null!==(w=F.scrollY)&&void 0!==w?w:t.pageYOffset},a=new d(c.scrollX,c.scrollY,c.windowWidth,c.windowHeight),g=new Ps(U,a),c=null!==(w=F.foreignObjectRendering)&&void 0!==w&&w,w={allowTaint:null!==(U=F.allowTaint)&&void 0!==U&&U,onclone:F.onclone,ignoreElements:F.ignoreElements,inlineImages:c,copyStyles:c},g.logger.debug(\"Starting document clone with size \"+a.width+\"x\"+a.height+\" scrolled to \"+-a.left+\",\"+-a.top),U=new dn(g,u,w),(w=U.clonedReferenceElement)?[4,U.toIFrame(e,a)]:[2,Promise.reject(\"Unable to find element in cloned iframe\")];case 1:return(r=A.sent(),l=jB(w)||\"HTML\"===w.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error(\"Unable to get document size\");A=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),t=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new d(0,0,A,t)}(w.ownerDocument):f(g,w),B=l.width,n=l.height,s=l.left,o=l.top,i=Ys(g,w,F.backgroundColor),l={canvas:F.canvas,backgroundColor:i,scale:null!==(l=null!==(l=F.scale)&&void 0!==l?l:t.devicePixelRatio)&&void 0!==l?l:1,x:(null!==(l=F.x)&&void 0!==l?l:0)+s,y:(null!==(l=F.y)&&void 0!==l?l:0)+o,width:null!==(l=F.width)&&void 0!==l?l:Math.ceil(B),height:null!==(l=F.height)&&void 0!==l?l:Math.ceil(n)},c)?(g.logger.debug(\"Document cloned, using foreign object rendering\"),[4,new Os(g,l).render(w)]):[3,3];case 2:return Q=A.sent(),[3,5];case 3:return g.logger.debug(\"Document cloned, element located at \"+s+\",\"+o+\" with size \"+B+\"x\"+n+\" using computed rendering\"),g.logger.debug(\"Starting DOM parsing\"),C=kB(g,w),i===C.styles.backgroundColor&&(C.styles.backgroundColor=Le.TRANSPARENT),g.logger.debug(\"Starting renderer for element at \"+l.x+\",\"+l.y+\" with size \"+l.width+\"x\"+l.height),[4,new bs(g,l).render(C)];case 4:Q=A.sent(),A.label=5;case 5:return null!==(C=F.removeContainer)&&void 0!==C&&!C||dn.destroy(r)||g.logger.error(\"Cannot detach cloned iframe as it is not in the DOM anymore\"),g.logger.debug(\"Finished rendering\"),[2,Q]}})})},Ys=function(A,e,t){var r=e.ownerDocument,B=r.documentElement?fe(A,getComputedStyle(r.documentElement).backgroundColor):Le.TRANSPARENT,n=r.body?fe(A,getComputedStyle(r.body).backgroundColor):Le.TRANSPARENT,t=\"string\"==typeof t?fe(A,t):null===t?Le.TRANSPARENT:4294967295;return e===r.documentElement?oe(B)?oe(n)?t:n:B:t};return function(A,e){return Js(A,e=void 0===e?{}:e)}});\n"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/jspdf.js",
    "content": "/** @license\n *\n * jsPDF - PDF Document creation from JavaScript\n * Version 2.5.1 Built on 2022-01-28T15:37:57.789Z\n *                      CommitID 00000000\n *\n * Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF\n *               2015-2021 yWorks GmbH, http://www.yworks.com\n *               2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX\n *               2016-2018 Aras Abbasi <aras.abbasi@gmail.com>\n *               2010 Aaron Spike, https://github.com/acspike\n *               2012 Willow Systems Corporation, https://github.com/willowsystems\n *               2012 Pablo Hess, https://github.com/pablohess\n *               2012 Florian Jenett, https://github.com/fjenett\n *               2013 Warren Weckesser, https://github.com/warrenweckesser\n *               2013 Youssef Beddad, https://github.com/lifof\n *               2013 Lee Driscoll, https://github.com/lsdriscoll\n *               2013 Stefan Slonevskiy, https://github.com/stefslon\n *               2013 Jeremy Morel, https://github.com/jmorel\n *               2013 Christoph Hartmann, https://github.com/chris-rock\n *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n *               2014 James Makes, https://github.com/dollaruw\n *               2014 Diego Casorran, https://github.com/diegocr\n *               2014 Steven Spungin, https://github.com/Flamenco\n *               2014 Kenneth Glassey, https://github.com/Gavvers\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * Contributor(s):\n *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,\n *    kim3er, mfo, alnorth, Flamenco\n */\n\n !function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],e):e((t=t||self).jspdf={})}(this,(function(t){\"use strict\";function e(t){return(e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}var r=function(){return\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this}();function n(){r.console&&\"function\"==typeof r.console.log&&r.console.log.apply(r.console,arguments)}var i={log:n,warn:function(t){r.console&&(\"function\"==typeof r.console.warn?r.console.warn.apply(r.console,arguments):n.call(null,arguments))},error:function(t){r.console&&(\"function\"==typeof r.console.error?r.console.error.apply(r.console,arguments):n(t))}};function a(t,e,r){var n=new XMLHttpRequest;n.open(\"GET\",t),n.responseType=\"blob\",n.onload=function(){l(n.response,e,r)},n.onerror=function(){i.error(\"could not download file\")},n.send()}function o(t){var e=new XMLHttpRequest;e.open(\"HEAD\",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function s(t){try{t.dispatchEvent(new MouseEvent(\"click\"))}catch(r){var e=document.createEvent(\"MouseEvents\");e.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var c,u,l=r.saveAs||(\"object\"!==(\"undefined\"==typeof window?\"undefined\":e(window))||window!==r?function(){}:\"undefined\"!=typeof HTMLAnchorElement&&\"download\"in HTMLAnchorElement.prototype?function(t,e,n){var i=r.URL||r.webkitURL,c=document.createElement(\"a\");e=e||t.name||\"download\",c.download=e,c.rel=\"noopener\",\"string\"==typeof t?(c.href=t,c.origin!==location.origin?o(c.href)?a(t,e,n):s(c,c.target=\"_blank\"):s(c)):(c.href=i.createObjectURL(t),setTimeout((function(){i.revokeObjectURL(c.href)}),4e4),setTimeout((function(){s(c)}),0))}:\"msSaveOrOpenBlob\"in navigator?function(t,r,n){if(r=r||t.name||\"download\",\"string\"==typeof t)if(o(t))a(t,r,n);else{var c=document.createElement(\"a\");c.href=t,c.target=\"_blank\",setTimeout((function(){s(c)}))}else navigator.msSaveOrOpenBlob(function(t,r){return void 0===r?r={autoBom:!1}:\"object\"!==e(r)&&(i.warn(\"Deprecated: Expected third argument to be a object\"),r={autoBom:!r}),r.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),r)}:function(t,n,i,o){if((o=o||open(\"\",\"_blank\"))&&(o.document.title=o.document.body.innerText=\"downloading...\"),\"string\"==typeof t)return a(t,n,i);var s=\"application/octet-stream\"===t.type,c=/constructor/i.test(r.HTMLElement)||r.safari,u=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((u||s&&c)&&\"object\"===(\"undefined\"==typeof FileReader?\"undefined\":e(FileReader))){var l=new FileReader;l.onloadend=function(){var t=l.result;t=u?t:t.replace(/^data:[^;]*;/,\"data:attachment/file;\"),o?o.location.href=t:location=t,o=null},l.readAsDataURL(t)}else{var h=r.URL||r.webkitURL,f=h.createObjectURL(t);o?o.location=f:location.href=f,o=null,setTimeout((function(){h.revokeObjectURL(f)}),4e4)}});\n /**\n    * A class to parse color values\n    * @author Stoyan Stefanov <sstoo@gmail.com>\n    * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}\n    * @license Use it if you like it\n    */function h(t){var e;t=t||\"\",this.ok=!1,\"#\"==t.charAt(0)&&(t=t.substr(1,6));t={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"}[t=(t=t.replace(/ /g,\"\")).toLowerCase()]||t;for(var r=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,example:[\"#00ff00\",\"336699\"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=0;n<r.length;n++){var i=r[n].re,a=r[n].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t=\"0\"+t),1==e.length&&(e=\"0\"+e),1==r.length&&(r=\"0\"+r),\"#\"+t+e+r}}\n /**\n    * @license\n    * Joseph Myers does not specify a particular license for his work.\n    *\n    * Author: Joseph Myers\n    * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js\n    *\n    * Modified by: Owen Leong\n    */\n function f(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];r=p(r,n,i,a,e[0],7,-680876936),a=p(a,r,n,i,e[1],12,-389564586),i=p(i,a,r,n,e[2],17,606105819),n=p(n,i,a,r,e[3],22,-1044525330),r=p(r,n,i,a,e[4],7,-176418897),a=p(a,r,n,i,e[5],12,1200080426),i=p(i,a,r,n,e[6],17,-1473231341),n=p(n,i,a,r,e[7],22,-45705983),r=p(r,n,i,a,e[8],7,1770035416),a=p(a,r,n,i,e[9],12,-1958414417),i=p(i,a,r,n,e[10],17,-42063),n=p(n,i,a,r,e[11],22,-1990404162),r=p(r,n,i,a,e[12],7,1804603682),a=p(a,r,n,i,e[13],12,-40341101),i=p(i,a,r,n,e[14],17,-1502002290),r=g(r,n=p(n,i,a,r,e[15],22,1236535329),i,a,e[1],5,-165796510),a=g(a,r,n,i,e[6],9,-1069501632),i=g(i,a,r,n,e[11],14,643717713),n=g(n,i,a,r,e[0],20,-373897302),r=g(r,n,i,a,e[5],5,-701558691),a=g(a,r,n,i,e[10],9,38016083),i=g(i,a,r,n,e[15],14,-660478335),n=g(n,i,a,r,e[4],20,-405537848),r=g(r,n,i,a,e[9],5,568446438),a=g(a,r,n,i,e[14],9,-1019803690),i=g(i,a,r,n,e[3],14,-187363961),n=g(n,i,a,r,e[8],20,1163531501),r=g(r,n,i,a,e[13],5,-1444681467),a=g(a,r,n,i,e[2],9,-51403784),i=g(i,a,r,n,e[7],14,1735328473),r=m(r,n=g(n,i,a,r,e[12],20,-1926607734),i,a,e[5],4,-378558),a=m(a,r,n,i,e[8],11,-2022574463),i=m(i,a,r,n,e[11],16,1839030562),n=m(n,i,a,r,e[14],23,-35309556),r=m(r,n,i,a,e[1],4,-1530992060),a=m(a,r,n,i,e[4],11,1272893353),i=m(i,a,r,n,e[7],16,-155497632),n=m(n,i,a,r,e[10],23,-1094730640),r=m(r,n,i,a,e[13],4,681279174),a=m(a,r,n,i,e[0],11,-358537222),i=m(i,a,r,n,e[3],16,-722521979),n=m(n,i,a,r,e[6],23,76029189),r=m(r,n,i,a,e[9],4,-640364487),a=m(a,r,n,i,e[12],11,-421815835),i=m(i,a,r,n,e[15],16,530742520),r=v(r,n=m(n,i,a,r,e[2],23,-995338651),i,a,e[0],6,-198630844),a=v(a,r,n,i,e[7],10,1126891415),i=v(i,a,r,n,e[14],15,-1416354905),n=v(n,i,a,r,e[5],21,-57434055),r=v(r,n,i,a,e[12],6,1700485571),a=v(a,r,n,i,e[3],10,-1894986606),i=v(i,a,r,n,e[10],15,-1051523),n=v(n,i,a,r,e[1],21,-2054922799),r=v(r,n,i,a,e[8],6,1873313359),a=v(a,r,n,i,e[15],10,-30611744),i=v(i,a,r,n,e[6],15,-1560198380),n=v(n,i,a,r,e[13],21,1309151649),r=v(r,n,i,a,e[4],6,-145523070),a=v(a,r,n,i,e[11],10,-1120210379),i=v(i,a,r,n,e[2],15,718787259),n=v(n,i,a,r,e[9],21,-343485551),t[0]=S(r,t[0]),t[1]=S(n,t[1]),t[2]=S(i,t[2]),t[3]=S(a,t[3])}function d(t,e,r,n,i,a){return e=S(S(e,t),S(n,a)),S(e<<i|e>>>32-i,r)}function p(t,e,r,n,i,a,o){return d(e&r|~e&n,t,e,i,a,o)}function g(t,e,r,n,i,a,o){return d(e&n|r&~n,t,e,i,a,o)}function m(t,e,r,n,i,a,o){return d(e^r^n,t,e,i,a,o)}function v(t,e,r,n,i,a,o){return d(r^(e|~n),t,e,i,a,o)}function b(t){var e,r=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)f(n,y(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(f(n,i),e=0;e<16;e++)i[e]=0;return i[14]=8*r,f(n,i),n}function y(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}c=r.atob.bind(r),u=r.btoa.bind(r);var w=\"0123456789abcdef\".split(\"\");function N(t){for(var e=\"\",r=0;r<4;r++)e+=w[t>>8*r+4&15]+w[t>>8*r&15];return e}function L(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function A(t){return function(t){return t.map(L).join(\"\")}(b(t))}var x=\"5d41402abc4b2a76b9719d911017c592\"!=function(t){for(var e=0;e<t.length;e++)t[e]=N(t[e]);return t.join(\"\")}(b(\"hello\"));function S(t,e){if(x){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}return t+e&4294967295}\n /**\n    * @license\n    * FPDF is released under a permissive license: there is no usage restriction.\n    * You may embed it freely in your application (commercial or not), with or\n    * without modifications.\n    *\n    * Reference: http://www.fpdf.org/en/script/script37.php\n    */function _(t,e){var r,n,i,a;if(t!==r){for(var o=(i=t,a=1+(256/t.length>>0),new Array(a+1).join(i)),s=[],c=0;c<256;c++)s[c]=c;var u=0;for(c=0;c<256;c++){var l=s[c];u=(u+l+o.charCodeAt(c))%256,s[c]=s[u],s[u]=l}r=t,n=s}else s=n;var h=e.length,f=0,d=0,p=\"\";for(c=0;c<h;c++)d=(d+(l=s[f=(f+1)%256]))%256,s[f]=s[d],s[d]=l,o=s[(s[f]+s[d])%256],p+=String.fromCharCode(e.charCodeAt(c)^o);return p}\n /**\n    * @license\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    * Author: Owen Leong (@owenl131)\n    * Date: 15 Oct 2020\n    * References:\n    * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt\n    * https://github.com/foliojs/pdfkit/blob/master/lib/security.js\n    * http://www.fpdf.org/en/script/script37.php\n    */var P={print:4,modify:8,copy:16,\"annot-forms\":32};function k(t,e,r,n){this.v=1,this.r=2;var i=192;t.forEach((function(t){if(void 0!==P.perm)throw new Error(\"Invalid permission: \"+t);i+=P[t]})),this.padding=\"(¿N^NuAd\\0NVÿú\u0001\\b..\\0¶Ðh>/\\f©þdSiz\";var a=(e+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=A(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=_(this.encryptionKey,this.padding)}function F(t){if(/[^\\u0000-\\u00ff]/.test(t))throw new Error(\"Invalid PDF Name Object: \"+t+\", Only accept ASCII characters.\");for(var e=\"\",r=t.length,n=0;n<r;n++){var i=t.charCodeAt(n);if(i<33||35===i||37===i||40===i||41===i||47===i||60===i||62===i||91===i||93===i||123===i||125===i||i>126)e+=\"#\"+(\"0\"+i.toString(16)).slice(-2);else e+=t[n]}return e}function I(t){if(\"object\"!==e(t))throw new Error(\"Invalid Context passed to initialize PubSub (jsPDF-module)\");var n={};this.subscribe=function(t,e,r){if(r=r||!1,\"string\"!=typeof t||\"function\"!=typeof e||\"boolean\"!=typeof r)throw new Error(\"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\");n.hasOwnProperty(t)||(n[t]={});var i=Math.random().toString(35);return n[t][i]=[e,!!r],i},this.unsubscribe=function(t){for(var e in n)if(n[e][t])return delete n[e][t],0===Object.keys(n[e]).length&&delete n[e],!0;return!1},this.publish=function(e){if(n.hasOwnProperty(e)){var a=Array.prototype.slice.call(arguments,1),o=[];for(var s in n[e]){var c=n[e][s];try{c[0].apply(t,a)}catch(t){r.console&&i.error(\"jsPDF PubSub Error\",t.message,t)}c[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return n}}function C(t){if(!(this instanceof C))return new C(t);var e=\"opacity,stroke-opacity\".split(\",\");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id=\"\",this.objectNumber=-1}function j(t,e){this.gState=t,this.matrix=e,this.id=\"\",this.objectNumber=-1}function O(t,e,r,n,i){if(!(this instanceof O))return new O(t,e,r,n,i);this.type=\"axial\"===t?2:3,this.coords=e,this.colors=r,j.call(this,n,i)}function B(t,e,r,n,i){if(!(this instanceof B))return new B(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream=\"\",this.cloneIndex=0,j.call(this,n,i)}function M(t){var n,a=\"string\"==typeof arguments[0]?arguments[0]:\"p\",o=arguments[1],s=arguments[2],c=arguments[3],f=[],d=1,p=16,g=\"S\",m=null;\"object\"===e(t=t||{})&&(a=t.orientation,o=t.unit||o,s=t.format||s,c=t.compress||t.compressPdf||c,null!==(m=t.encryption||null)&&(m.userPassword=m.userPassword||\"\",m.ownerPassword=m.ownerPassword||\"\",m.userPermissions=m.userPermissions||[]),d=\"number\"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(n=t.precision),void 0!==t.floatPrecision&&(p=t.floatPrecision),g=t.defaultPathOperation||\"S\"),f=t.filters||(!0===c?[\"FlateEncode\"]:f),o=o||\"mm\",a=(\"\"+(a||\"P\")).toLowerCase();var v=t.putOnlyUsedFonts||!1,b={},y={internal:{},__private__:{}};y.__private__.PubSub=I;var w=\"1.3\",N=y.__private__.getPdfVersion=function(){return w};y.__private__.setPdfVersion=function(t){w=t};var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],\"government-letter\":[576,756],legal:[612,1008],\"junior-legal\":[576,360],ledger:[1224,792],tabloid:[792,1224],\"credit-card\":[153,243]};y.__private__.getPageFormats=function(){return L};var A=y.__private__.getPageFormat=function(t){return L[t]};s=s||\"a4\";var x={COMPAT:\"compat\",ADVANCED:\"advanced\"},S=x.COMPAT;function _(){this.saveGraphicsState(),ht(new Vt(_t,0,0,-_t,0,Rr()*_t).toString()+\" cm\"),this.setFontSize(this.getFontSize()/_t),g=\"n\",S=x.ADVANCED}function P(){this.restoreGraphicsState(),g=\"S\",S=x.COMPAT}var j=y.__private__.combineFontStyleAndFontWeight=function(t,e){if(\"bold\"==t&&\"normal\"==e||\"bold\"==t&&400==e||\"normal\"==t&&\"italic\"==e||\"bold\"==t&&\"italic\"==e)throw new Error(\"Invalid Combination of fontweight and fontstyle\");return e&&(t=400==e||\"normal\"===e?\"italic\"===t?\"italic\":\"normal\":700!=e&&\"bold\"!==e||\"normal\"!==t?(700==e?\"bold\":e)+\"\"+t:\"bold\"),t};y.advancedAPI=function(t){var e=S===x.COMPAT;return e&&_.call(this),\"function\"!=typeof t||(t(this),e&&P.call(this)),this},y.compatAPI=function(t){var e=S===x.ADVANCED;return e&&P.call(this),\"function\"!=typeof t||(t(this),e&&_.call(this)),this},y.isAdvancedAPI=function(){return S===x.ADVANCED};var E,q=function(t){if(S!==x.ADVANCED)throw new Error(t+\" is only available in 'advanced' API mode. You need to call advancedAPI() first.\")},D=y.roundToPrecision=y.__private__.roundToPrecision=function(t,e){var r=n||e;if(isNaN(t)||isNaN(r))throw new Error(\"Invalid argument passed to jsPDF.roundToPrecision\");return t.toFixed(r).replace(/0+$/,\"\")};E=y.hpf=y.__private__.hpf=\"number\"==typeof p?function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,p)}:\"smart\"===p?function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,16)};var R=y.f2=y.__private__.f2=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.f2\");return D(t,2)},T=y.__private__.f3=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.f3\");return D(t,3)},U=y.scale=y.__private__.scale=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.scale\");return S===x.COMPAT?t*_t:S===x.ADVANCED?t:void 0},z=function(t){return S===x.COMPAT?Rr()-t:S===x.ADVANCED?t:void 0},H=function(t){return U(z(t))};y.__private__.setPrecision=y.setPrecision=function(t){\"number\"==typeof parseInt(t,10)&&(n=parseInt(t,10))};var W,V=\"00000000000000000000000000000000\",G=y.__private__.getFileId=function(){return V},Y=y.__private__.setFileId=function(t){return V=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():V.split(\"\").map((function(){return\"ABCDEF0123456789\".charAt(Math.floor(16*Math.random()))})).join(\"\"),null!==m&&(Ye=new k(m.userPermissions,m.userPassword,m.ownerPassword,V)),V};y.setFileId=function(t){return Y(t),this},y.getFileId=function(){return G()};var J=y.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),r=e<0?\"+\":\"-\",n=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[r,Q(n),\"'\",Q(i),\"'\"].join(\"\");return[\"D:\",t.getFullYear(),Q(t.getMonth()+1),Q(t.getDate()),Q(t.getHours()),Q(t.getMinutes()),Q(t.getSeconds()),a].join(\"\")},X=y.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),r=parseInt(t.substr(6,2),10)-1,n=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(e,r,n,i,a,o,0)},K=y.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=J(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\\+0[0-9]|\\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error(\"Invalid argument passed to jsPDF.setCreationDate\");e=t}return W=e},Z=y.__private__.getCreationDate=function(t){var e=W;return\"jsDate\"===t&&(e=X(W)),e};y.setCreationDate=function(t){return K(t),this},y.getCreationDate=function(t){return Z(t)};var $,Q=y.__private__.padd2=function(t){return(\"0\"+parseInt(t)).slice(-2)},tt=y.__private__.padd2Hex=function(t){return(\"00\"+(t=t.toString())).substr(t.length)},et=0,rt=[],nt=[],it=0,at=[],ot=[],st=!1,ct=nt,ut=function(){et=0,it=0,nt=[],rt=[],at=[],Qt=Kt(),te=Kt()};y.__private__.setCustomOutputDestination=function(t){st=!0,ct=t};var lt=function(t){st||(ct=t)};y.__private__.resetCustomOutputDestination=function(){st=!1,ct=nt};var ht=y.__private__.out=function(t){return t=t.toString(),it+=t.length+1,ct.push(t),ct},ft=y.__private__.write=function(t){return ht(1===arguments.length?t.toString():Array.prototype.join.call(arguments,\" \"))},dt=y.__private__.getArrayBuffer=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},pt=[[\"Helvetica\",\"helvetica\",\"normal\",\"WinAnsiEncoding\"],[\"Helvetica-Bold\",\"helvetica\",\"bold\",\"WinAnsiEncoding\"],[\"Helvetica-Oblique\",\"helvetica\",\"italic\",\"WinAnsiEncoding\"],[\"Helvetica-BoldOblique\",\"helvetica\",\"bolditalic\",\"WinAnsiEncoding\"],[\"Courier\",\"courier\",\"normal\",\"WinAnsiEncoding\"],[\"Courier-Bold\",\"courier\",\"bold\",\"WinAnsiEncoding\"],[\"Courier-Oblique\",\"courier\",\"italic\",\"WinAnsiEncoding\"],[\"Courier-BoldOblique\",\"courier\",\"bolditalic\",\"WinAnsiEncoding\"],[\"Times-Roman\",\"times\",\"normal\",\"WinAnsiEncoding\"],[\"Times-Bold\",\"times\",\"bold\",\"WinAnsiEncoding\"],[\"Times-Italic\",\"times\",\"italic\",\"WinAnsiEncoding\"],[\"Times-BoldItalic\",\"times\",\"bolditalic\",\"WinAnsiEncoding\"],[\"ZapfDingbats\",\"zapfdingbats\",\"normal\",null],[\"Symbol\",\"symbol\",\"normal\",null]];y.__private__.getStandardFonts=function(){return pt};var gt=t.fontSize||16;y.__private__.setFontSize=y.setFontSize=function(t){return gt=S===x.ADVANCED?t/_t:t,this};var mt,vt=y.__private__.getFontSize=y.getFontSize=function(){return S===x.COMPAT?gt:gt*_t},bt=t.R2L||!1;y.__private__.setR2L=y.setR2L=function(t){return bt=t,this},y.__private__.getR2L=y.getR2L=function(){return bt};var yt,wt=y.__private__.setZoomMode=function(t){var e=[void 0,null,\"fullwidth\",\"fullheight\",\"fullpage\",\"original\"];if(/^(?:\\d+\\.\\d*|\\d*\\.\\d+|\\d+)%$/.test(t))mt=t;else if(isNaN(t)){if(-1===e.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. \"'+t+'\" is not recognized.');mt=t}else mt=parseInt(t,10)};y.__private__.getZoomMode=function(){return mt};var Nt,Lt=y.__private__.setPageMode=function(t){if(-1==[void 0,null,\"UseNone\",\"UseOutlines\",\"UseThumbs\",\"FullScreen\"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. \"'+t+'\" is not recognized.');yt=t};y.__private__.getPageMode=function(){return yt};var At=y.__private__.setLayoutMode=function(t){if(-1==[void 0,null,\"continuous\",\"single\",\"twoleft\",\"tworight\",\"two\"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. \"'+t+'\" is not recognized.');Nt=t};y.__private__.getLayoutMode=function(){return Nt},y.__private__.setDisplayMode=y.setDisplayMode=function(t,e,r){return wt(t),At(e),Lt(r),this};var xt={title:\"\",subject:\"\",author:\"\",keywords:\"\",creator:\"\"};y.__private__.getDocumentProperty=function(t){if(-1===Object.keys(xt).indexOf(t))throw new Error(\"Invalid argument passed to jsPDF.getDocumentProperty\");return xt[t]},y.__private__.getDocumentProperties=function(){return xt},y.__private__.setDocumentProperties=y.setProperties=y.setDocumentProperties=function(t){for(var e in xt)xt.hasOwnProperty(e)&&t[e]&&(xt[e]=t[e]);return this},y.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(xt).indexOf(t))throw new Error(\"Invalid arguments passed to jsPDF.setDocumentProperty\");return xt[t]=e};var St,_t,Pt,kt,Ft,It={},Ct={},jt=[],Ot={},Bt={},Mt={},Et={},qt=null,Dt=0,Rt=[],Tt=new I(y),Ut=t.hotfixes||[],zt={},Ht={},Wt=[],Vt=function t(e,r,n,i,a,o){if(!(this instanceof t))return new t(e,r,n,i,a,o);isNaN(e)&&(e=1),isNaN(r)&&(r=0),isNaN(n)&&(n=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(o)&&(o=0),this._matrix=[e,r,n,i,a,o]};Object.defineProperty(Vt.prototype,\"sx\",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Vt.prototype,\"shy\",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Vt.prototype,\"shx\",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Vt.prototype,\"sy\",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Vt.prototype,\"tx\",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Vt.prototype,\"ty\",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Vt.prototype,\"a\",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Vt.prototype,\"b\",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Vt.prototype,\"c\",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Vt.prototype,\"d\",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Vt.prototype,\"e\",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Vt.prototype,\"f\",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Vt.prototype,\"rotation\",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Vt.prototype,\"scaleX\",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Vt.prototype,\"scaleY\",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Vt.prototype,\"isIdentity\",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Vt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(E).join(t)},Vt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,r=t.sx*this.shy+t.shy*this.sy,n=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,a=t.tx*this.sx+t.ty*this.shx+this.tx,o=t.tx*this.shy+t.ty*this.sy+this.ty;return new Vt(e,r,n,i,a,o)},Vt.prototype.decompose=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*r+(e/=o)*n;r-=t*s,n-=e*s;var c=Math.sqrt(r*r+n*n);return s/=c,t*(n/=c)<e*(r/=c)&&(t=-t,e=-e,s=-s,o=-o),{scale:new Vt(o,0,0,c,0,0),translate:new Vt(1,0,0,1,i,a),rotate:new Vt(t,e,-e,t,0,0),skew:new Vt(1,0,s,1,0,0)}},Vt.prototype.toString=function(t){return this.join(\" \")},Vt.prototype.inversed=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=1/(t*n-e*r),s=n*o,c=-e*o,u=-r*o,l=t*o;return new Vt(s,c,u,l,-s*i-u*a,-c*i-l*a)},Vt.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,r=t.x*this.shy+t.y*this.sy+this.ty;return new Cr(e,r)},Vt.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),r=this.applyToPoint(new Cr(t.x+t.w,t.y+t.h));return new jr(e.x,e.y,r.x-e.x,r.y-e.y)},Vt.prototype.clone=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty;return new Vt(t,e,r,n,i,a)},y.Matrix=Vt;var Gt=y.matrixMult=function(t,e){return e.multiply(t)},Yt=new Vt(1,0,0,1,0,0);y.unitMatrix=y.identityMatrix=Yt;var Jt=function(t,e){if(!Bt[t]){var r=(e instanceof O?\"Sh\":\"P\")+(Object.keys(Ot).length+1).toString(10);e.id=r,Bt[t]=r,Ot[r]=e,Tt.publish(\"addPattern\",e)}};y.ShadingPattern=O,y.TilingPattern=B,y.addShadingPattern=function(t,e){return q(\"addShadingPattern()\"),Jt(t,e),this},y.beginTilingPattern=function(t){q(\"beginTilingPattern()\"),Br(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},y.endTilingPattern=function(t,e){q(\"endTilingPattern()\"),e.stream=ot[$].join(\"\\n\"),Jt(t,e),Tt.publish(\"endTilingPattern\",e),Wt.pop().restore()};var Xt=y.__private__.newObject=function(){var t=Kt();return Zt(t,!0),t},Kt=y.__private__.newObjectDeferred=function(){return et++,rt[et]=function(){return it},et},Zt=function(t,e){return e=\"boolean\"==typeof e&&e,rt[t]=it,e&&ht(t+\" 0 obj\"),t},$t=y.__private__.newAdditionalObject=function(){var t={objId:Kt(),content:\"\"};return at.push(t),t},Qt=Kt(),te=Kt(),ee=y.__private__.decodeColorString=function(t){var e=t.split(\" \");if(2!==e.length||\"g\"!==e[1]&&\"G\"!==e[1]){if(5===e.length&&(\"k\"===e[4]||\"K\"===e[4])){e=[(1-e[0])*(1-e[3]),(1-e[1])*(1-e[3]),(1-e[2])*(1-e[3]),\"r\"]}}else{var r=parseFloat(e[0]);e=[r,r,r,\"r\"]}for(var n=\"#\",i=0;i<3;i++)n+=(\"0\"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return n},re=y.__private__.encodeColorString=function(t){var r;\"string\"==typeof t&&(t={ch1:t});var n=t.ch1,i=t.ch2,a=t.ch3,o=t.ch4,s=\"draw\"===t.pdfColorType?[\"G\",\"RG\",\"K\"]:[\"g\",\"rg\",\"k\"];if(\"string\"==typeof n&&\"#\"!==n.charAt(0)){var c=new h(n);if(c.ok)n=c.toHex();else if(!/^\\d*\\.?\\d*$/.test(n))throw new Error('Invalid color \"'+n+'\" passed to jsPDF.encodeColorString.')}if(\"string\"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n=\"#\"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),\"string\"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var u=parseInt(n.substr(1),16);n=u>>16&255,i=u>>8&255,a=255&u}if(void 0===i||void 0===o&&n===i&&i===a)if(\"string\"==typeof n)r=n+\" \"+s[0];else switch(t.precision){case 2:r=R(n/255)+\" \"+s[0];break;case 3:default:r=T(n/255)+\" \"+s[0]}else if(void 0===o||\"object\"===e(o)){if(o&&!isNaN(o.a)&&0===o.a)return r=[\"1.\",\"1.\",\"1.\",s[1]].join(\" \");if(\"string\"==typeof n)r=[n,i,a,s[1]].join(\" \");else switch(t.precision){case 2:r=[R(n/255),R(i/255),R(a/255),s[1]].join(\" \");break;default:case 3:r=[T(n/255),T(i/255),T(a/255),s[1]].join(\" \")}}else if(\"string\"==typeof n)r=[n,i,a,o,s[2]].join(\" \");else switch(t.precision){case 2:r=[R(n),R(i),R(a),R(o),s[2]].join(\" \");break;case 3:default:r=[T(n),T(i),T(a),T(o),s[2]].join(\" \")}return r},ne=y.__private__.getFilters=function(){return f},ie=y.__private__.putStream=function(t){var e=(t=t||{}).data||\"\",r=t.filters||ne(),n=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o=t.objectId,s=function(t){return t};if(null!==m&&void 0===o)throw new Error(\"ObjectId must be passed to putStream for file encryption\");null!==m&&(s=Ye.encryptor(o,0));var c={};!0===r&&(r=[\"FlateEncode\"]);var u=t.additionalKeyValues||[],l=(c=void 0!==M.API.processDataByFilters?M.API.processDataByFilters(e,r):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(n)?n.join(\" \"):n.toString());if(0!==c.data.length&&(u.push({key:\"Length\",value:c.data.length}),!0===i&&u.push({key:\"Length1\",value:a})),0!=l.length)if(l.split(\"/\").length-1==1)u.push({key:\"Filter\",value:l});else{u.push({key:\"Filter\",value:\"[\"+l+\"]\"});for(var h=0;h<u.length;h+=1)if(\"DecodeParms\"===u[h].key){for(var f=[],d=0;d<c.reverseChain.split(\"/\").length-1;d+=1)f.push(\"null\");f.push(u[h].value),u[h].value=\"[\"+f.join(\" \")+\"]\"}}ht(\"<<\");for(var p=0;p<u.length;p++)ht(\"/\"+u[p].key+\" \"+u[p].value);ht(\">>\"),0!==c.data.length&&(ht(\"stream\"),ht(s(c.data)),ht(\"endstream\"))},ae=y.__private__.putPage=function(t){var e=t.number,r=t.data,n=t.objId,i=t.contentsObjId;Zt(n,!0),ht(\"<</Type /Page\"),ht(\"/Parent \"+t.rootDictionaryObjId+\" 0 R\"),ht(\"/Resources \"+t.resourceDictionaryObjId+\" 0 R\"),ht(\"/MediaBox [\"+parseFloat(E(t.mediaBox.bottomLeftX))+\" \"+parseFloat(E(t.mediaBox.bottomLeftY))+\" \"+E(t.mediaBox.topRightX)+\" \"+E(t.mediaBox.topRightY)+\"]\"),null!==t.cropBox&&ht(\"/CropBox [\"+E(t.cropBox.bottomLeftX)+\" \"+E(t.cropBox.bottomLeftY)+\" \"+E(t.cropBox.topRightX)+\" \"+E(t.cropBox.topRightY)+\"]\"),null!==t.bleedBox&&ht(\"/BleedBox [\"+E(t.bleedBox.bottomLeftX)+\" \"+E(t.bleedBox.bottomLeftY)+\" \"+E(t.bleedBox.topRightX)+\" \"+E(t.bleedBox.topRightY)+\"]\"),null!==t.trimBox&&ht(\"/TrimBox [\"+E(t.trimBox.bottomLeftX)+\" \"+E(t.trimBox.bottomLeftY)+\" \"+E(t.trimBox.topRightX)+\" \"+E(t.trimBox.topRightY)+\"]\"),null!==t.artBox&&ht(\"/ArtBox [\"+E(t.artBox.bottomLeftX)+\" \"+E(t.artBox.bottomLeftY)+\" \"+E(t.artBox.topRightX)+\" \"+E(t.artBox.topRightY)+\"]\"),\"number\"==typeof t.userUnit&&1!==t.userUnit&&ht(\"/UserUnit \"+t.userUnit),Tt.publish(\"putPage\",{objId:n,pageContext:Rt[e],pageNumber:e,page:r}),ht(\"/Contents \"+i+\" 0 R\"),ht(\">>\"),ht(\"endobj\");var a=r.join(\"\\n\");return S===x.ADVANCED&&(a+=\"\\nQ\"),Zt(i,!0),ie({data:a,filters:ne(),objectId:i}),ht(\"endobj\"),n},oe=y.__private__.putPages=function(){var t,e,r=[];for(t=1;t<=Dt;t++)Rt[t].objId=Kt(),Rt[t].contentsObjId=Kt();for(t=1;t<=Dt;t++)r.push(ae({number:t,data:ot[t],objId:Rt[t].objId,contentsObjId:Rt[t].contentsObjId,mediaBox:Rt[t].mediaBox,cropBox:Rt[t].cropBox,bleedBox:Rt[t].bleedBox,trimBox:Rt[t].trimBox,artBox:Rt[t].artBox,userUnit:Rt[t].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:te}));Zt(Qt,!0),ht(\"<</Type /Pages\");var n=\"/Kids [\";for(e=0;e<Dt;e++)n+=r[e]+\" 0 R \";ht(n+\"]\"),ht(\"/Count \"+Dt),ht(\">>\"),ht(\"endobj\"),Tt.publish(\"postPutPages\")},se=function(t){Tt.publish(\"putFont\",{font:t,out:ht,newObject:Xt,putStream:ie}),!0!==t.isAlreadyPutted&&(t.objectNumber=Xt(),ht(\"<<\"),ht(\"/Type /Font\"),ht(\"/BaseFont /\"+F(t.postScriptName)),ht(\"/Subtype /Type1\"),\"string\"==typeof t.encoding&&ht(\"/Encoding /\"+t.encoding),ht(\"/FirstChar 32\"),ht(\"/LastChar 255\"),ht(\">>\"),ht(\"endobj\"))},ce=function(){for(var t in It)It.hasOwnProperty(t)&&(!1===v||!0===v&&b.hasOwnProperty(t))&&se(It[t])},ue=function(t){t.objectNumber=Xt();var e=[];e.push({key:\"Type\",value:\"/XObject\"}),e.push({key:\"Subtype\",value:\"/Form\"}),e.push({key:\"BBox\",value:\"[\"+[E(t.x),E(t.y),E(t.x+t.width),E(t.y+t.height)].join(\" \")+\"]\"}),e.push({key:\"Matrix\",value:\"[\"+t.matrix.toString()+\"]\"});var r=t.pages[1].join(\"\\n\");ie({data:r,additionalKeyValues:e,objectId:t.objectNumber}),ht(\"endobj\")},le=function(){for(var t in zt)zt.hasOwnProperty(t)&&ue(zt[t])},he=function(t,e){var r,n=[],i=1/(e-1);for(r=0;r<1;r+=i)n.push(r);if(n.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var o={offset:1,color:t[t.length-1].color};t.push(o)}for(var s=\"\",c=0,u=0;u<n.length;u++){for(r=n[u];r>t[c+1].offset;)c++;var l=t[c].offset,h=(r-l)/(t[c+1].offset-l),f=t[c].color,d=t[c+1].color;s+=tt(Math.round((1-h)*f[0]+h*d[0]).toString(16))+tt(Math.round((1-h)*f[1]+h*d[1]).toString(16))+tt(Math.round((1-h)*f[2]+h*d[2]).toString(16))}return s.trim()},fe=function(t,e){e||(e=21);var r=Xt(),n=he(t.colors,e),i=[];i.push({key:\"FunctionType\",value:\"0\"}),i.push({key:\"Domain\",value:\"[0.0 1.0]\"}),i.push({key:\"Size\",value:\"[\"+e+\"]\"}),i.push({key:\"BitsPerSample\",value:\"8\"}),i.push({key:\"Range\",value:\"[0.0 1.0 0.0 1.0 0.0 1.0]\"}),i.push({key:\"Decode\",value:\"[0.0 1.0 0.0 1.0 0.0 1.0]\"}),ie({data:n,additionalKeyValues:i,alreadyAppliedFilters:[\"/ASCIIHexDecode\"],objectId:r}),ht(\"endobj\"),t.objectNumber=Xt(),ht(\"<< /ShadingType \"+t.type),ht(\"/ColorSpace /DeviceRGB\");var a=\"/Coords [\"+E(parseFloat(t.coords[0]))+\" \"+E(parseFloat(t.coords[1]))+\" \";2===t.type?a+=E(parseFloat(t.coords[2]))+\" \"+E(parseFloat(t.coords[3])):a+=E(parseFloat(t.coords[2]))+\" \"+E(parseFloat(t.coords[3]))+\" \"+E(parseFloat(t.coords[4]))+\" \"+E(parseFloat(t.coords[5])),ht(a+=\"]\"),t.matrix&&ht(\"/Matrix [\"+t.matrix.toString()+\"]\"),ht(\"/Function \"+r+\" 0 R\"),ht(\"/Extend [true true]\"),ht(\">>\"),ht(\"endobj\")},de=function(t,e){var r=Kt(),n=Xt();e.push({resourcesOid:r,objectOid:n}),t.objectNumber=n;var i=[];i.push({key:\"Type\",value:\"/Pattern\"}),i.push({key:\"PatternType\",value:\"1\"}),i.push({key:\"PaintType\",value:\"1\"}),i.push({key:\"TilingType\",value:\"1\"}),i.push({key:\"BBox\",value:\"[\"+t.boundingBox.map(E).join(\" \")+\"]\"}),i.push({key:\"XStep\",value:E(t.xStep)}),i.push({key:\"YStep\",value:E(t.yStep)}),i.push({key:\"Resources\",value:r+\" 0 R\"}),t.matrix&&i.push({key:\"Matrix\",value:\"[\"+t.matrix.toString()+\"]\"}),ie({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),ht(\"endobj\")},pe=function(t){var e;for(e in Ot)Ot.hasOwnProperty(e)&&(Ot[e]instanceof O?fe(Ot[e]):Ot[e]instanceof B&&de(Ot[e],t))},ge=function(t){for(var e in t.objectNumber=Xt(),ht(\"<<\"),t)switch(e){case\"opacity\":ht(\"/ca \"+R(t[e]));break;case\"stroke-opacity\":ht(\"/CA \"+R(t[e]))}ht(\">>\"),ht(\"endobj\")},me=function(){var t;for(t in Mt)Mt.hasOwnProperty(t)&&ge(Mt[t])},ve=function(){for(var t in ht(\"/XObject <<\"),zt)zt.hasOwnProperty(t)&&zt[t].objectNumber>=0&&ht(\"/\"+t+\" \"+zt[t].objectNumber+\" 0 R\");Tt.publish(\"putXobjectDict\"),ht(\">>\")},be=function(){Ye.oid=Xt(),ht(\"<<\"),ht(\"/Filter /Standard\"),ht(\"/V \"+Ye.v),ht(\"/R \"+Ye.r),ht(\"/U <\"+Ye.toHexString(Ye.U)+\">\"),ht(\"/O <\"+Ye.toHexString(Ye.O)+\">\"),ht(\"/P \"+Ye.P),ht(\">>\"),ht(\"endobj\")},ye=function(){for(var t in ht(\"/Font <<\"),It)It.hasOwnProperty(t)&&(!1===v||!0===v&&b.hasOwnProperty(t))&&ht(\"/\"+t+\" \"+It[t].objectNumber+\" 0 R\");ht(\">>\")},we=function(){if(Object.keys(Ot).length>0){for(var t in ht(\"/Shading <<\"),Ot)Ot.hasOwnProperty(t)&&Ot[t]instanceof O&&Ot[t].objectNumber>=0&&ht(\"/\"+t+\" \"+Ot[t].objectNumber+\" 0 R\");Tt.publish(\"putShadingPatternDict\"),ht(\">>\")}},Ne=function(t){if(Object.keys(Ot).length>0){for(var e in ht(\"/Pattern <<\"),Ot)Ot.hasOwnProperty(e)&&Ot[e]instanceof y.TilingPattern&&Ot[e].objectNumber>=0&&Ot[e].objectNumber<t&&ht(\"/\"+e+\" \"+Ot[e].objectNumber+\" 0 R\");Tt.publish(\"putTilingPatternDict\"),ht(\">>\")}},Le=function(){if(Object.keys(Mt).length>0){var t;for(t in ht(\"/ExtGState <<\"),Mt)Mt.hasOwnProperty(t)&&Mt[t].objectNumber>=0&&ht(\"/\"+t+\" \"+Mt[t].objectNumber+\" 0 R\");Tt.publish(\"putGStateDict\"),ht(\">>\")}},Ae=function(t){Zt(t.resourcesOid,!0),ht(\"<<\"),ht(\"/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\"),ye(),we(),Ne(t.objectOid),Le(),ve(),ht(\">>\"),ht(\"endobj\")},xe=function(){var t=[];ce(),me(),le(),pe(t),Tt.publish(\"putResources\"),t.forEach(Ae),Ae({resourcesOid:te,objectOid:Number.MAX_SAFE_INTEGER}),Tt.publish(\"postPutResources\")},Se=function(){Tt.publish(\"putAdditionalObjects\");for(var t=0;t<at.length;t++){var e=at[t];Zt(e.objId,!0),ht(e.content),ht(\"endobj\")}Tt.publish(\"postPutAdditionalObjects\")},_e=function(t){Ct[t.fontName]=Ct[t.fontName]||{},Ct[t.fontName][t.fontStyle]=t.id},Pe=function(t,e,r,n,i){var a={id:\"F\"+(Object.keys(It).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:r,encoding:n,isStandardFont:i||!1,metadata:{}};return Tt.publish(\"addFont\",{font:a,instance:this}),It[a.id]=a,_e(a),a.id},ke=function(t){for(var e=0,r=pt.length;e<r;e++){var n=Pe.call(this,t[e][0],t[e][1],t[e][2],pt[e][3],!0);!1===v&&(b[n]=!0);var i=t[e][0].split(\"-\");_e({id:n,fontName:i[0],fontStyle:i[1]||\"\"})}Tt.publish(\"addFonts\",{fonts:It,dictionary:Ct})},Fe=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var e=t.stack||\"\";~e.indexOf(\" at \")&&(e=e.split(\" at \")[1]);var n=\"Error in function \"+e.split(\"\\n\")[0].split(\"<\")[0]+\": \"+t.message;if(!r.console)throw new Error(n);r.console.error(n,t),r.alert&&alert(n)}},t.foo.bar=t,t.foo},Ie=function(t,e){var r,n,i,a,o,s,c,u,l;if(i=(e=e||{}).sourceEncoding||\"Unicode\",o=e.outputEncoding,(e.autoencode||o)&&It[St].metadata&&It[St].metadata[i]&&It[St].metadata[i].encoding&&(a=It[St].metadata[i].encoding,!o&&It[St].encoding&&(o=It[St].encoding),!o&&a.codePages&&(o=a.codePages[0]),\"string\"==typeof o&&(o=a[o]),o)){for(c=!1,s=[],r=0,n=t.length;r<n;r++)(u=o[t.charCodeAt(r)])?s.push(String.fromCharCode(u)):s.push(t[r]),s[r].charCodeAt(0)>>8&&(c=!0);t=s.join(\"\")}for(r=t.length;void 0===c&&0!==r;)t.charCodeAt(r-1)>>8&&(c=!0),r--;if(!c)return t;for(s=e.noBOM?[]:[254,255],r=0,n=t.length;r<n;r++){if((l=(u=t.charCodeAt(r))>>8)>>8)throw new Error(\"Character at position \"+r+\" of string '\"+t+\"' exceeds 16bits. Cannot be encoded into UCS-2 BE\");s.push(l),s.push(u-(l<<8))}return String.fromCharCode.apply(void 0,s)},Ce=y.__private__.pdfEscape=y.pdfEscape=function(t,e){return Ie(t,e).replace(/\\\\/g,\"\\\\\\\\\").replace(/\\(/g,\"\\\\(\").replace(/\\)/g,\"\\\\)\")},je=y.__private__.beginPage=function(t){ot[++Dt]=[],Rt[Dt]={objId:0,contentsObjId:0,userUnit:Number(d),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},Me(Dt),lt(ot[$])},Oe=function(t,e){var r,n,o;switch(a=e||a,\"string\"==typeof t&&(r=A(t.toLowerCase()),Array.isArray(r)&&(n=r[0],o=r[1])),Array.isArray(t)&&(n=t[0]*_t,o=t[1]*_t),isNaN(n)&&(n=s[0],o=s[1]),(n>14400||o>14400)&&(i.warn(\"A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400\"),n=Math.min(14400,n),o=Math.min(14400,o)),s=[n,o],a.substr(0,1)){case\"l\":o>n&&(s=[o,n]);break;case\"p\":n>o&&(s=[o,n])}je(s),pr(fr),ht(Lr),0!==kr&&ht(kr+\" J\"),0!==Fr&&ht(Fr+\" j\"),Tt.publish(\"addPage\",{pageNumber:Dt})},Be=function(t){t>0&&t<=Dt&&(ot.splice(t,1),Rt.splice(t,1),Dt--,$>Dt&&($=Dt),this.setPage($))},Me=function(t){t>0&&t<=Dt&&($=t)},Ee=y.__private__.getNumberOfPages=y.getNumberOfPages=function(){return ot.length-1},qe=function(t,e,r){var n,a=void 0;return r=r||{},t=void 0!==t?t:It[St].fontName,e=void 0!==e?e:It[St].fontStyle,n=t.toLowerCase(),void 0!==Ct[n]&&void 0!==Ct[n][e]?a=Ct[n][e]:void 0!==Ct[t]&&void 0!==Ct[t][e]?a=Ct[t][e]:!1===r.disableWarning&&i.warn(\"Unable to look up font label for font '\"+t+\"', '\"+e+\"'. Refer to getFontList() for available fonts.\"),a||r.noFallback||null==(a=Ct.times[e])&&(a=Ct.times.normal),a},De=y.__private__.putInfo=function(){var t=Xt(),e=function(t){return t};for(var r in null!==m&&(e=Ye.encryptor(t,0)),ht(\"<<\"),ht(\"/Producer (\"+Ce(e(\"jsPDF \"+M.version))+\")\"),xt)xt.hasOwnProperty(r)&&xt[r]&&ht(\"/\"+r.substr(0,1).toUpperCase()+r.substr(1)+\" (\"+Ce(e(xt[r]))+\")\");ht(\"/CreationDate (\"+Ce(e(W))+\")\"),ht(\">>\"),ht(\"endobj\")},Re=y.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Qt;switch(Xt(),ht(\"<<\"),ht(\"/Type /Catalog\"),ht(\"/Pages \"+e+\" 0 R\"),mt||(mt=\"fullwidth\"),mt){case\"fullwidth\":ht(\"/OpenAction [3 0 R /FitH null]\");break;case\"fullheight\":ht(\"/OpenAction [3 0 R /FitV null]\");break;case\"fullpage\":ht(\"/OpenAction [3 0 R /Fit]\");break;case\"original\":ht(\"/OpenAction [3 0 R /XYZ null null 1]\");break;default:var r=\"\"+mt;\"%\"===r.substr(r.length-1)&&(mt=parseInt(mt)/100),\"number\"==typeof mt&&ht(\"/OpenAction [3 0 R /XYZ null null \"+R(mt)+\"]\")}switch(Nt||(Nt=\"continuous\"),Nt){case\"continuous\":ht(\"/PageLayout /OneColumn\");break;case\"single\":ht(\"/PageLayout /SinglePage\");break;case\"two\":case\"twoleft\":ht(\"/PageLayout /TwoColumnLeft\");break;case\"tworight\":ht(\"/PageLayout /TwoColumnRight\")}yt&&ht(\"/PageMode /\"+yt),Tt.publish(\"putCatalog\"),ht(\">>\"),ht(\"endobj\")},Te=y.__private__.putTrailer=function(){ht(\"trailer\"),ht(\"<<\"),ht(\"/Size \"+(et+1)),ht(\"/Root \"+et+\" 0 R\"),ht(\"/Info \"+(et-1)+\" 0 R\"),null!==m&&ht(\"/Encrypt \"+Ye.oid+\" 0 R\"),ht(\"/ID [ <\"+V+\"> <\"+V+\"> ]\"),ht(\">>\")},Ue=y.__private__.putHeader=function(){ht(\"%PDF-\"+w),ht(\"%ºß¬à\")},ze=y.__private__.putXRef=function(){var t=\"0000000000\";ht(\"xref\"),ht(\"0 \"+(et+1)),ht(\"0000000000 65535 f \");for(var e=1;e<=et;e++){\"function\"==typeof rt[e]?ht((t+rt[e]()).slice(-10)+\" 00000 n \"):void 0!==rt[e]?ht((t+rt[e]).slice(-10)+\" 00000 n \"):ht(\"0000000000 00000 n \")}},He=y.__private__.buildDocument=function(){ut(),lt(nt),Tt.publish(\"buildDocument\"),Ue(),oe(),Se(),xe(),null!==m&&be(),De(),Re();var t=it;return ze(),Te(),ht(\"startxref\"),ht(\"\"+t),ht(\"%%EOF\"),lt(ot[$]),nt.join(\"\\n\")},We=y.__private__.getBlob=function(t){return new Blob([dt(t)],{type:\"application/pdf\"})},Ve=y.output=y.__private__.output=Fe((function(t,e){switch(\"string\"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||\"generated.pdf\",t){case void 0:return He();case\"save\":y.save(e.filename);break;case\"arraybuffer\":return dt(He());case\"blob\":return We(He());case\"bloburi\":case\"bloburl\":if(void 0!==r.URL&&\"function\"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(We(He()))||void 0;i.warn(\"bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.\");break;case\"datauristring\":case\"dataurlstring\":var n=\"\",a=He();try{n=u(a)}catch(t){n=u(unescape(encodeURIComponent(a)))}return\"data:application/pdf;filename=\"+e.filename+\";base64,\"+n;case\"pdfobjectnewwindow\":if(\"[object Window]\"===Object.prototype.toString.call(r)){var o=\"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js\",s=' integrity=\"sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==\" crossorigin=\"anonymous\"';e.pdfObjectUrl&&(o=e.pdfObjectUrl,s=\"\");var c='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src=\"'+o+'\"'+s+'><\\/script><script >PDFObject.embed(\"'+this.output(\"dataurlstring\")+'\", '+JSON.stringify(e)+\");<\\/script></body></html>\",l=r.open();return null!==l&&l.document.write(c),l}throw new Error(\"The option pdfobjectnewwindow just works in a browser-environment.\");case\"pdfjsnewwindow\":if(\"[object Window]\"===Object.prototype.toString.call(r)){var h='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id=\"pdfViewer\" src=\"'+(e.pdfJsUrl||\"examples/PDF.js/web/viewer.html\")+\"?file=&downloadName=\"+e.filename+'\" width=\"500px\" height=\"400px\" /></body></html>',f=r.open();if(null!==f){f.document.write(h);var d=this;f.document.documentElement.querySelector(\"#pdfViewer\").onload=function(){f.document.title=e.filename,f.document.documentElement.querySelector(\"#pdfViewer\").contentWindow.PDFViewerApplication.open(d.output(\"bloburl\"))}}return f}throw new Error(\"The option pdfjsnewwindow just works in a browser-environment.\");case\"dataurlnewwindow\":if(\"[object Window]\"!==Object.prototype.toString.call(r))throw new Error(\"The option dataurlnewwindow just works in a browser-environment.\");var p='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src=\"'+this.output(\"datauristring\",e)+'\"></iframe></body></html>',g=r.open();if(null!==g&&(g.document.write(p),g.document.title=e.filename),g||\"undefined\"==typeof safari)return g;break;case\"datauri\":case\"dataurl\":return r.document.location.href=this.output(\"datauristring\",e);default:return null}})),Ge=function(t){return!0===Array.isArray(Ut)&&Ut.indexOf(t)>-1};switch(o){case\"pt\":_t=1;break;case\"mm\":_t=72/25.4;break;case\"cm\":_t=72/2.54;break;case\"in\":_t=72;break;case\"px\":_t=1==Ge(\"px_scaling\")?.75:96/72;break;case\"pc\":case\"em\":_t=12;break;case\"ex\":_t=6;break;default:if(\"number\"!=typeof o)throw new Error(\"Invalid unit: \"+o);_t=o}var Ye=null;K(),Y();var Je=function(t){return null!==m?Ye.encryptor(t,0):function(t){return t}},Xe=y.__private__.getPageInfo=y.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error(\"Invalid argument passed to jsPDF.getPageInfo\");return{objId:Rt[t].objId,pageNumber:t,pageContext:Rt[t]}},Ke=y.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error(\"Invalid argument passed to jsPDF.getPageInfoByObjId\");for(var e in Rt)if(Rt[e].objId===t)break;return Xe(e)},Ze=y.__private__.getCurrentPageInfo=y.getCurrentPageInfo=function(){return{objId:Rt[$].objId,pageNumber:$,pageContext:Rt[$]}};y.addPage=function(){return Oe.apply(this,arguments),this},y.setPage=function(){return Me.apply(this,arguments),lt.call(this,ot[$]),this},y.insertPage=function(t){return this.addPage(),this.movePage($,t),this},y.movePage=function(t,e){var r,n;if(t>e){r=ot[t],n=Rt[t];for(var i=t;i>e;i--)ot[i]=ot[i-1],Rt[i]=Rt[i-1];ot[e]=r,Rt[e]=n,this.setPage(e)}else if(t<e){r=ot[t],n=Rt[t];for(var a=t;a<e;a++)ot[a]=ot[a+1],Rt[a]=Rt[a+1];ot[e]=r,Rt[e]=n,this.setPage(e)}return this},y.deletePage=function(){return Be.apply(this,arguments),this},y.__private__.text=y.text=function(t,r,n,i,a){var o,s,c,u,l,h,f,d,p,g=(i=i||{}).scope||this;if(\"number\"==typeof t&&\"number\"==typeof r&&(\"string\"==typeof n||Array.isArray(n))){var m=n;n=r,r=t,t=m}if(arguments[3]instanceof Vt==!1?(c=arguments[4],u=arguments[5],\"object\"===e(f=arguments[3])&&null!==f||(\"string\"==typeof c&&(u=c,c=null),\"string\"==typeof f&&(u=f,f=null),\"number\"==typeof f&&(c=f,f=null),i={flags:f,angle:c,align:u})):(q(\"The transform parameter of text() with a Matrix value\"),p=a),isNaN(r)||isNaN(n)||null==t)throw new Error(\"Invalid arguments passed to jsPDF.text\");if(0===t.length)return g;var v=\"\",y=!1,w=\"number\"==typeof i.lineHeightFactor?i.lineHeightFactor:hr,N=g.internal.scaleFactor;function L(t){return t=t.split(\"\\t\").join(Array(i.TabLen||9).join(\" \")),Ce(t,f)}function A(t){for(var e,r=t.concat(),n=[],i=r.length;i--;)\"string\"==typeof(e=r.shift())?n.push(e):Array.isArray(t)&&(1===e.length||void 0===e[1]&&void 0===e[2])?n.push(e[0]):n.push([e[0],e[1],e[2]]);return n}function _(t,e){var r;if(\"string\"==typeof t)r=e(t)[0];else if(Array.isArray(t)){for(var n,i,a=t.concat(),o=[],s=a.length;s--;)\"string\"==typeof(n=a.shift())?o.push(e(n)[0]):Array.isArray(n)&&\"string\"==typeof n[0]&&(i=e(n[0],n[1],n[2]),o.push([i[0],i[1],i[2]]));r=o}return r}var P=!1,k=!0;if(\"string\"==typeof t)P=!0;else if(Array.isArray(t)){var F=t.concat();s=[];for(var I,C=F.length;C--;)(\"string\"!=typeof(I=F.shift())||Array.isArray(I)&&\"string\"!=typeof I[0])&&(k=!1);P=k}if(!1===P)throw new Error('Type of text must be string or Array. \"'+t+'\" is not recognized.');\"string\"==typeof t&&(t=t.match(/[\\r?\\n]/)?t.split(/\\r\\n|\\r|\\n/g):[t]);var j=gt/g.internal.scaleFactor,O=j*(w-1);switch(i.baseline){case\"bottom\":n-=O;break;case\"top\":n+=j-O;break;case\"hanging\":n+=j-2*O;break;case\"middle\":n+=j/2-O}if((h=i.maxWidth||0)>0&&(\"string\"==typeof t?t=g.splitTextToSize(t,h):\"[object Array]\"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,e){return t.concat(g.splitTextToSize(e,h))}),[]))),o={text:t,x:r,y:n,options:i,mutex:{pdfEscape:Ce,activeFontKey:St,fonts:It,activeFontSize:gt}},Tt.publish(\"preProcessText\",o),t=o.text,c=(i=o.options).angle,p instanceof Vt==!1&&c&&\"number\"==typeof c){c*=Math.PI/180,0===i.rotationDirection&&(c=-c),S===x.ADVANCED&&(c=-c);var B=Math.cos(c),M=Math.sin(c);p=new Vt(B,M,-M,B,0,0)}else c&&c instanceof Vt&&(p=c);S!==x.ADVANCED||p||(p=Yt),void 0!==(l=i.charSpace||_r)&&(v+=E(U(l))+\" Tc\\n\",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=i.horizontalScale)&&(v+=E(100*d)+\" Tz\\n\");i.lang;var D=-1,R=void 0!==i.renderingMode?i.renderingMode:i.stroke,T=g.internal.getCurrentPageInfo().pageContext;switch(R){case 0:case!1:case\"fill\":D=0;break;case 1:case!0:case\"stroke\":D=1;break;case 2:case\"fillThenStroke\":D=2;break;case 3:case\"invisible\":D=3;break;case 4:case\"fillAndAddForClipping\":D=4;break;case 5:case\"strokeAndAddPathForClipping\":D=5;break;case 6:case\"fillThenStrokeAndAddToPathForClipping\":D=6;break;case 7:case\"addToPathForClipping\":D=7}var z=void 0!==T.usedRenderingMode?T.usedRenderingMode:-1;-1!==D?v+=D+\" Tr\\n\":-1!==z&&(v+=\"0 Tr\\n\"),-1!==D&&(T.usedRenderingMode=D),u=i.align||\"left\";var H,W=gt*w,V=g.internal.pageSize.getWidth(),G=It[St];l=i.charSpace||_r,h=i.maxWidth||0,f=Object.assign({autoencode:!0,noBOM:!0},i.flags);var Y=[];if(\"[object Array]\"===Object.prototype.toString.call(t)){var J;s=A(t),\"left\"!==u&&(H=s.map((function(t){return g.getStringUnitWidth(t,{font:G,charSpace:l,fontSize:gt,doKerning:!1})*gt/N})));var X,K=0;if(\"right\"===u){r-=H[0],t=[],C=s.length;for(var Z=0;Z<C;Z++)0===Z?(X=br(r),J=yr(n)):(X=U(K-H[Z]),J=-W),t.push([s[Z],X,J]),K=H[Z]}else if(\"center\"===u){r-=H[0]/2,t=[],C=s.length;for(var $=0;$<C;$++)0===$?(X=br(r),J=yr(n)):(X=U((K-H[$])/2),J=-W),t.push([s[$],X,J]),K=H[$]}else if(\"left\"===u){t=[],C=s.length;for(var Q=0;Q<C;Q++)t.push(s[Q])}else{if(\"justify\"!==u)throw new Error('Unrecognized alignment option, use \"left\", \"center\", \"right\" or \"justify\".');t=[],C=s.length,h=0!==h?h:V;for(var tt=0;tt<C;tt++)J=0===tt?yr(n):-W,X=0===tt?br(r):0,tt<C-1?Y.push(E(U((h-H[tt])/(s[tt].split(\" \").length-1)))):Y.push(0),t.push([s[tt],X,J])}}var et=\"boolean\"==typeof i.R2L?i.R2L:bt;!0===et&&(t=_(t,(function(t,e,r){return[t.split(\"\").reverse().join(\"\"),e,r]}))),o={text:t,x:r,y:n,options:i,mutex:{pdfEscape:Ce,activeFontKey:St,fonts:It,activeFontSize:gt}},Tt.publish(\"postProcessText\",o),t=o.text,y=o.mutex.isHex||!1;var rt=It[St].encoding;\"WinAnsiEncoding\"!==rt&&\"StandardEncoding\"!==rt||(t=_(t,(function(t,e,r){return[L(t),e,r]}))),s=A(t),t=[];for(var nt,it,at,ot=0,st=1,ct=Array.isArray(s[0])?st:ot,ut=\"\",lt=function(t,e,r){var n=\"\";return r instanceof Vt?(r=\"number\"==typeof i.angle?Gt(r,new Vt(1,0,0,1,t,e)):Gt(new Vt(1,0,0,1,t,e),r),S===x.ADVANCED&&(r=Gt(new Vt(1,0,0,-1,0,0),r)),n=r.join(\" \")+\" Tm\\n\"):n=E(t)+\" \"+E(e)+\" Td\\n\",n},ft=0;ft<s.length;ft++){switch(ut=\"\",ct){case st:at=(y?\"<\":\"(\")+s[ft][0]+(y?\">\":\")\"),nt=parseFloat(s[ft][1]),it=parseFloat(s[ft][2]);break;case ot:at=(y?\"<\":\"(\")+s[ft]+(y?\">\":\")\"),nt=br(r),it=yr(n)}void 0!==Y&&void 0!==Y[ft]&&(ut=Y[ft]+\" Tw\\n\"),0===ft?t.push(ut+lt(nt,it,p)+at):ct===ot?t.push(ut+at):ct===st&&t.push(ut+lt(nt,it,p)+at)}t=ct===ot?t.join(\" Tj\\nT* \"):t.join(\" Tj\\n\"),t+=\" Tj\\n\";var dt=\"BT\\n/\";return dt+=St+\" \"+gt+\" Tf\\n\",dt+=E(gt*w)+\" TL\\n\",dt+=xr+\"\\n\",dt+=v,dt+=t,ht(dt+=\"ET\"),b[St]=!0,g};var $e=y.__private__.clip=y.clip=function(t){return ht(\"evenodd\"===t?\"W*\":\"W\"),this};y.clipEvenOdd=function(){return $e(\"evenodd\")},y.__private__.discardPath=y.discardPath=function(){return ht(\"n\"),this};var Qe=y.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,\"S\",\"D\",\"F\",\"DF\",\"FD\",\"f\",\"f*\",\"B\",\"B*\",\"n\"].indexOf(t)&&(e=!0),e};y.__private__.setDefaultPathOperation=y.setDefaultPathOperation=function(t){return Qe(t)&&(g=t),this};var tr=y.__private__.getStyle=y.getStyle=function(t){var e=g;switch(t){case\"D\":case\"S\":e=\"S\";break;case\"F\":e=\"f\";break;case\"FD\":case\"DF\":e=\"B\";break;case\"f\":case\"f*\":case\"B\":case\"B*\":e=t}return e},er=y.close=function(){return ht(\"h\"),this};y.stroke=function(){return ht(\"S\"),this},y.fill=function(t){return rr(\"f\",t),this},y.fillEvenOdd=function(t){return rr(\"f*\",t),this},y.fillStroke=function(t){return rr(\"B\",t),this},y.fillStrokeEvenOdd=function(t){return rr(\"B*\",t),this};var rr=function(t,r){\"object\"===e(r)?ar(r,t):ht(t)},nr=function(t){null===t||S===x.ADVANCED&&void 0===t||(t=tr(t),ht(t))};function ir(t,e,r,n,i){var a=new B(e||this.boundingBox,r||this.xStep,n||this.yStep,this.gState,i||this.matrix);a.stream=this.stream;var o=t+\"$$\"+this.cloneIndex+++\"$$\";return Jt(o,a),a}var ar=function(t,e){var r=Bt[t.key],n=Ot[r];if(n instanceof O)ht(\"q\"),ht(or(e)),n.gState&&y.setGState(n.gState),ht(t.matrix.toString()+\" cm\"),ht(\"/\"+r+\" sh\"),ht(\"Q\");else if(n instanceof B){var i=new Vt(1,0,0,-1,0,Rr());t.matrix&&(i=i.multiply(t.matrix||Yt),r=ir.call(n,t.key,t.boundingBox,t.xStep,t.yStep,i).id),ht(\"q\"),ht(\"/Pattern cs\"),ht(\"/\"+r+\" scn\"),n.gState&&y.setGState(n.gState),ht(e),ht(\"Q\")}},or=function(t){switch(t){case\"f\":case\"F\":return\"W n\";case\"f*\":return\"W* n\";case\"B\":return\"W S\";case\"B*\":return\"W* S\";case\"S\":return\"W S\";case\"n\":return\"W n\"}},sr=y.moveTo=function(t,e){return ht(E(U(t))+\" \"+E(H(e))+\" m\"),this},cr=y.lineTo=function(t,e){return ht(E(U(t))+\" \"+E(H(e))+\" l\"),this},ur=y.curveTo=function(t,e,r,n,i,a){return ht([E(U(t)),E(H(e)),E(U(r)),E(H(n)),E(U(i)),E(H(a)),\"c\"].join(\" \")),this};y.__private__.line=y.line=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!Qe(i))throw new Error(\"Invalid arguments passed to jsPDF.line\");return S===x.COMPAT?this.lines([[r-t,n-e]],t,e,[1,1],i||\"S\"):this.lines([[r-t,n-e]],t,e,[1,1]).stroke()},y.__private__.lines=y.lines=function(t,e,r,n,i,a){var o,s,c,u,l,h,f,d,p,g,m,v;if(\"number\"==typeof t&&(v=r,r=e,e=t,t=v),n=n||[1,1],a=a||!1,isNaN(e)||isNaN(r)||!Array.isArray(t)||!Array.isArray(n)||!Qe(i)||\"boolean\"!=typeof a)throw new Error(\"Invalid arguments passed to jsPDF.lines\");for(sr(e,r),o=n[0],s=n[1],u=t.length,g=e,m=r,c=0;c<u;c++)2===(l=t[c]).length?(g=l[0]*o+g,m=l[1]*s+m,cr(g,m)):(h=l[0]*o+g,f=l[1]*s+m,d=l[2]*o+g,p=l[3]*s+m,g=l[4]*o+g,m=l[5]*s+m,ur(h,f,d,p,g,m));return a&&er(),nr(i),this},y.path=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r.c;switch(r.op){case\"m\":sr(n[0],n[1]);break;case\"l\":cr(n[0],n[1]);break;case\"c\":ur.apply(this,n);break;case\"h\":er()}}return this},y.__private__.rect=y.rect=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!Qe(i))throw new Error(\"Invalid arguments passed to jsPDF.rect\");return S===x.COMPAT&&(n=-n),ht([E(U(t)),E(H(e)),E(U(r)),E(U(n)),\"re\"].join(\" \")),nr(i),this},y.__private__.triangle=y.triangle=function(t,e,r,n,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(i)||isNaN(a)||!Qe(o))throw new Error(\"Invalid arguments passed to jsPDF.triangle\");return this.lines([[r-t,n-e],[i-r,a-n],[t-i,e-a]],t,e,[1,1],o,!0),this},y.__private__.roundedRect=y.roundedRect=function(t,e,r,n,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(i)||isNaN(a)||!Qe(o))throw new Error(\"Invalid arguments passed to jsPDF.roundedRect\");var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*r),a=Math.min(a,.5*n),this.lines([[r-2*i,0],[i*s,0,i,a-a*s,i,a],[0,n-2*a],[0,a*s,-i*s,a,-i,a],[2*i-r,0],[-i*s,0,-i,-a*s,-i,-a],[0,2*a-n],[0,-a*s,i*s,-a,i,-a]],t+i,e,[1,1],o,!0),this},y.__private__.ellipse=y.ellipse=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!Qe(i))throw new Error(\"Invalid arguments passed to jsPDF.ellipse\");var a=4/3*(Math.SQRT2-1)*r,o=4/3*(Math.SQRT2-1)*n;return sr(t+r,e),ur(t+r,e-o,t+a,e-n,t,e-n),ur(t-a,e-n,t-r,e-o,t-r,e),ur(t-r,e+o,t-a,e+n,t,e+n),ur(t+a,e+n,t+r,e+o,t+r,e),nr(i),this},y.__private__.circle=y.circle=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||!Qe(n))throw new Error(\"Invalid arguments passed to jsPDF.circle\");return this.ellipse(t,e,r,r,n)},y.setFont=function(t,e,r){return r&&(e=j(e,r)),St=qe(t,e,{disableWarning:!1}),this};var lr=y.__private__.getFont=y.getFont=function(){return It[qe.apply(y,arguments)]};y.__private__.getFontList=y.getFontList=function(){var t,e,r={};for(t in Ct)if(Ct.hasOwnProperty(t))for(e in r[t]=[],Ct[t])Ct[t].hasOwnProperty(e)&&r[t].push(e);return r},y.addFont=function(t,e,r,n,i){var a=[\"StandardEncoding\",\"MacRomanEncoding\",\"Identity-H\",\"WinAnsiEncoding\"];return arguments[3]&&-1!==a.indexOf(arguments[3])?i=arguments[3]:arguments[3]&&-1==a.indexOf(arguments[3])&&(r=j(r,n)),i=i||\"Identity-H\",Pe.call(this,t,e,r,i)};var hr,fr=t.lineWidth||.200025,dr=y.__private__.getLineWidth=y.getLineWidth=function(){return fr},pr=y.__private__.setLineWidth=y.setLineWidth=function(t){return fr=t,ht(E(U(t))+\" w\"),this};y.__private__.setLineDash=M.API.setLineDash=M.API.setLineDashPattern=function(t,e){if(t=t||[],e=e||0,isNaN(e)||!Array.isArray(t))throw new Error(\"Invalid arguments passed to jsPDF.setLineDash\");return t=t.map((function(t){return E(U(t))})).join(\" \"),e=E(U(e)),ht(\"[\"+t+\"] \"+e+\" d\"),this};var gr=y.__private__.getLineHeight=y.getLineHeight=function(){return gt*hr};y.__private__.getLineHeight=y.getLineHeight=function(){return gt*hr};var mr=y.__private__.setLineHeightFactor=y.setLineHeightFactor=function(t){return\"number\"==typeof(t=t||1.15)&&(hr=t),this},vr=y.__private__.getLineHeightFactor=y.getLineHeightFactor=function(){return hr};mr(t.lineHeight);var br=y.__private__.getHorizontalCoordinate=function(t){return U(t)},yr=y.__private__.getVerticalCoordinate=function(t){return S===x.ADVANCED?t:Rt[$].mediaBox.topRightY-Rt[$].mediaBox.bottomLeftY-U(t)},wr=y.__private__.getHorizontalCoordinateString=y.getHorizontalCoordinateString=function(t){return E(br(t))},Nr=y.__private__.getVerticalCoordinateString=y.getVerticalCoordinateString=function(t){return E(yr(t))},Lr=t.strokeColor||\"0 G\";y.__private__.getStrokeColor=y.getDrawColor=function(){return ee(Lr)},y.__private__.setStrokeColor=y.setDrawColor=function(t,e,r,n){return Lr=re({ch1:t,ch2:e,ch3:r,ch4:n,pdfColorType:\"draw\",precision:2}),ht(Lr),this};var Ar=t.fillColor||\"0 g\";y.__private__.getFillColor=y.getFillColor=function(){return ee(Ar)},y.__private__.setFillColor=y.setFillColor=function(t,e,r,n){return Ar=re({ch1:t,ch2:e,ch3:r,ch4:n,pdfColorType:\"fill\",precision:2}),ht(Ar),this};var xr=t.textColor||\"0 g\",Sr=y.__private__.getTextColor=y.getTextColor=function(){return ee(xr)};y.__private__.setTextColor=y.setTextColor=function(t,e,r,n){return xr=re({ch1:t,ch2:e,ch3:r,ch4:n,pdfColorType:\"text\",precision:3}),this};var _r=t.charSpace,Pr=y.__private__.getCharSpace=y.getCharSpace=function(){return parseFloat(_r||0)};y.__private__.setCharSpace=y.setCharSpace=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.setCharSpace\");return _r=t,this};var kr=0;y.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},y.__private__.setLineCap=y.setLineCap=function(t){var e=y.CapJoinStyles[t];if(void 0===e)throw new Error(\"Line cap style of '\"+t+\"' is not recognized. See or extend .CapJoinStyles property for valid styles\");return kr=e,ht(e+\" J\"),this};var Fr=0;y.__private__.setLineJoin=y.setLineJoin=function(t){var e=y.CapJoinStyles[t];if(void 0===e)throw new Error(\"Line join style of '\"+t+\"' is not recognized. See or extend .CapJoinStyles property for valid styles\");return Fr=e,ht(e+\" j\"),this},y.__private__.setLineMiterLimit=y.__private__.setMiterLimit=y.setLineMiterLimit=y.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.setLineMiterLimit\");return ht(E(U(t))+\" M\"),this},y.GState=C,y.setGState=function(t){(t=\"string\"==typeof t?Mt[Et[t]]:Ir(null,t)).equals(qt)||(ht(\"/\"+t.id+\" gs\"),qt=t)};var Ir=function(t,e){if(!t||!Et[t]){var r=!1;for(var n in Mt)if(Mt.hasOwnProperty(n)&&Mt[n].equals(e)){r=!0;break}if(r)e=Mt[n];else{var i=\"GS\"+(Object.keys(Mt).length+1).toString(10);Mt[i]=e,e.id=i}return t&&(Et[t]=e.id),Tt.publish(\"addGState\",e),e}};y.addGState=function(t,e){return Ir(t,e),this},y.saveGraphicsState=function(){return ht(\"q\"),jt.push({key:St,size:gt,color:xr}),this},y.restoreGraphicsState=function(){ht(\"Q\");var t=jt.pop();return St=t.key,gt=t.size,xr=t.color,qt=null,this},y.setCurrentTransformationMatrix=function(t){return ht(t.toString()+\" cm\"),this},y.comment=function(t){return ht(\"#\"+t),this};var Cr=function(t,e){var r=t||0;Object.defineProperty(this,\"x\",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var n=e||0;Object.defineProperty(this,\"y\",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var i=\"pt\";return Object.defineProperty(this,\"type\",{enumerable:!0,get:function(){return i},set:function(t){i=t.toString()}}),this},jr=function(t,e,r,n){Cr.call(this,t,e),this.type=\"rect\";var i=r||0;Object.defineProperty(this,\"w\",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var a=n||0;return Object.defineProperty(this,\"h\",{enumerable:!0,get:function(){return a},set:function(t){isNaN(t)||(a=parseFloat(t))}}),this},Or=function(){this.page=Dt,this.currentPage=$,this.pages=ot.slice(0),this.pagesContext=Rt.slice(0),this.x=Pt,this.y=kt,this.matrix=Ft,this.width=qr($),this.height=Rr($),this.outputDestination=ct,this.id=\"\",this.objectNumber=-1};Or.prototype.restore=function(){Dt=this.page,$=this.currentPage,Rt=this.pagesContext,ot=this.pages,Pt=this.x,kt=this.y,Ft=this.matrix,Dr($,this.width),Tr($,this.height),ct=this.outputDestination};var Br=function(t,e,r,n,i){Wt.push(new Or),Dt=$=0,ot=[],Pt=t,kt=e,Ft=i,je([r,n])},Mr=function(t){if(Ht[t])Wt.pop().restore();else{var e=new Or,r=\"Xo\"+(Object.keys(zt).length+1).toString(10);e.id=r,Ht[t]=r,zt[r]=e,Tt.publish(\"addFormObject\",e),Wt.pop().restore()}};for(var Er in y.beginFormObject=function(t,e,r,n,i){return Br(t,e,r,n,i),this},y.endFormObject=function(t){return Mr(t),this},y.doFormObject=function(t,e){var r=zt[Ht[t]];return ht(\"q\"),ht(e.toString()+\" cm\"),ht(\"/\"+r.id+\" Do\"),ht(\"Q\"),this},y.getFormObject=function(t){var e=zt[Ht[t]];return{x:e.x,y:e.y,width:e.width,height:e.height,matrix:e.matrix}},y.save=function(t,e){return t=t||\"generated.pdf\",(e=e||{}).returnPromise=e.returnPromise||!1,!1===e.returnPromise?(l(We(He()),t),\"function\"==typeof l.unload&&r.setTimeout&&setTimeout(l.unload,911),this):new Promise((function(e,n){try{var i=l(We(He()),t);\"function\"==typeof l.unload&&r.setTimeout&&setTimeout(l.unload,911),e(i)}catch(t){n(t.message)}}))},M.API)M.API.hasOwnProperty(Er)&&(\"events\"===Er&&M.API.events.length?function(t,e){var r,n,i;for(i=e.length-1;-1!==i;i--)r=e[i][0],n=e[i][1],t.subscribe.apply(t,[r].concat(\"function\"==typeof n?[n]:n))}(Tt,M.API.events):y[Er]=M.API[Er]);var qr=y.getPageWidth=function(t){return(Rt[t=t||$].mediaBox.topRightX-Rt[t].mediaBox.bottomLeftX)/_t},Dr=y.setPageWidth=function(t,e){Rt[t].mediaBox.topRightX=e*_t+Rt[t].mediaBox.bottomLeftX},Rr=y.getPageHeight=function(t){return(Rt[t=t||$].mediaBox.topRightY-Rt[t].mediaBox.bottomLeftY)/_t},Tr=y.setPageHeight=function(t,e){Rt[t].mediaBox.topRightY=e*_t+Rt[t].mediaBox.bottomLeftY};return y.internal={pdfEscape:Ce,getStyle:tr,getFont:lr,getFontSize:vt,getCharSpace:Pr,getTextColor:Sr,getLineHeight:gr,getLineHeightFactor:vr,getLineWidth:dr,write:ft,getHorizontalCoordinate:br,getVerticalCoordinate:yr,getCoordinateString:wr,getVerticalCoordinateString:Nr,collections:{},newObject:Xt,newAdditionalObject:$t,newObjectDeferred:Kt,newObjectDeferredBegin:Zt,getFilters:ne,putStream:ie,events:Tt,scaleFactor:_t,pageSize:{getWidth:function(){return qr($)},setWidth:function(t){Dr($,t)},getHeight:function(){return Rr($)},setHeight:function(t){Tr($,t)}},encryptionOptions:m,encryption:Ye,getEncryptor:Je,output:Ve,getNumberOfPages:Ee,pages:ot,out:ht,f2:R,f3:T,getPageInfo:Xe,getPageInfoByObjId:Ke,getCurrentPageInfo:Ze,getPDFVersion:N,Point:Cr,Rectangle:jr,Matrix:Vt,hasHotfix:Ge},Object.defineProperty(y.internal.pageSize,\"width\",{get:function(){return qr($)},set:function(t){Dr($,t)},enumerable:!0,configurable:!0}),Object.defineProperty(y.internal.pageSize,\"height\",{get:function(){return Rr($)},set:function(t){Tr($,t)},enumerable:!0,configurable:!0}),ke.call(y,pt),St=\"F1\",Oe(s,a),Tt.publish(\"initialized\"),y}k.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},k.prototype.toHexString=function(t){return t.split(\"\").map((function(t){return(\"0\"+(255&t.charCodeAt(0)).toString(16)).slice(-2)})).join(\"\")},k.prototype.hexToBytes=function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(String.fromCharCode(parseInt(t.substr(r,2),16)));return e.join(\"\")},k.prototype.processOwnerPassword=function(t,e){return _(A(e).substr(0,5),t)},k.prototype.encryptor=function(t,e){var r=A(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(t){return _(r,t)}},C.prototype.equals=function(t){var r,n=\"id,objectNumber,equals\";if(!t||e(t)!==e(this))return!1;var i=0;for(r in this)if(!(n.indexOf(r)>=0)){if(this.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;if(this[r]!==t[r])return!1;i++}for(r in t)t.hasOwnProperty(r)&&n.indexOf(r)<0&&i--;return 0===i},M.API={events:[]},M.version=\"2.5.1\";var E=M.API,q=1,D=function(t){return t.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\(/g,\"\\\\(\").replace(/\\)/g,\"\\\\)\")},R=function(t){return t.replace(/\\\\\\\\/g,\"\\\\\").replace(/\\\\\\(/g,\"(\").replace(/\\\\\\)/g,\")\")},T=function(t){return t.toFixed(2)},U=function(t){return t.toFixed(5)};E.__acroform__={};var z=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},H=function(t){return t*q},W=function(t){var e=new ct,r=Lt.internal.getHeight(t)||0,n=Lt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(T(n)),Number(T(r))],e},V=E.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.setBit\");return t|=1<<e},G=E.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.clearBit\");return t&=~(1<<e)},Y=E.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.getBit\");return 0==(t&1<<e)?0:1},J=E.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf\");return Y(t,e-1)},X=E.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf\");return V(t,e-1)},K=E.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf\");return G(t,e-1)},Z=E.__acroform__.calculateCoordinates=function(t,e){var r=e.internal.getHorizontalCoordinate,n=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],s=t[3],c={};return c.lowerLeft_X=r(i)||0,c.lowerLeft_Y=n(a+s)||0,c.upperRight_X=r(i+o)||0,c.upperRight_Y=n(a)||0,[Number(T(c.lowerLeft_X)),Number(T(c.lowerLeft_Y)),Number(T(c.upperRight_X)),Number(T(c.upperRight_Y))]},$=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],r=t._V||t.DV,n=Q(t,r),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push(\"/Tx BMC\"),e.push(\"q\"),e.push(\"BT\"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push(\"/\"+i+\" \"+T(n.fontSize)+\" Tf\"),e.push(\"1 0 0 1 0 0 Tm\"),e.push(n.text),e.push(\"ET\"),e.push(\"Q\"),e.push(\"EMC\");var a=W(t);return a.scope=t.scope,a.stream=e.join(\"\\n\"),a}},Q=function(t,e){var r=0===t.fontSize?t.maxFontSize:t.fontSize,n={text:\"\",fontSize:\"\"},i=(e=\")\"==(e=\"(\"==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(\" \");i=t.multiline?i.map((function(t){return t.split(\"\\n\")})):i.map((function(t){return[t]}));var a=r,o=Lt.internal.getHeight(t)||0;o=o<0?-o:o;var s=Lt.internal.getWidth(t)||0;s=s<0?-s:s;var c=function(e,r,n){if(e+1<i.length){var a=r+\" \"+i[e+1][0];return tt(a,t,n).width<=s-4}return!1};a++;t:for(;a>0;){e=\"\",a--;var u,l,h=tt(\"3\",t,a).height,f=t.multiline?o-a:(o-h)/2,d=f+=2,p=0,g=0,m=0;if(a<=0){e=\"(...) Tj\\n\",e+=\"% Width of Text: \"+tt(e,t,a=12).width+\", FieldWidth:\"+s+\"\\n\";break}for(var v=\"\",b=0,y=0;y<i.length;y++)if(i.hasOwnProperty(y)){var w=!1;if(1!==i[y].length&&m!==i[y].length-1){if((h+2)*(b+2)+2>o)continue t;v+=i[y][m],w=!0,g=y,y--}else{v=\" \"==(v+=i[y][m]+\" \").substr(v.length-1)?v.substr(0,v.length-1):v;var N=parseInt(y),L=c(N,v,a),A=y>=i.length-1;if(L&&!A){v+=\" \",m=0;continue}if(L||A){if(A)g=N;else if(t.multiline&&(h+2)*(b+2)+2>o)continue t}else{if(!t.multiline)continue t;if((h+2)*(b+2)+2>o)continue t;g=N}}for(var x=\"\",S=p;S<=g;S++){var _=i[S];if(t.multiline){if(S===g){x+=_[m]+\" \",m=(m+1)%_.length;continue}if(S===p){x+=_[_.length-1]+\" \";continue}}x+=_[0]+\" \"}switch(x=\" \"==x.substr(x.length-1)?x.substr(0,x.length-1):x,l=tt(x,t,a).width,t.textAlign){case\"right\":u=s-l-2;break;case\"center\":u=(s-l)/2;break;case\"left\":default:u=2}e+=T(u)+\" \"+T(d)+\" Td\\n\",e+=\"(\"+D(x)+\") Tj\\n\",e+=-T(u)+\" 0 Td\\n\",d=-(a+2),l=0,p=w?g:g+1,b++,v=\"\"}else;break}return n.text=e,n.fontSize=a,n},tt=function(t,e,r){var n=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:e.scope.getStringUnitWidth(\"3\",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},et={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},rt=function(t,e){var r={type:\"reference\",object:t};void 0===e.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===r.type&&t.object===r.object}))&&e.internal.getPageInfo(t.page).pageContext.annotations.push(r)},nt=function(t,r){for(var n in t)if(t.hasOwnProperty(n)){var i=n,a=t[n];r.internal.newObjectDeferredBegin(a.objId,!0),\"object\"===e(a)&&\"function\"==typeof a.putStream&&a.putStream(),delete t[i]}},it=function(t,r){if(r.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(lt.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(et)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"Exception while creating AcroformDictionary\");q=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new ut,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe(\"postPutResources\",(function(){!function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0}(t)})),t.internal.events.subscribe(\"buildDocument\",(function(){!function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var e=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];n.objId=void 0,n.hasAnnotation&&rt(n,t)}}(t)})),t.internal.events.subscribe(\"putCatalog\",(function(){!function(t){if(void 0===t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"putCatalogCallback: Root missing.\");t.internal.write(\"/AcroForm \"+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+\" 0 R\")}(t)})),t.internal.events.subscribe(\"postPutPages\",(function(r){!function(t,r){var n=!t;for(var i in t||(r.internal.newObjectDeferredBegin(r.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),r.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||r.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(i)){var a=t[i],o=[],s=a.Rect;if(a.Rect&&(a.Rect=Z(a.Rect,r)),r.internal.newObjectDeferredBegin(a.objId,!0),a.DA=Lt.createDefaultAppearanceStream(a),\"object\"===e(a)&&\"function\"==typeof a.getKeyValueListForStream&&(o=a.getKeyValueListForStream()),a.Rect=s,a.hasAppearanceStream&&!a.appearanceStreamContent){var c=$(a);o.push({key:\"AP\",value:\"<</N \"+c+\">>\"}),r.internal.acroformPlugin.xForms.push(c)}if(a.appearanceStreamContent){var u=\"\";for(var l in a.appearanceStreamContent)if(a.appearanceStreamContent.hasOwnProperty(l)){var h=a.appearanceStreamContent[l];if(u+=\"/\"+l+\" \",u+=\"<<\",Object.keys(h).length>=1||Array.isArray(h)){for(var i in h)if(h.hasOwnProperty(i)){var f=h[i];\"function\"==typeof f&&(f=f.call(r,a)),u+=\"/\"+i+\" \"+f+\" \",r.internal.acroformPlugin.xForms.indexOf(f)>=0||r.internal.acroformPlugin.xForms.push(f)}}else\"function\"==typeof(f=h)&&(f=f.call(r,a)),u+=\"/\"+i+\" \"+f,r.internal.acroformPlugin.xForms.indexOf(f)>=0||r.internal.acroformPlugin.xForms.push(f);u+=\">>\"}o.push({key:\"AP\",value:\"<<\\n\"+u+\">>\"})}r.internal.putStream({additionalKeyValues:o,objectId:a.objId}),r.internal.out(\"endobj\")}n&&nt(r.internal.acroformPlugin.xForms,r)}(r,t)})),t.internal.acroformPlugin.isInitialized=!0}},at=E.__acroform__.arrayToPdfArray=function(t,r,n){var i=function(t){return t};if(Array.isArray(t)){for(var a=\"[\",o=0;o<t.length;o++)switch(0!==o&&(a+=\" \"),e(t[o])){case\"boolean\":case\"number\":case\"object\":a+=t[o].toString();break;case\"string\":\"/\"!==t[o].substr(0,1)?(void 0!==r&&n&&(i=n.internal.getEncryptor(r)),a+=\"(\"+D(i(t[o].toString()))+\")\"):a+=t[o].toString()}return a+=\"]\"}throw new Error(\"Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray\")};var ot=function(t,e,r){var n=function(t){return t};return void 0!==e&&r&&(n=r.internal.getEncryptor(e)),(t=t||\"\").toString(),t=\"(\"+D(n(t))+\")\"},st=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,\"objId\",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,\"scope\",{value:this._scope,writable:!0})};st.prototype.toString=function(){return this.objId+\" 0 R\"},st.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out(\"endobj\")},st.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter((function(t){return\"content\"!=t&&\"appearanceStreamContent\"!=t&&\"scope\"!=t&&\"objId\"!=t&&\"_\"!=t.substring(0,1)}));for(var r in e)if(!1===Object.getOwnPropertyDescriptor(this,e[r]).configurable){var n=e[r],i=this[n];i&&(Array.isArray(i)?t.push({key:n,value:at(i,this.objId,this.scope)}):i instanceof st?(i.scope=this.scope,t.push({key:n,value:i.objId+\" 0 R\"})):\"function\"!=typeof i&&t.push({key:n,value:i}))}return t};var ct=function(){st.call(this),Object.defineProperty(this,\"Type\",{value:\"/XObject\",configurable:!1,writable:!0}),Object.defineProperty(this,\"Subtype\",{value:\"/Form\",configurable:!1,writable:!0}),Object.defineProperty(this,\"FormType\",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,\"BBox\",{configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"Resources\",{value:\"2 0 R\",configurable:!1,writable:!0}),Object.defineProperty(this,\"stream\",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};z(ct,st);var ut=function(){st.call(this);var t,e=[];Object.defineProperty(this,\"Kids\",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,\"Fields\",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,\"DA\",{enumerable:!1,configurable:!1,get:function(){if(t){var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),\"(\"+D(e(t))+\")\"}},set:function(e){t=e}})};z(ut,st);var lt=function t(){st.call(this);var e=4;Object.defineProperty(this,\"F\",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value \"'+t+'\" for attribute F supplied.');e=t}}),Object.defineProperty(this,\"showWhenPrinted\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(e,3))},set:function(t){!0===Boolean(t)?this.F=X(e,3):this.F=K(e,3)}});var r=0;Object.defineProperty(this,\"Ff\",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){if(isNaN(t))throw new Error('Invalid value \"'+t+'\" for attribute Ff supplied.');r=t}});var n=[];Object.defineProperty(this,\"Rect\",{enumerable:!1,configurable:!1,get:function(){if(0!==n.length)return n},set:function(t){n=void 0!==t?t:[]}}),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(t){n[0]=t}}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(t){n[1]=t}}),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(t){n[2]=t}}),Object.defineProperty(this,\"height\",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(t){n[3]=t}});var i=\"\";Object.defineProperty(this,\"FT\",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case\"/Btn\":case\"/Tx\":case\"/Ch\":case\"/Sig\":i=t;break;default:throw new Error('Invalid value \"'+t+'\" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,\"T\",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof bt)return;a=\"FieldObject\"+t.FieldNum++}var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),\"(\"+D(e(a))+\")\"},set:function(t){a=t.toString()}}),Object.defineProperty(this,\"fieldName\",{configurable:!0,enumerable:!0,get:function(){return a},set:function(t){a=t}});var o=\"helvetica\";Object.defineProperty(this,\"fontName\",{enumerable:!0,configurable:!0,get:function(){return o},set:function(t){o=t}});var s=\"normal\";Object.defineProperty(this,\"fontStyle\",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var c=0;Object.defineProperty(this,\"fontSize\",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var u=void 0;Object.defineProperty(this,\"maxFontSize\",{enumerable:!0,configurable:!0,get:function(){return void 0===u?50/q:u},set:function(t){u=t}});var l=\"black\";Object.defineProperty(this,\"color\",{enumerable:!0,configurable:!0,get:function(){return l},set:function(t){l=t}});var h=\"/F1 0 Tf 0 g\";Object.defineProperty(this,\"DA\",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof bt||this instanceof wt))return ot(h,this.objId,this.scope)},set:function(t){t=t.toString(),h=t}});var f=null;Object.defineProperty(this,\"DV\",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof gt==!1?ot(f,this.objId,this.scope):f},set:function(t){t=t.toString(),f=this instanceof gt==!1?\"(\"===t.substr(0,1)?R(t.substr(1,t.length-2)):R(t):t}}),Object.defineProperty(this,\"defaultValue\",{enumerable:!0,configurable:!0,get:function(){return this instanceof gt==!0?R(f.substr(1,f.length-1)):f},set:function(t){t=t.toString(),f=this instanceof gt==!0?\"/\"+t:t}});var d=null;Object.defineProperty(this,\"_V\",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(t){this.V=t}}),Object.defineProperty(this,\"V\",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof gt==!1?ot(d,this.objId,this.scope):d},set:function(t){t=t.toString(),d=this instanceof gt==!1?\"(\"===t.substr(0,1)?R(t.substr(1,t.length-2)):R(t):t}}),Object.defineProperty(this,\"value\",{enumerable:!0,configurable:!0,get:function(){return this instanceof gt==!0?R(d.substr(1,d.length-1)):d},set:function(t){t=t.toString(),d=this instanceof gt==!0?\"/\"+t:t}}),Object.defineProperty(this,\"hasAnnotation\",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,\"Type\",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?\"/Annot\":null}}),Object.defineProperty(this,\"Subtype\",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?\"/Widget\":null}});var p,g=!1;Object.defineProperty(this,\"hasAppearanceStream\",{enumerable:!0,configurable:!0,get:function(){return g},set:function(t){t=Boolean(t),g=t}}),Object.defineProperty(this,\"page\",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(t){p=t}}),Object.defineProperty(this,\"readOnly\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,1):this.Ff=K(this.Ff,1)}}),Object.defineProperty(this,\"required\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,2):this.Ff=K(this.Ff,2)}}),Object.defineProperty(this,\"noExport\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,3):this.Ff=K(this.Ff,3)}});var m=null;Object.defineProperty(this,\"Q\",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value \"'+t+'\" for attribute Q supplied.');m=t}}),Object.defineProperty(this,\"textAlign\",{get:function(){var t;switch(m){case 0:default:t=\"left\";break;case 1:t=\"center\";break;case 2:t=\"right\"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case\"right\":case 2:m=2;break;case\"center\":case 1:m=1;break;case\"left\":case 0:default:m=0}}})};z(lt,st);var ht=function(){lt.call(this),this.FT=\"/Ch\",this.V=\"()\",this.fontName=\"zapfdingbats\";var t=0;Object.defineProperty(this,\"TI\",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,\"topIndex\",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var e=[];Object.defineProperty(this,\"Opt\",{enumerable:!0,configurable:!1,get:function(){return at(e,this.objId,this.scope)},set:function(t){var r,n;n=[],\"string\"==typeof(r=t)&&(n=function(t,e,r){r||(r=1);for(var n,i=[];n=e.exec(t);)i.push(n[r]);return i}(r,/\\((.*?)\\)/g)),e=n}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||\"\").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,r){for(r=r||!1,t=(t=t||\"\").toString();-1!==e.indexOf(t)&&(e.splice(e.indexOf(t),1),!1!==r););},Object.defineProperty(this,\"combo\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,18):this.Ff=K(this.Ff,18)}}),Object.defineProperty(this,\"edit\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=X(this.Ff,19):this.Ff=K(this.Ff,19))}}),Object.defineProperty(this,\"sort\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=X(this.Ff,20),e.sort()):this.Ff=K(this.Ff,20)}}),Object.defineProperty(this,\"multiSelect\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,22):this.Ff=K(this.Ff,22)}}),Object.defineProperty(this,\"doNotSpellCheck\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,23):this.Ff=K(this.Ff,23)}}),Object.defineProperty(this,\"commitOnSelChange\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,27):this.Ff=K(this.Ff,27)}}),this.hasAppearanceStream=!1};z(ht,lt);var ft=function(){ht.call(this),this.fontName=\"helvetica\",this.combo=!1};z(ft,ht);var dt=function(){ft.call(this),this.combo=!0};z(dt,ft);var pt=function(){dt.call(this),this.edit=!0};z(pt,dt);var gt=function(){lt.call(this),this.FT=\"/Btn\",Object.defineProperty(this,\"noToggleToOff\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,15):this.Ff=K(this.Ff,15)}}),Object.defineProperty(this,\"radio\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,16):this.Ff=K(this.Ff,16)}}),Object.defineProperty(this,\"pushButton\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,17):this.Ff=K(this.Ff,17)}}),Object.defineProperty(this,\"radioIsUnison\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,26):this.Ff=K(this.Ff,26)}});var t,r={};Object.defineProperty(this,\"MK\",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(r).length){var e,n=[];for(e in n.push(\"<<\"),r)n.push(\"/\"+e+\" (\"+D(t(r[e]))+\")\");return n.push(\">>\"),n.join(\"\\n\")}},set:function(t){\"object\"===e(t)&&(r=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return r.CA||\"\"},set:function(t){\"string\"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t=\"/\"+e}})};z(gt,lt);var mt=function(){gt.call(this),this.pushButton=!0};z(mt,gt);var vt=function(){gt.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,\"Kids\",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};z(vt,gt);var bt=function(){var t,r;lt.call(this),Object.defineProperty(this,\"Parent\",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,\"optionName\",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t}});var n,i={};Object.defineProperty(this,\"MK\",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};this.scope&&(t=this.scope.internal.getEncryptor(this.objId));var e,r=[];for(e in r.push(\"<<\"),i)r.push(\"/\"+e+\" (\"+D(t(i[e]))+\")\");return r.push(\">>\"),r.join(\"\\n\")},set:function(t){\"object\"===e(t)&&(i=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return i.CA||\"\"},set:function(t){\"string\"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n=\"/\"+t}}),this.caption=\"l\",this.appearanceState=\"Off\",this._AppearanceType=Lt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};z(bt,lt),vt.prototype.setAppearance=function(t){if(!(\"createAppearanceStream\"in t)||!(\"getCA\"in t))throw new Error(\"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var r=this.Kids[e];r.appearanceStreamContent=t.createAppearanceStream(r.optionName),r.caption=t.getCA()}},vt.prototype.createOption=function(t){var e=new bt;return e.Parent=this,e.optionName=t,this.Kids.push(e),At.call(this.scope,e),e};var yt=function(){gt.call(this),this.fontName=\"zapfdingbats\",this.caption=\"3\",this.appearanceState=\"On\",this.value=\"On\",this.textAlign=\"center\",this.appearanceStreamContent=Lt.CheckBox.createAppearanceStream()};z(yt,gt);var wt=function(){lt.call(this),this.FT=\"/Tx\",Object.defineProperty(this,\"multiline\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,13):this.Ff=K(this.Ff,13)}}),Object.defineProperty(this,\"fileSelect\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,21):this.Ff=K(this.Ff,21)}}),Object.defineProperty(this,\"doNotSpellCheck\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,23):this.Ff=K(this.Ff,23)}}),Object.defineProperty(this,\"doNotScroll\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,24):this.Ff=K(this.Ff,24)}}),Object.defineProperty(this,\"comb\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,25):this.Ff=K(this.Ff,25)}}),Object.defineProperty(this,\"richText\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,26):this.Ff=K(this.Ff,26)}});var t=null;Object.defineProperty(this,\"MaxLen\",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,\"maxLength\",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,\"hasAppearanceStream\",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};z(wt,lt);var Nt=function(){wt.call(this),Object.defineProperty(this,\"password\",{enumerable:!0,configurable:!0,get:function(){return Boolean(J(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=X(this.Ff,14):this.Ff=K(this.Ff,14)}}),this.password=!0};z(Nt,wt);var Lt={CheckBox:{createAppearanceStream:function(){return{N:{On:Lt.CheckBox.YesNormal},D:{On:Lt.CheckBox.YesPushDown,Off:Lt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=W(t);e.scope=t.scope;var r=[],n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=Q(t,t.caption);return r.push(\"0.749023 g\"),r.push(\"0 0 \"+T(Lt.internal.getWidth(t))+\" \"+T(Lt.internal.getHeight(t))+\" re\"),r.push(\"f\"),r.push(\"BMC\"),r.push(\"q\"),r.push(\"0 0 1 rg\"),r.push(\"/\"+n+\" \"+T(a.fontSize)+\" Tf \"+i),r.push(\"BT\"),r.push(a.text),r.push(\"ET\"),r.push(\"Q\"),r.push(\"EMC\"),e.stream=r.join(\"\\n\"),e},YesNormal:function(t){var e=W(t);e.scope=t.scope;var r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color),i=[],a=Lt.internal.getHeight(t),o=Lt.internal.getWidth(t),s=Q(t,t.caption);return i.push(\"1 g\"),i.push(\"0 0 \"+T(o)+\" \"+T(a)+\" re\"),i.push(\"f\"),i.push(\"q\"),i.push(\"0 0 1 rg\"),i.push(\"0 0 \"+T(o-1)+\" \"+T(a-1)+\" re\"),i.push(\"W\"),i.push(\"n\"),i.push(\"0 g\"),i.push(\"BT\"),i.push(\"/\"+r+\" \"+T(s.fontSize)+\" Tf \"+n),i.push(s.text),i.push(\"ET\"),i.push(\"Q\"),e.stream=i.join(\"\\n\"),e},OffPushDown:function(t){var e=W(t);e.scope=t.scope;var r=[];return r.push(\"0.749023 g\"),r.push(\"0 0 \"+T(Lt.internal.getWidth(t))+\" \"+T(Lt.internal.getHeight(t))+\" re\"),r.push(\"f\"),e.stream=r.join(\"\\n\"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Lt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Lt.RadioButton.Circle.YesNormal,e.D[t]=Lt.RadioButton.Circle.YesPushDown,e},getCA:function(){return\"l\"},YesNormal:function(t){var e=W(t);e.scope=t.scope;var r=[],n=Lt.internal.getWidth(t)<=Lt.internal.getHeight(t)?Lt.internal.getWidth(t)/4:Lt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Lt.internal.Bezier_C,a=Number((n*i).toFixed(5));return r.push(\"q\"),r.push(\"1 0 0 1 \"+U(Lt.internal.getWidth(t)/2)+\" \"+U(Lt.internal.getHeight(t)/2)+\" cm\"),r.push(n+\" 0 m\"),r.push(n+\" \"+a+\" \"+a+\" \"+n+\" 0 \"+n+\" c\"),r.push(\"-\"+a+\" \"+n+\" -\"+n+\" \"+a+\" -\"+n+\" 0 c\"),r.push(\"-\"+n+\" -\"+a+\" -\"+a+\" -\"+n+\" 0 -\"+n+\" c\"),r.push(a+\" -\"+n+\" \"+n+\" -\"+a+\" \"+n+\" 0 c\"),r.push(\"f\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e},YesPushDown:function(t){var e=W(t);e.scope=t.scope;var r=[],n=Lt.internal.getWidth(t)<=Lt.internal.getHeight(t)?Lt.internal.getWidth(t)/4:Lt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Lt.internal.Bezier_C).toFixed(5)),o=Number((n*Lt.internal.Bezier_C).toFixed(5));return r.push(\"0.749023 g\"),r.push(\"q\"),r.push(\"1 0 0 1 \"+U(Lt.internal.getWidth(t)/2)+\" \"+U(Lt.internal.getHeight(t)/2)+\" cm\"),r.push(i+\" 0 m\"),r.push(i+\" \"+a+\" \"+a+\" \"+i+\" 0 \"+i+\" c\"),r.push(\"-\"+a+\" \"+i+\" -\"+i+\" \"+a+\" -\"+i+\" 0 c\"),r.push(\"-\"+i+\" -\"+a+\" -\"+a+\" -\"+i+\" 0 -\"+i+\" c\"),r.push(a+\" -\"+i+\" \"+i+\" -\"+a+\" \"+i+\" 0 c\"),r.push(\"f\"),r.push(\"Q\"),r.push(\"0 g\"),r.push(\"q\"),r.push(\"1 0 0 1 \"+U(Lt.internal.getWidth(t)/2)+\" \"+U(Lt.internal.getHeight(t)/2)+\" cm\"),r.push(n+\" 0 m\"),r.push(n+\" \"+o+\" \"+o+\" \"+n+\" 0 \"+n+\" c\"),r.push(\"-\"+o+\" \"+n+\" -\"+n+\" \"+o+\" -\"+n+\" 0 c\"),r.push(\"-\"+n+\" -\"+o+\" -\"+o+\" -\"+n+\" 0 -\"+n+\" c\"),r.push(o+\" -\"+n+\" \"+n+\" -\"+o+\" \"+n+\" 0 c\"),r.push(\"f\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e},OffPushDown:function(t){var e=W(t);e.scope=t.scope;var r=[],n=Lt.internal.getWidth(t)<=Lt.internal.getHeight(t)?Lt.internal.getWidth(t)/4:Lt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Lt.internal.Bezier_C).toFixed(5));return r.push(\"0.749023 g\"),r.push(\"q\"),r.push(\"1 0 0 1 \"+U(Lt.internal.getWidth(t)/2)+\" \"+U(Lt.internal.getHeight(t)/2)+\" cm\"),r.push(i+\" 0 m\"),r.push(i+\" \"+a+\" \"+a+\" \"+i+\" 0 \"+i+\" c\"),r.push(\"-\"+a+\" \"+i+\" -\"+i+\" \"+a+\" -\"+i+\" 0 c\"),r.push(\"-\"+i+\" -\"+a+\" -\"+a+\" -\"+i+\" 0 -\"+i+\" c\"),r.push(a+\" -\"+i+\" \"+i+\" -\"+a+\" \"+i+\" 0 c\"),r.push(\"f\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Lt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Lt.RadioButton.Cross.YesNormal,e.D[t]=Lt.RadioButton.Cross.YesPushDown,e},getCA:function(){return\"8\"},YesNormal:function(t){var e=W(t);e.scope=t.scope;var r=[],n=Lt.internal.calculateCross(t);return r.push(\"q\"),r.push(\"1 1 \"+T(Lt.internal.getWidth(t)-2)+\" \"+T(Lt.internal.getHeight(t)-2)+\" re\"),r.push(\"W\"),r.push(\"n\"),r.push(T(n.x1.x)+\" \"+T(n.x1.y)+\" m\"),r.push(T(n.x2.x)+\" \"+T(n.x2.y)+\" l\"),r.push(T(n.x4.x)+\" \"+T(n.x4.y)+\" m\"),r.push(T(n.x3.x)+\" \"+T(n.x3.y)+\" l\"),r.push(\"s\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e},YesPushDown:function(t){var e=W(t);e.scope=t.scope;var r=Lt.internal.calculateCross(t),n=[];return n.push(\"0.749023 g\"),n.push(\"0 0 \"+T(Lt.internal.getWidth(t))+\" \"+T(Lt.internal.getHeight(t))+\" re\"),n.push(\"f\"),n.push(\"q\"),n.push(\"1 1 \"+T(Lt.internal.getWidth(t)-2)+\" \"+T(Lt.internal.getHeight(t)-2)+\" re\"),n.push(\"W\"),n.push(\"n\"),n.push(T(r.x1.x)+\" \"+T(r.x1.y)+\" m\"),n.push(T(r.x2.x)+\" \"+T(r.x2.y)+\" l\"),n.push(T(r.x4.x)+\" \"+T(r.x4.y)+\" m\"),n.push(T(r.x3.x)+\" \"+T(r.x3.y)+\" l\"),n.push(\"s\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},OffPushDown:function(t){var e=W(t);e.scope=t.scope;var r=[];return r.push(\"0.749023 g\"),r.push(\"0 0 \"+T(Lt.internal.getWidth(t))+\" \"+T(Lt.internal.getHeight(t))+\" re\"),r.push(\"f\"),e.stream=r.join(\"\\n\"),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color);return\"/\"+e+\" \"+t.fontSize+\" Tf \"+r}};Lt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Lt.internal.getWidth(t),r=Lt.internal.getHeight(t),n=Math.min(e,r);return{x1:{x:(e-n)/2,y:(r-n)/2+n},x2:{x:(e-n)/2+n,y:(r-n)/2},x3:{x:(e-n)/2,y:(r-n)/2},x4:{x:(e-n)/2+n,y:(r-n)/2+n}}}},Lt.internal.getWidth=function(t){var r=0;return\"object\"===e(t)&&(r=H(t.Rect[2])),r},Lt.internal.getHeight=function(t){var r=0;return\"object\"===e(t)&&(r=H(t.Rect[3])),r};var At=E.addField=function(t){if(it(this,t),!(t instanceof lt))throw new Error(\"Invalid argument passed to jsPDF.addField.\");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};E.AcroFormChoiceField=ht,E.AcroFormListBox=ft,E.AcroFormComboBox=dt,E.AcroFormEditBox=pt,E.AcroFormButton=gt,E.AcroFormPushButton=mt,E.AcroFormRadioButton=vt,E.AcroFormCheckBox=yt,E.AcroFormTextField=wt,E.AcroFormPasswordField=Nt,E.AcroFormAppearance=Lt,E.AcroForm={ChoiceField:ht,ListBox:ft,ComboBox:dt,EditBox:pt,Button:gt,PushButton:mt,RadioButton:vt,CheckBox:yt,TextField:wt,PasswordField:Nt,Appearance:Lt},M.AcroForm={ChoiceField:ht,ListBox:ft,ComboBox:dt,EditBox:pt,Button:gt,PushButton:mt,RadioButton:vt,CheckBox:yt,TextField:wt,PasswordField:Nt,Appearance:Lt};var xt=M.AcroForm;function St(t){return t.reduce((function(t,e,r){return t[e]=r,t}),{})}!function(t){t.__addimage__={};var r=\"UNKNOWN\",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=t.__addimage__.getImageFileTypeByImageData=function(t,e){var i,a,o,s,c,u=r;if(\"RGBA\"===(e=e||r)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&\"height\"in t&&\"width\"in t)return\"RGBA\";if(x(t))for(c in n)for(o=n[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(void 0!==o[i][a]&&o[i][a]!==t[a]){s=!1;break}if(!0===s){u=c;break}}else for(c in n)for(o=n[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(void 0!==o[i][a]&&o[i][a]!==t.charCodeAt(a)){s=!1;break}if(!0===s){u=c;break}}return u===r&&e!==r&&(u=e),u},a=function t(e){for(var r=this.internal.write,n=this.internal.putStream,i=(0,this.internal.getFilters)();-1!==i.indexOf(\"FlateEncode\");)i.splice(i.indexOf(\"FlateEncode\"),1);e.objectId=this.internal.newObject();var a=[];if(a.push({key:\"Type\",value:\"/XObject\"}),a.push({key:\"Subtype\",value:\"/Image\"}),a.push({key:\"Width\",value:e.width}),a.push({key:\"Height\",value:e.height}),e.colorSpace===b.INDEXED?a.push({key:\"ColorSpace\",value:\"[/Indexed /DeviceRGB \"+(e.palette.length/3-1)+\" \"+(\"sMask\"in e&&void 0!==e.sMask?e.objectId+2:e.objectId+1)+\" 0 R]\"}):(a.push({key:\"ColorSpace\",value:\"/\"+e.colorSpace}),e.colorSpace===b.DEVICE_CMYK&&a.push({key:\"Decode\",value:\"[1 0 1 0 1 0 1 0]\"})),a.push({key:\"BitsPerComponent\",value:e.bitsPerComponent}),\"decodeParameters\"in e&&void 0!==e.decodeParameters&&a.push({key:\"DecodeParms\",value:\"<<\"+e.decodeParameters+\">>\"}),\"transparency\"in e&&Array.isArray(e.transparency)){for(var o=\"\",s=0,c=e.transparency.length;s<c;s++)o+=e.transparency[s]+\" \"+e.transparency[s]+\" \";a.push({key:\"Mask\",value:\"[\"+o+\"]\"})}void 0!==e.sMask&&a.push({key:\"SMask\",value:e.objectId+1+\" 0 R\"});var u=void 0!==e.filter?[\"/\"+e.filter]:void 0;if(n({data:e.data,additionalKeyValues:a,alreadyAppliedFilters:u,objectId:e.objectId}),r(\"endobj\"),\"sMask\"in e&&void 0!==e.sMask){var l=\"/Predictor \"+e.predictor+\" /Colors 1 /BitsPerComponent \"+e.bitsPerComponent+\" /Columns \"+e.width,h={width:e.width,height:e.height,colorSpace:\"DeviceGray\",bitsPerComponent:e.bitsPerComponent,decodeParameters:l,data:e.sMask};\"filter\"in e&&(h.filter=e.filter),t.call(this,h)}if(e.colorSpace===b.INDEXED){var f=this.internal.newObject();n({data:_(new Uint8Array(e.palette)),objectId:f}),r(\"endobj\")}},o=function(){var t=this.internal.collections.addImage_images;for(var e in t)a.call(this,t[e])},s=function(){var t,e=this.internal.collections.addImage_images,r=this.internal.write;for(var n in e)r(\"/I\"+(t=e[n]).index,t.objectId,\"0\",\"R\")},u=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe(\"putResources\",o),this.internal.events.subscribe(\"putXobjectDict\",s))},l=function(){var t=this.internal.collections.addImage_images;return u.call(this),t},h=function(){return Object.keys(this.internal.collections.addImage_images).length},f=function(e){return\"function\"==typeof t[\"process\"+e.toUpperCase()]},d=function(t){return\"object\"===e(t)&&1===t.nodeType},p=function(e,r){if(\"IMG\"===e.nodeName&&e.hasAttribute(\"src\")){var n=\"\"+e.getAttribute(\"src\");if(0===n.indexOf(\"data:image/\"))return c(unescape(n).split(\"base64,\").pop());var i=t.loadFile(n,!0);if(void 0!==i)return i}if(\"CANVAS\"===e.nodeName){if(0===e.width||0===e.height)throw new Error(\"Given canvas must have data. Canvas width: \"+e.width+\", height: \"+e.height);var a;switch(r){case\"PNG\":a=\"image/png\";break;case\"WEBP\":a=\"image/webp\";break;case\"JPEG\":case\"JPG\":default:a=\"image/jpeg\"}return c(e.toDataURL(a,1).split(\"base64,\").pop())}},g=function(t){var e=this.internal.collections.addImage_images;if(e)for(var r in e)if(t===e[r].alias)return e[r]},m=function(t,e,r){return t||e||(t=-96,e=-96),t<0&&(t=-1*r.width*72/t/this.internal.scaleFactor),e<0&&(e=-1*r.height*72/e/this.internal.scaleFactor),0===t&&(t=e*r.width/r.height),0===e&&(e=t*r.height/r.width),[t,e]},v=function(t,e,r,n,i,a){var o=m.call(this,r,n,i),s=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,u=l.call(this);if(r=o[0],n=o[1],u[i.index]=i,a){a*=Math.PI/180;var h=Math.cos(a),f=Math.sin(a),d=function(t){return t.toFixed(4)},p=[d(h),d(f),d(-1*f),d(h),0,0,\"cm\"]}this.internal.write(\"q\"),a?(this.internal.write([1,\"0\",\"0\",1,s(t),c(e+n),\"cm\"].join(\" \")),this.internal.write(p.join(\" \")),this.internal.write([s(r),\"0\",\"0\",s(n),\"0\",\"0\",\"cm\"].join(\" \"))):this.internal.write([s(r),\"0\",\"0\",s(n),s(t),c(e+n),\"cm\"].join(\" \")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,\"cm\"].join(\" \")),this.internal.write(\"/I\"+i.index+\" Do\"),this.internal.write(\"Q\")},b=t.color_spaces={DEVICE_RGB:\"DeviceRGB\",DEVICE_GRAY:\"DeviceGray\",DEVICE_CMYK:\"DeviceCMYK\",CAL_GREY:\"CalGray\",CAL_RGB:\"CalRGB\",LAB:\"Lab\",ICC_BASED:\"ICCBased\",INDEXED:\"Indexed\",PATTERN:\"Pattern\",SEPARATION:\"Separation\",DEVICE_N:\"DeviceN\"};t.decode={DCT_DECODE:\"DCTDecode\",FLATE_DECODE:\"FlateDecode\",LZW_DECODE:\"LZWDecode\",JPX_DECODE:\"JPXDecode\",JBIG2_DECODE:\"JBIG2Decode\",ASCII85_DECODE:\"ASCII85Decode\",ASCII_HEX_DECODE:\"ASCIIHexDecode\",RUN_LENGTH_DECODE:\"RunLengthDecode\",CCITT_FAX_DECODE:\"CCITTFaxDecode\"};var y=t.image_compression={NONE:\"NONE\",FAST:\"FAST\",MEDIUM:\"MEDIUM\",SLOW:\"SLOW\"},w=t.__addimage__.sHashCode=function(t){var e,r,n=0;if(\"string\"==typeof t)for(r=t.length,e=0;e<r;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;else if(x(t))for(r=t.byteLength/2,e=0;e<r;e++)n=(n<<5)-n+t[e],n|=0;return n},N=t.__addimage__.validateStringAsBase64=function(t){(t=t||\"\").toString().trim();var e=!0;return 0===t.length&&(e=!1),t.length%4!=0&&(e=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(e=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(e=!1),e},L=t.__addimage__.extractImageFromDataUrl=function(t){var e=(t=t||\"\").split(\"base64,\"),r=null;if(2===e.length){var n=/^data:(\\w*\\/\\w*);*(charset=(?!charset=)[\\w=-]*)*;*$/.exec(e[0]);Array.isArray(n)&&(r={mimeType:n[1],charset:n[2],data:e[1]})}return r},A=t.__addimage__.supportsArrayBuffer=function(){return\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return A()&&t instanceof ArrayBuffer};var x=t.__addimage__.isArrayBufferView=function(t){return A()&&\"undefined\"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||\"undefined\"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)},S=t.__addimage__.binaryStringToUint8Array=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t.charCodeAt(n);return r},_=t.__addimage__.arrayBufferToBinaryString=function(t){for(var e=\"\",r=x(t)?t:new Uint8Array(t),n=0;n<r.length;n+=8192)e+=String.fromCharCode.apply(null,r.subarray(n,n+8192));return e};t.addImage=function(){var t,n,i,a,o,s,c,l,h;if(\"number\"==typeof arguments[1]?(n=r,i=arguments[1],a=arguments[2],o=arguments[3],s=arguments[4],c=arguments[5],l=arguments[6],h=arguments[7]):(n=arguments[1],i=arguments[2],a=arguments[3],o=arguments[4],s=arguments[5],c=arguments[6],l=arguments[7],h=arguments[8]),\"object\"===e(t=arguments[0])&&!d(t)&&\"imageData\"in t){var f=t;t=f.imageData,n=f.format||n||r,i=f.x||i||0,a=f.y||a||0,o=f.w||f.width||o,s=f.h||f.height||s,c=f.alias||c,l=f.compression||l,h=f.rotation||f.angle||h}var p=this.internal.getFilters();if(void 0===l&&-1!==p.indexOf(\"FlateEncode\")&&(l=\"SLOW\"),isNaN(i)||isNaN(a))throw new Error(\"Invalid coordinates passed to jsPDF.addImage\");u.call(this);var g=P.call(this,t,n,c,l);return v.call(this,i,a,o,s,g,h),this};var P=function(e,n,a,o){var s,c,u;if(\"string\"==typeof e&&i(e)===r){e=unescape(e);var l=k(e,!1);(\"\"!==l||void 0!==(l=t.loadFile(e,!0)))&&(e=l)}if(d(e)&&(e=p(e,n)),n=i(e,n),!f(n))throw new Error(\"addImage does not support files of type '\"+n+\"', please ensure that a plugin for '\"+n+\"' support is added.\");if((null==(u=a)||0===u.length)&&(a=function(t){return\"string\"==typeof t||x(t)?w(t):x(t.data)?w(t.data):null}(e)),(s=g.call(this,a))||(A()&&(e instanceof Uint8Array||\"RGBA\"===n||(c=e,e=S(e))),s=this[\"process\"+n.toUpperCase()](e,h.call(this),a,function(e){return e&&\"string\"==typeof e&&(e=e.toUpperCase()),e in t.image_compression?e:y.NONE}(o),c)),!s)throw new Error(\"An unknown error occurred whilst processing the image.\");return s},k=t.__addimage__.convertBase64ToBinaryString=function(t,e){var r;e=\"boolean\"!=typeof e||e;var n,i=\"\";if(\"string\"==typeof t){n=null!==(r=L(t))?r.data:t;try{i=c(n)}catch(t){if(e)throw N(n)?new Error(\"atob-Error in jsPDF.convertBase64ToBinaryString \"+t.message):new Error(\"Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString \")}}return i};t.getImageProperties=function(e){var n,a,o=\"\";if(d(e)&&(e=p(e)),\"string\"==typeof e&&i(e)===r&&(\"\"===(o=k(e,!1))&&(o=t.loadFile(e)||\"\"),e=o),a=i(e),!f(a))throw new Error(\"addImage does not support files of type '\"+a+\"', please ensure that a plugin for '\"+a+\"' support is added.\");if(!A()||e instanceof Uint8Array||(e=S(e)),!(n=this[\"process\"+a.toUpperCase()](e)))throw new Error(\"An unknown error occurred whilst processing the image\");return n.fileType=a,n}}(M.API),\n /**\n    * @license\n    * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e=function(t){if(void 0!==t&&\"\"!=t)return!0};M.API.events.push([\"addPage\",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push([\"putPage\",function(t){for(var r,n,i,a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,s=this.internal.getPageInfoByObjId(t.objId),c=t.pageContext.annotations,u=!1,l=0;l<c.length&&!u;l++)switch((r=c[l]).type){case\"link\":(e(r.options.url)||e(r.options.pageNumber))&&(u=!0);break;case\"reference\":case\"text\":case\"freetext\":u=!0}if(0!=u){this.internal.write(\"/Annots [\");for(var h=0;h<c.length;h++){r=c[h];var f=this.internal.pdfEscape,d=this.internal.getEncryptor(t.objId);switch(r.type){case\"reference\":this.internal.write(\" \"+r.object.objId+\" 0 R \");break;case\"text\":var p=this.internal.newAdditionalObject(),g=this.internal.newAdditionalObject(),m=this.internal.getEncryptor(p.objId),v=r.title||\"Note\";i=\"<</Type /Annot /Subtype /Text \"+(n=\"/Rect [\"+a(r.bounds.x)+\" \"+o(r.bounds.y+r.bounds.h)+\" \"+a(r.bounds.x+r.bounds.w)+\" \"+o(r.bounds.y)+\"] \")+\"/Contents (\"+f(m(r.contents))+\")\",i+=\" /Popup \"+g.objId+\" 0 R\",i+=\" /P \"+s.objId+\" 0 R\",i+=\" /T (\"+f(m(v))+\") >>\",p.content=i;var b=p.objId+\" 0 R\";i=\"<</Type /Annot /Subtype /Popup \"+(n=\"/Rect [\"+a(r.bounds.x+30)+\" \"+o(r.bounds.y+r.bounds.h)+\" \"+a(r.bounds.x+r.bounds.w+30)+\" \"+o(r.bounds.y)+\"] \")+\" /Parent \"+b,r.open&&(i+=\" /Open true\"),i+=\" >>\",g.content=i,this.internal.write(p.objId,\"0 R\",g.objId,\"0 R\");break;case\"freetext\":n=\"/Rect [\"+a(r.bounds.x)+\" \"+o(r.bounds.y)+\" \"+a(r.bounds.x+r.bounds.w)+\" \"+o(r.bounds.y+r.bounds.h)+\"] \";var y=r.color||\"#000000\";i=\"<</Type /Annot /Subtype /FreeText \"+n+\"/Contents (\"+f(d(r.contents))+\")\",i+=\" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#\"+y+\")\",i+=\" /Border [0 0 0]\",i+=\" >>\",this.internal.write(i);break;case\"link\":if(r.options.name){var w=this.annotations._nameMap[r.options.name];r.options.pageNumber=w.page,r.options.top=w.y}else r.options.top||(r.options.top=0);if(n=\"/Rect [\"+r.finalBounds.x+\" \"+r.finalBounds.y+\" \"+r.finalBounds.w+\" \"+r.finalBounds.h+\"] \",i=\"\",r.options.url)i=\"<</Type /Annot /Subtype /Link \"+n+\"/Border [0 0 0] /A <</S /URI /URI (\"+f(d(r.options.url))+\") >>\";else if(r.options.pageNumber){switch(i=\"<</Type /Annot /Subtype /Link \"+n+\"/Border [0 0 0] /Dest [\"+this.internal.getPageInfo(r.options.pageNumber).objId+\" 0 R\",r.options.magFactor=r.options.magFactor||\"XYZ\",r.options.magFactor){case\"Fit\":i+=\" /Fit]\";break;case\"FitH\":i+=\" /FitH \"+r.options.top+\"]\";break;case\"FitV\":r.options.left=r.options.left||0,i+=\" /FitV \"+r.options.left+\"]\";break;case\"XYZ\":default:var N=o(r.options.top);r.options.left=r.options.left||0,void 0===r.options.zoom&&(r.options.zoom=0),i+=\" /XYZ \"+r.options.left+\" \"+N+\" \"+r.options.zoom+\"]\"}}\"\"!=i&&(i+=\" >>\",this.internal.write(i))}}this.internal.write(\"]\")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case\"link\":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case\"text\":case\"freetext\":e.pageContext.annotations.push(t)}},t.link=function(t,e,r,n,i){var a=this.internal.getCurrentPageInfo(),o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;a.pageContext.annotations.push({finalBounds:{x:o(t),y:s(e),w:o(t+r),h:s(e+n)},options:i,type:\"link\"})},t.textWithLink=function(t,e,r,n){var i,a,o=this.getTextWidth(t),s=this.internal.getLineHeight()/this.internal.scaleFactor;if(void 0!==n.maxWidth){a=n.maxWidth;var c=this.splitTextToSize(t,a).length;i=Math.ceil(s*c)}else a=o,i=s;return this.text(t,e,r,n),r+=.2*s,\"center\"===n.align&&(e-=o/2),\"right\"===n.align&&(e-=o),this.link(e,r-s,a,i,n),o},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}}(M.API),\n /**\n    * @license\n    * Copyright (c) 2017 Aras Abbasi\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var a=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},o=t.__arabicParser__.isArabicLetter=function(t){return\"string\"==typeof t&&/^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(t)},s=t.__arabicParser__.isArabicEndLetter=function(t){return o(t)&&a(t)&&e[t.charCodeAt(0)].length<=2},c=t.__arabicParser__.isArabicAlfLetter=function(t){return o(t)&&i.indexOf(t.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return o(t)&&a(t)&&e[t.charCodeAt(0)].length>=1};var u=t.__arabicParser__.arabicLetterHasFinalForm=function(t){return o(t)&&a(t)&&e[t.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(t){return o(t)&&a(t)&&e[t.charCodeAt(0)].length>=3};var l=t.__arabicParser__.arabicLetterHasMedialForm=function(t){return o(t)&&a(t)&&4==e[t.charCodeAt(0)].length},h=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=r,i=\"\",a=0;for(e=0;e<t.length;e+=1)void 0!==n[t.charCodeAt(e)]?(a++,\"number\"==typeof(n=n[t.charCodeAt(e)])&&(i+=String.fromCharCode(n),n=r,a=0),e===t.length-1&&(n=r,i+=t.charAt(e-(a-1)),e-=a-1,a=0)):(n=r,i+=t.charAt(e-a),e-=a,a=0);return i};t.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==n[t.charCodeAt(0)]};var f=t.__arabicParser__.getCorrectForm=function(t,e,r){return o(t)?!1===a(t)?-1:!u(t)||!o(e)&&!o(r)||!o(r)&&s(e)||s(t)&&!o(e)||s(t)&&c(e)||s(t)&&s(e)?0:l(t)&&o(e)&&!s(e)&&o(r)&&u(r)?3:s(t)||!o(r)?1:2:-1},d=function(t){var r=0,n=0,i=0,a=\"\",s=\"\",c=\"\",u=(t=t||\"\").split(\"\\\\s+\"),l=[];for(r=0;r<u.length;r+=1){for(l.push(\"\"),n=0;n<u[r].length;n+=1)a=u[r][n],s=u[r][n-1],c=u[r][n+1],o(a)?(i=f(a,s,c),l[r]+=-1!==i?String.fromCharCode(e[a.charCodeAt(0)][i]):a):l[r]+=a;l[r]=h(l[r])}return l.join(\" \")},p=t.__arabicParser__.processArabic=t.processArabic=function(){var t,e=\"string\"==typeof arguments[0]?arguments[0]:arguments[0].text,r=[];if(Array.isArray(e)){var n=0;for(r=[],n=0;n<e.length;n+=1)Array.isArray(e[n])?r.push([d(e[n][0]),e[n][1],e[n][2]]):r.push([d(e[n])]);t=r}else t=d(e);return\"string\"==typeof arguments[0]?t:(arguments[0].text=t,arguments[0])};t.events.push([\"preProcessText\",p])}(M.API),\n /** @license\n    * jsPDF Autoprint Plugin\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){t.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||\"non-conform\",t.variant){case\"javascript\":this.addJS(\"print({});\");break;case\"non-conform\":default:this.internal.events.subscribe(\"postPutResources\",(function(){e=this.internal.newObject(),this.internal.out(\"<<\"),this.internal.out(\"/S /Named\"),this.internal.out(\"/Type /Action\"),this.internal.out(\"/N /Print\"),this.internal.out(\">>\"),this.internal.out(\"endobj\")})),this.internal.events.subscribe(\"putCatalog\",(function(){this.internal.out(\"/OpenAction \"+e+\" 0 R\")}))}return this}}(M.API),\n /**\n    * @license\n    * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e=function(){var t=void 0;Object.defineProperty(this,\"pdf\",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,\"width\",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext(\"2d\").pageWrapXEnabled&&(this.getContext(\"2d\").pageWrapX=e+1)}});var r=300;Object.defineProperty(this,\"height\",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext(\"2d\").pageWrapYEnabled&&(this.getContext(\"2d\").pageWrapY=r+1)}});var n=[];Object.defineProperty(this,\"childNodes\",{get:function(){return n},set:function(t){n=t}});var i={};Object.defineProperty(this,\"style\",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,\"parentNode\",{})};e.prototype.getContext=function(t,e){var r;if(\"2d\"!==(t=t||\"2d\"))return null;for(r in e)this.pdf.context2d.hasOwnProperty(r)&&(this.pdf.context2d[r]=e[r]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error(\"toDataURL is not implemented.\")},t.events.push([\"initialized\",function(){this.canvas=new e,this.canvas.pdf=this}])}(M.API),function(t){var r={left:0,top:0,bottom:0,right:0},n=!1,i=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},r),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var t=arguments[0];Object.defineProperty(this,\"x\",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var e=arguments[1];Object.defineProperty(this,\"y\",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var r=arguments[2];Object.defineProperty(this,\"width\",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var n=arguments[3];Object.defineProperty(this,\"height\",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var i=arguments[4];Object.defineProperty(this,\"text\",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var a=arguments[5];Object.defineProperty(this,\"lineNumber\",{enumerable:!0,get:function(){return a},set:function(t){a=t}});var o=arguments[6];return Object.defineProperty(this,\"align\",{enumerable:!0,get:function(){return o},set:function(t){o=t}}),this};o.prototype.clone=function(){return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},o.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(t){return i.call(this),this.internal.__cell__.headerFunction=\"function\"==typeof t?t:void 0,this},t.getTextDimensions=function(t,e){i.call(this);var r=(e=e||{}).fontSize||this.getFontSize(),n=e.font||this.getFont(),a=e.scaleFactor||this.internal.scaleFactor,o=0,s=0,c=0,u=this;if(!Array.isArray(t)&&\"string\"!=typeof t){if(\"number\"!=typeof t)throw new Error(\"getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.\");t=String(t)}var l=e.maxWidth;l>0?\"string\"==typeof t?t=this.splitTextToSize(t,l):\"[object Array]\"===Object.prototype.toString.call(t)&&(t=t.reduce((function(t,e){return t.concat(u.splitTextToSize(e,l))}),[])):t=Array.isArray(t)?t:[t];for(var h=0;h<t.length;h++)o<(c=this.getStringUnitWidth(t[h],{font:n})*r)&&(o=c);return 0!==o&&(s=t.length),{w:o/=a,h:Math.max((s*r*this.getLineHeightFactor()-r*(this.getLineHeightFactor()-1))/a,0)}},t.cellAddPage=function(){i.call(this),this.addPage();var t=this.internal.__cell__.margins||r;return this.internal.__cell__.lastCell=new o(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=t.cell=function(){var t;t=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),i.call(this);var e=this.internal.__cell__.lastCell,a=this.internal.__cell__.padding,s=this.internal.__cell__.margins||r,c=this.internal.__cell__.tableHeaderRow,u=this.internal.__cell__.printHeaders;return void 0!==e.lineNumber&&(e.lineNumber===t.lineNumber?(t.x=(e.x||0)+(e.width||0),t.y=e.y||0):e.y+e.height+t.height+s.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=s.top,u&&c&&(this.printHeaderRow(t.lineNumber,!0),t.y+=c[0].height)):t.y=e.y+e.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===n?\"FD\":void 0),\"right\"===t.align?this.text(t.text,t.x+t.width-a,t.y+a,{align:\"right\",baseline:\"top\"}):\"center\"===t.align?this.text(t.text,t.x+t.width/2,t.y+a,{align:\"center\",baseline:\"top\",maxWidth:t.width-a-a}):this.text(t.text,t.x+a,t.y+a,{align:\"left\",baseline:\"top\",maxWidth:t.width-a-a})),this.internal.__cell__.lastCell=t,this};t.table=function(t,n,u,l,h){if(i.call(this),!u)throw new Error(\"No data for PDF table.\");var f,d,p,g,m=[],v=[],b=[],y={},w={},N=[],L=[],A=(h=h||{}).autoSize||!1,x=!1!==h.printHeaders,S=h.css&&void 0!==h.css[\"font-size\"]?16*h.css[\"font-size\"]:h.fontSize||12,_=h.margins||Object.assign({width:this.getPageWidth()},r),P=\"number\"==typeof h.padding?h.padding:3,k=h.headerBackgroundColor||\"#c8c8c8\",F=h.headerTextColor||\"#000\";if(a.call(this),this.internal.__cell__.printHeaders=x,this.internal.__cell__.margins=_,this.internal.__cell__.table_font_size=S,this.internal.__cell__.padding=P,this.internal.__cell__.headerBackgroundColor=k,this.internal.__cell__.headerTextColor=F,this.setFontSize(S),null==l)v=m=Object.keys(u[0]),b=m.map((function(){return\"left\"}));else if(Array.isArray(l)&&\"object\"===e(l[0]))for(m=l.map((function(t){return t.name})),v=l.map((function(t){return t.prompt||t.name||\"\"})),b=l.map((function(t){return t.align||\"left\"})),f=0;f<l.length;f+=1)w[l[f].name]=l[f].width*(19.049976/25.4);else Array.isArray(l)&&\"string\"==typeof l[0]&&(v=m=l,b=m.map((function(){return\"left\"})));if(A||Array.isArray(l)&&\"string\"==typeof l[0])for(f=0;f<m.length;f+=1){for(y[g=m[f]]=u.map((function(t){return t[g]})),this.setFont(void 0,\"bold\"),N.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),d=y[g],this.setFont(void 0,\"normal\"),p=0;p<d.length;p+=1)N.push(this.getTextDimensions(d[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);w[g]=Math.max.apply(null,N)+P+P,N=[]}if(x){var I={};for(f=0;f<m.length;f+=1)I[m[f]]={},I[m[f]].text=v[f],I[m[f]].align=b[f];var C=c.call(this,I,w);L=m.map((function(e){return new o(t,n,w[e],C,I[e].text,void 0,I[e].align)})),this.setTableHeaderRow(L),this.printHeaderRow(1,!1)}var j=l.reduce((function(t,e){return t[e.name]=e.align,t}),{});for(f=0;f<u.length;f+=1){\"rowStart\"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var O=c.call(this,u[f],w);for(p=0;p<m.length;p+=1){var B=u[f][m[p]];\"cellStart\"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:p,data:B},this),s.call(this,new o(t,n,w[m[p]],O,B,f+2,j[m[p]]))}}return this.internal.__cell__.table_x=t,this.internal.__cell__.table_y=n,this};var c=function(t,e){var r=this.internal.__cell__.padding,n=this.internal.__cell__.table_font_size,i=this.internal.scaleFactor;return Object.keys(t).map((function(n){var i=t[n];return this.splitTextToSize(i.hasOwnProperty(\"text\")?i.text:i,e[n]-r-r)}),this).map((function(t){return this.getLineHeightFactor()*t.length*n/i+r+r}),this).reduce((function(t,e){return Math.max(t,e)}),0)};t.setTableHeaderRow=function(t){i.call(this),this.internal.__cell__.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(i.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error(\"Property tableHeaderRow does not exist.\");var r;if(n=!0,\"function\"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,\"bold\");for(var c=[],u=0;u<this.internal.__cell__.tableHeaderRow.length;u+=1){r=this.internal.__cell__.tableHeaderRow[u].clone(),e&&(r.y=this.internal.__cell__.margins.top||0,c.push(r)),r.lineNumber=t;var l=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,r),this.setTextColor(l)}c.length>0&&this.setTableHeaderRow(c),this.setFont(void 0,\"normal\"),n=!1}}(M.API);var _t={italic:[\"italic\",\"oblique\",\"normal\"],oblique:[\"oblique\",\"italic\",\"normal\"],normal:[\"normal\",\"oblique\",\"italic\"]},Pt=[\"ultra-condensed\",\"extra-condensed\",\"condensed\",\"semi-condensed\",\"normal\",\"semi-expanded\",\"expanded\",\"extra-expanded\",\"ultra-expanded\"],kt=St(Pt),Ft=[100,200,300,400,500,600,700,800,900],It=St(Ft);function Ct(t){var e=t.family.replace(/\"|'/g,\"\").toLowerCase(),r=function(t){return _t[t=t||\"normal\"]?t:\"normal\"}(t.style),n=function(t){if(!t)return 400;if(\"number\"==typeof t)return t>=100&&t<=900&&t%100==0?t:400;if(/^\\d00$/.test(t))return parseInt(t);switch(t){case\"bold\":return 700;case\"normal\":default:return 400}}(t.weight),i=function(t){return\"number\"==typeof kt[t=t||\"normal\"]?t:\"normal\"}(t.stretch);return{family:e,style:r,weight:n,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,r,n].join(\" \")}}}function jt(t,e,r,n){var i;for(i=r;i>=0&&i<e.length;i+=n)if(t[e[i]])return t[e[i]];for(i=r;i>=0&&i<e.length;i-=n)if(t[e[i]])return t[e[i]]}var Ot={\"sans-serif\":\"helvetica\",fixed:\"courier\",monospace:\"courier\",terminal:\"courier\",cursive:\"times\",fantasy:\"times\",serif:\"times\"},Bt={caption:\"times\",icon:\"times\",menu:\"times\",\"message-box\":\"times\",\"small-caption\":\"times\",\"status-bar\":\"times\"};function Mt(t){return[t.stretch,t.style,t.weight,t.family].join(\" \")}function Et(t,e,r){for(var n=(r=r||{}).defaultFontFamily||\"times\",i=Object.assign({},Ot,r.genericFontFamilies||{}),a=null,o=null,s=0;s<e.length;++s)if(i[(a=Ct(e[s])).family]&&(a.family=i[a.family]),t.hasOwnProperty(a.family)){o=t[a.family];break}if(!(o=o||t[n]))throw new Error(\"Could not find a font-family for the rule '\"+Mt(a)+\"' and default family '\"+n+\"'.\");if(o=function(t,e){if(e[t])return e[t];var r=kt[t],n=r<=kt.normal?-1:1,i=jt(e,Pt,r,n);if(!i)throw new Error(\"Could not find a matching font-stretch value for \"+t);return i}(a.stretch,o),o=function(t,e){if(e[t])return e[t];for(var r=_t[t],n=0;n<r.length;++n)if(e[r[n]])return e[r[n]];throw new Error(\"Could not find a matching font-style for \"+t)}(a.style,o),!(o=function(t,e){if(e[t])return e[t];if(400===t&&e[500])return e[500];if(500===t&&e[400])return e[400];var r=It[t],n=jt(e,Ft,r,t<400?-1:1);if(!n)throw new Error(\"Could not find a matching font-weight for value \"+t);return n}(a.weight,o)))throw new Error(\"Failed to resolve a font for the rule '\"+Mt(a)+\"'.\");return o}function qt(t){return t.trimLeft()}function Dt(t,e){for(var r=0;r<t.length;){if(t.charAt(r)===e)return[t.substring(0,r),t.substring(r+1)];r+=1}return null}function Rt(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===e?null:[e[0],t.substring(e[0].length)]}var Tt=[\"times\"];!function(t){var r,n,a,o,s,c,u,l,f,d=function(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||\"#000000\",this.fillStyle=t.fillStyle||\"#000000\",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||\"10px sans-serif\",this.textBaseline=t.textBaseline||\"alphabetic\",this.textAlign=t.textAlign||\"left\",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||\"miter\",this.lineCap=t.lineCap||\"butt\",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new l,this.globalCompositeOperation=t.globalCompositeOperation||\"normal\",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new c,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new c,this.lineDashOffset=t.lineDashOffset||0,this.lineDash=t.lineDash||[],this.margin=t.margin||[0,0,0,0],this.prevPageLastElemOffset=t.prevPageLastElemOffset||0,this.ignoreClearRect=\"boolean\"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push([\"initialized\",function(){this.context2d=new p(this),r=this.internal.f2,n=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString,o=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,c=this.internal.Point,u=this.internal.Rectangle,l=this.internal.Matrix,f=new d}]);var p=function(t){Object.defineProperty(this,\"canvas\",{get:function(){return{parentNode:!1,style:!1}}});var e=t;Object.defineProperty(this,\"pdf\",{get:function(){return e}});var r=!1;Object.defineProperty(this,\"pageWrapXEnabled\",{get:function(){return r},set:function(t){r=Boolean(t)}});var n=!1;Object.defineProperty(this,\"pageWrapYEnabled\",{get:function(){return n},set:function(t){n=Boolean(t)}});var i=0;Object.defineProperty(this,\"posX\",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}});var a=0;Object.defineProperty(this,\"posY\",{get:function(){return a},set:function(t){isNaN(t)||(a=t)}}),Object.defineProperty(this,\"margin\",{get:function(){return f.margin},set:function(t){var e;\"number\"==typeof t?e=[t,t,t,t]:((e=new Array(4))[0]=t[0],e[1]=t.length>=2?t[1]:e[0],e[2]=t.length>=3?t[2]:e[0],e[3]=t.length>=4?t[3]:e[1]),f.margin=e}});var o=!1;Object.defineProperty(this,\"autoPaging\",{get:function(){return o},set:function(t){o=t}});var s=0;Object.defineProperty(this,\"lastBreak\",{get:function(){return s},set:function(t){s=t}});var c=[];Object.defineProperty(this,\"pageBreaks\",{get:function(){return c},set:function(t){c=t}}),Object.defineProperty(this,\"ctx\",{get:function(){return f},set:function(t){t instanceof d&&(f=t)}}),Object.defineProperty(this,\"path\",{get:function(){return f.path},set:function(t){f.path=t}});var u=[];Object.defineProperty(this,\"ctxStack\",{get:function(){return u},set:function(t){u=t}}),Object.defineProperty(this,\"fillStyle\",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=g(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,\"strokeStyle\",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=g(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,\"lineCap\",{get:function(){return this.ctx.lineCap},set:function(t){-1!==[\"butt\",\"round\",\"square\"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,\"lineWidth\",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,\"lineJoin\",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==[\"bevel\",\"round\",\"miter\"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,\"miterLimit\",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,\"textBaseline\",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,\"textAlign\",{get:function(){return this.ctx.textAlign},set:function(t){-1!==[\"right\",\"end\",\"center\",\"left\",\"start\"].indexOf(t)&&(this.ctx.textAlign=t)}});var l=null;function h(t,e){if(null===l){var r=function(t){var e=[];return Object.keys(t).forEach((function(r){t[r].forEach((function(t){var n=null;switch(t){case\"bold\":n={family:r,weight:\"bold\"};break;case\"italic\":n={family:r,style:\"italic\"};break;case\"bolditalic\":n={family:r,weight:\"bold\",style:\"italic\"};break;case\"\":case\"normal\":n={family:r}}null!==n&&(n.ref={name:r,style:t},e.push(n))}))})),e}(t.getFontList());l=function(t){for(var e={},r=0;r<t.length;++r){var n=Ct(t[r]),i=n.family,a=n.stretch,o=n.style,s=n.weight;e[i]=e[i]||{},e[i][a]=e[i][a]||{},e[i][a][o]=e[i][a][o]||{},e[i][a][o][s]=n}return e}(r.concat(e))}return l}var p=null;Object.defineProperty(this,\"fontFaces\",{get:function(){return p},set:function(t){l=null,p=t}}),Object.defineProperty(this,\"font\",{get:function(){return this.ctx.font},set:function(t){var e;if(this.ctx.font=t,null!==(e=/^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-_,\\\"\\'\\sa-z]+?)\\s*$/i.exec(t))){var r=e[1],n=(e[2],e[3]),i=e[4],a=(e[5],e[6]),o=/^([.\\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i=\"px\"===o?Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor):\"em\"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var s=function(t){var e,r,n=[],i=t.trim();if(\"\"===i)return Tt;if(i in Bt)return[Bt[i]];for(;\"\"!==i;){switch(r=null,e=(i=qt(i)).charAt(0)){case'\"':case\"'\":r=Dt(i.substring(1),e);break;default:r=Rt(i)}if(null===r)return Tt;if(n.push(r[0]),\"\"!==(i=qt(r[1]))&&\",\"!==i.charAt(0))return Tt;i=i.replace(/^,/,\"\")}return n}(a);if(this.fontFaces){var c=Et(h(this.pdf,this.fontFaces),s.map((function(t){return{family:t,stretch:\"normal\",weight:n,style:r}})));this.pdf.setFont(c.ref.name,c.ref.style)}else{var u=\"\";(\"bold\"===n||parseInt(n,10)>=700||\"bold\"===r)&&(u=\"bold\"),\"italic\"===r&&(u+=\"italic\"),0===u.length&&(u=\"normal\");for(var l=\"\",f={arial:\"Helvetica\",Arial:\"Helvetica\",verdana:\"Helvetica\",Verdana:\"Helvetica\",helvetica:\"Helvetica\",Helvetica:\"Helvetica\",\"sans-serif\":\"Helvetica\",fixed:\"Courier\",monospace:\"Courier\",terminal:\"Courier\",cursive:\"Times\",fantasy:\"Times\",serif:\"Times\"},d=0;d<s.length;d++){if(void 0!==this.pdf.internal.getFont(s[d],u,{noFallback:!0,disableWarning:!0})){l=s[d];break}if(\"bolditalic\"===u&&void 0!==this.pdf.internal.getFont(s[d],\"bold\",{noFallback:!0,disableWarning:!0}))l=s[d],u=\"bold\";else if(void 0!==this.pdf.internal.getFont(s[d],\"normal\",{noFallback:!0,disableWarning:!0})){l=s[d],u=\"normal\";break}}if(\"\"===l)for(var p=0;p<s.length;p++)if(f[s[p]]){l=f[s[p]];break}l=\"\"===l?\"Times\":l,this.pdf.setFont(l,u)}}}}),Object.defineProperty(this,\"globalCompositeOperation\",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,\"globalAlpha\",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,\"lineDashOffset\",{get:function(){return this.ctx.lineDashOffset},set:function(t){this.ctx.lineDashOffset=t,T.call(this)}}),Object.defineProperty(this,\"lineDash\",{get:function(){return this.ctx.lineDash},set:function(t){this.ctx.lineDash=t,T.call(this)}}),Object.defineProperty(this,\"ignoreClearRect\",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};p.prototype.setLineDash=function(t){this.lineDash=t},p.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},p.prototype.fill=function(){A.call(this,\"fill\",!1)},p.prototype.stroke=function(){A.call(this,\"stroke\",!1)},p.prototype.beginPath=function(){this.path=[{type:\"begin\"}]},p.prototype.moveTo=function(t,e){if(isNaN(t)||isNaN(e))throw i.error(\"jsPDF.context2d.moveTo: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.moveTo\");var r=this.ctx.transform.applyToPoint(new c(t,e));this.path.push({type:\"mt\",x:r.x,y:r.y}),this.ctx.lastPoint=new c(t,e)},p.prototype.closePath=function(){var t=new c(0,0),r=0;for(r=this.path.length-1;-1!==r;r--)if(\"begin\"===this.path[r].type&&\"object\"===e(this.path[r+1])&&\"number\"==typeof this.path[r+1].x){t=new c(this.path[r+1].x,this.path[r+1].y);break}this.path.push({type:\"close\"}),this.ctx.lastPoint=new c(t.x,t.y)},p.prototype.lineTo=function(t,e){if(isNaN(t)||isNaN(e))throw i.error(\"jsPDF.context2d.lineTo: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.lineTo\");var r=this.ctx.transform.applyToPoint(new c(t,e));this.path.push({type:\"lt\",x:r.x,y:r.y}),this.ctx.lastPoint=new c(r.x,r.y)},p.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),A.call(this,null,!0)},p.prototype.quadraticCurveTo=function(t,e,r,n){if(isNaN(r)||isNaN(n)||isNaN(t)||isNaN(e))throw i.error(\"jsPDF.context2d.quadraticCurveTo: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.quadraticCurveTo\");var a=this.ctx.transform.applyToPoint(new c(r,n)),o=this.ctx.transform.applyToPoint(new c(t,e));this.path.push({type:\"qct\",x1:o.x,y1:o.y,x:a.x,y:a.y}),this.ctx.lastPoint=new c(a.x,a.y)},p.prototype.bezierCurveTo=function(t,e,r,n,a,o){if(isNaN(a)||isNaN(o)||isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n))throw i.error(\"jsPDF.context2d.bezierCurveTo: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.bezierCurveTo\");var s=this.ctx.transform.applyToPoint(new c(a,o)),u=this.ctx.transform.applyToPoint(new c(t,e)),l=this.ctx.transform.applyToPoint(new c(r,n));this.path.push({type:\"bct\",x1:u.x,y1:u.y,x2:l.x,y2:l.y,x:s.x,y:s.y}),this.ctx.lastPoint=new c(s.x,s.y)},p.prototype.arc=function(t,e,r,n,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(a))throw i.error(\"jsPDF.context2d.arc: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.arc\");if(o=Boolean(o),!this.ctx.transform.isIdentity){var s=this.ctx.transform.applyToPoint(new c(t,e));t=s.x,e=s.y;var u=this.ctx.transform.applyToPoint(new c(0,r)),l=this.ctx.transform.applyToPoint(new c(0,0));r=Math.sqrt(Math.pow(u.x-l.x,2)+Math.pow(u.y-l.y,2))}Math.abs(a-n)>=2*Math.PI&&(n=0,a=2*Math.PI),this.path.push({type:\"arc\",x:t,y:e,radius:r,startAngle:n,endAngle:a,counterclockwise:o})},p.prototype.arcTo=function(t,e,r,n,i){throw new Error(\"arcTo not implemented.\")},p.prototype.rect=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n))throw i.error(\"jsPDF.context2d.rect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.rect\");this.moveTo(t,e),this.lineTo(t+r,e),this.lineTo(t+r,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.lineTo(t+r,e),this.lineTo(t,e)},p.prototype.fillRect=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n))throw i.error(\"jsPDF.context2d.fillRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.fillRect\");if(!m.call(this)){var a={};\"butt\"!==this.lineCap&&(a.lineCap=this.lineCap,this.lineCap=\"butt\"),\"miter\"!==this.lineJoin&&(a.lineJoin=this.lineJoin,this.lineJoin=\"miter\"),this.beginPath(),this.rect(t,e,r,n),this.fill(),a.hasOwnProperty(\"lineCap\")&&(this.lineCap=a.lineCap),a.hasOwnProperty(\"lineJoin\")&&(this.lineJoin=a.lineJoin)}},p.prototype.strokeRect=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n))throw i.error(\"jsPDF.context2d.strokeRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.strokeRect\");v.call(this)||(this.beginPath(),this.rect(t,e,r,n),this.stroke())},p.prototype.clearRect=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n))throw i.error(\"jsPDF.context2d.clearRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.clearRect\");this.ignoreClearRect||(this.fillStyle=\"#ffffff\",this.fillRect(t,e,r,n))},p.prototype.save=function(t){t=\"boolean\"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,r=0;r<this.pdf.internal.getNumberOfPages();r++)this.pdf.setPage(r+1),this.pdf.internal.out(\"q\");if(this.pdf.setPage(e),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var n=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=n}},p.prototype.restore=function(t){t=\"boolean\"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,r=0;r<this.pdf.internal.getNumberOfPages();r++)this.pdf.setPage(r+1),this.pdf.internal.out(\"Q\");this.pdf.setPage(e),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},p.prototype.toDataURL=function(){throw new Error(\"toDataUrl not implemented.\")};var g=function(t){var e,r,n,i;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*0+\\s*\\)/.test(t))e=0,r=0,n=0,i=0;else{var a=/rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/.exec(t);if(null!==a)e=parseInt(a[1]),r=parseInt(a[2]),n=parseInt(a[3]),i=1;else if(null!==(a=/rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*([\\d.]+)\\s*\\)/.exec(t)))e=parseInt(a[1]),r=parseInt(a[2]),n=parseInt(a[3]),i=parseFloat(a[4]);else{if(i=1,\"string\"==typeof t&&\"#\"!==t.charAt(0)){var o=new h(t);t=o.ok?o.toHex():\"#000000\"}4===t.length?(e=t.substring(1,2),e+=e,r=t.substring(2,3),r+=r,n=t.substring(3,4),n+=n):(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7)),e=parseInt(e,16),r=parseInt(r,16),n=parseInt(n,16)}}return{r:e,g:r,b:n,a:i,style:t}},m=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},v=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};p.prototype.fillText=function(t,e,r,n){if(isNaN(e)||isNaN(r)||\"string\"!=typeof t)throw i.error(\"jsPDF.context2d.fillText: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.fillText\");if(n=isNaN(n)?void 0:n,!m.call(this)){var a=q(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;C.call(this,{text:t,x:e,y:r,scale:o,angle:a,align:this.textAlign,maxWidth:n})}},p.prototype.strokeText=function(t,e,r,n){if(isNaN(e)||isNaN(r)||\"string\"!=typeof t)throw i.error(\"jsPDF.context2d.strokeText: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.strokeText\");if(!v.call(this)){n=isNaN(n)?void 0:n;var a=q(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;C.call(this,{text:t,x:e,y:r,scale:o,renderingMode:\"stroke\",angle:a,align:this.textAlign,maxWidth:n})}},p.prototype.measureText=function(t){if(\"string\"!=typeof t)throw i.error(\"jsPDF.context2d.measureText: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.measureText\");var e=this.pdf,r=this.pdf.internal.scaleFactor,n=e.internal.getFontSize(),a=e.getStringUnitWidth(t)*n/e.internal.scaleFactor,o=function(t){var e=(t=t||{}).width||0;return Object.defineProperty(this,\"width\",{get:function(){return e}}),this};return new o({width:a*=Math.round(96*r/72*1e4)/1e4})},p.prototype.scale=function(t,e){if(isNaN(t)||isNaN(e))throw i.error(\"jsPDF.context2d.scale: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.scale\");var r=new l(t,0,0,e,0,0);this.ctx.transform=this.ctx.transform.multiply(r)},p.prototype.rotate=function(t){if(isNaN(t))throw i.error(\"jsPDF.context2d.rotate: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.rotate\");var e=new l(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(e)},p.prototype.translate=function(t,e){if(isNaN(t)||isNaN(e))throw i.error(\"jsPDF.context2d.translate: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.translate\");var r=new l(1,0,0,1,t,e);this.ctx.transform=this.ctx.transform.multiply(r)},p.prototype.transform=function(t,e,r,n,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(a)||isNaN(o))throw i.error(\"jsPDF.context2d.transform: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.transform\");var s=new l(t,e,r,n,a,o);this.ctx.transform=this.ctx.transform.multiply(s)},p.prototype.setTransform=function(t,e,r,n,i,a){t=isNaN(t)?1:t,e=isNaN(e)?0:e,r=isNaN(r)?0:r,n=isNaN(n)?1:n,i=isNaN(i)?0:i,a=isNaN(a)?0:a,this.ctx.transform=new l(t,e,r,n,i,a)};var b=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};p.prototype.drawImage=function(t,e,r,n,i,a,o,s,c){var h=this.pdf.getImageProperties(t),f=1,d=1,p=1,g=1;void 0!==n&&void 0!==s&&(p=s/n,g=c/i,f=h.width/n*s/n,d=h.height/i*c/i),void 0===a&&(a=e,o=r,e=0,r=0),void 0!==n&&void 0===s&&(s=n,c=i),void 0===n&&void 0===s&&(s=h.width,c=h.height);for(var m,v=this.ctx.transform.decompose(),w=q(v.rotate.shx),A=new l,S=(A=(A=(A=A.multiply(v.translate)).multiply(v.skew)).multiply(v.scale)).applyToRectangle(new u(a-e*p,o-r*g,n*f,i*d)),_=y.call(this,S),P=[],k=0;k<_.length;k+=1)-1===P.indexOf(_[k])&&P.push(_[k]);if(L(P),this.autoPaging)for(var F=P[0],I=P[P.length-1],C=F;C<I+1;C++){this.pdf.setPage(C);var j=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],O=1===C?this.posY+this.margin[0]:this.margin[0],B=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],M=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],E=1===C?0:B+(C-2)*M;if(0!==this.ctx.clip_path.length){var D=this.path;m=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=N(m,this.posX+this.margin[3],-E+O+this.ctx.prevPageLastElemOffset),x.call(this,\"fill\",!0),this.path=D}var R=JSON.parse(JSON.stringify(S));R=N([R],this.posX+this.margin[3],-E+O+this.ctx.prevPageLastElemOffset)[0];var T=(C>F||C<I)&&b.call(this);T&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],j,M,null).clip().discardPath()),this.pdf.addImage(t,\"JPEG\",R.x,R.y,R.w,R.h,null,null,w),T&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(t,\"JPEG\",S.x,S.y,S.w,S.h,null,null,w)};var y=function(t,e,r){var n=[];e=e||this.pdf.internal.pageSize.width,r=r||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var i=this.posY+this.ctx.prevPageLastElemOffset;switch(t.type){default:case\"mt\":case\"lt\":n.push(Math.floor((t.y+i)/r)+1);break;case\"arc\":n.push(Math.floor((t.y+i-t.radius)/r)+1),n.push(Math.floor((t.y+i+t.radius)/r)+1);break;case\"qct\":var a=D(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);n.push(Math.floor((a.y+i)/r)+1),n.push(Math.floor((a.y+a.h+i)/r)+1);break;case\"bct\":var o=R(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);n.push(Math.floor((o.y+i)/r)+1),n.push(Math.floor((o.y+o.h+i)/r)+1);break;case\"rect\":n.push(Math.floor((t.y+i)/r)+1),n.push(Math.floor((t.y+t.h+i)/r)+1)}for(var s=0;s<n.length;s+=1)for(;this.pdf.internal.getNumberOfPages()<n[s];)w.call(this);return n},w=function(){var t=this.fillStyle,e=this.strokeStyle,r=this.font,n=this.lineCap,i=this.lineWidth,a=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=e,this.font=r,this.lineCap=n,this.lineWidth=i,this.lineJoin=a},N=function(t,e,r){for(var n=0;n<t.length;n++)switch(t[n].type){case\"bct\":t[n].x2+=e,t[n].y2+=r;case\"qct\":t[n].x1+=e,t[n].y1+=r;case\"mt\":case\"lt\":case\"arc\":default:t[n].x+=e,t[n].y+=r}return t},L=function(t){return t.sort((function(t,e){return t-e}))},A=function(t,e){for(var r,n,i=this.fillStyle,a=this.strokeStyle,o=this.lineCap,s=this.lineWidth,c=Math.abs(s*this.ctx.transform.scaleX),u=this.lineJoin,l=JSON.parse(JSON.stringify(this.path)),h=JSON.parse(JSON.stringify(this.path)),f=[],d=0;d<h.length;d++)if(void 0!==h[d].x)for(var p=y.call(this,h[d]),g=0;g<p.length;g+=1)-1===f.indexOf(p[g])&&f.push(p[g]);for(var m=0;m<f.length;m++)for(;this.pdf.internal.getNumberOfPages()<f[m];)w.call(this);if(L(f),this.autoPaging)for(var v=f[0],A=f[f.length-1],S=v;S<A+1;S++){this.pdf.setPage(S),this.fillStyle=i,this.strokeStyle=a,this.lineCap=o,this.lineWidth=c,this.lineJoin=u;var _=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],P=1===S?this.posY+this.margin[0]:this.margin[0],k=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],F=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],I=1===S?0:k+(S-2)*F;if(0!==this.ctx.clip_path.length){var C=this.path;r=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=N(r,this.posX+this.margin[3],-I+P+this.ctx.prevPageLastElemOffset),x.call(this,t,!0),this.path=C}if(n=JSON.parse(JSON.stringify(l)),this.path=N(n,this.posX+this.margin[3],-I+P+this.ctx.prevPageLastElemOffset),!1===e||0===S){var j=(S>v||S<A)&&b.call(this);j&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],_,F,null).clip().discardPath()),x.call(this,t,e),j&&this.pdf.restoreGraphicsState()}this.lineWidth=s}else this.lineWidth=c,x.call(this,t,e),this.lineWidth=s;this.path=l},x=function(t,e){if((\"stroke\"!==t||e||!v.call(this))&&(\"stroke\"===t||e||!m.call(this))){for(var r,n,i=[],a=this.path,o=0;o<a.length;o++){var s=a[o];switch(s.type){case\"begin\":i.push({begin:!0});break;case\"close\":i.push({close:!0});break;case\"mt\":i.push({start:s,deltas:[],abs:[]});break;case\"lt\":var c=i.length;if(a[o-1]&&!isNaN(a[o-1].x)&&(r=[s.x-a[o-1].x,s.y-a[o-1].y],c>0))for(;c>=0;c--)if(!0!==i[c-1].close&&!0!==i[c-1].begin){i[c-1].deltas.push(r),i[c-1].abs.push(s);break}break;case\"bct\":r=[s.x1-a[o-1].x,s.y1-a[o-1].y,s.x2-a[o-1].x,s.y2-a[o-1].y,s.x-a[o-1].x,s.y-a[o-1].y],i[i.length-1].deltas.push(r);break;case\"qct\":var u=a[o-1].x+2/3*(s.x1-a[o-1].x),l=a[o-1].y+2/3*(s.y1-a[o-1].y),h=s.x+2/3*(s.x1-s.x),f=s.y+2/3*(s.y1-s.y),d=s.x,p=s.y;r=[u-a[o-1].x,l-a[o-1].y,h-a[o-1].x,f-a[o-1].y,d-a[o-1].x,p-a[o-1].y],i[i.length-1].deltas.push(r);break;case\"arc\":i.push({deltas:[],abs:[],arc:!0}),Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(s)}}n=e?null:\"stroke\"===t?\"stroke\":\"fill\";for(var g=!1,b=0;b<i.length;b++)if(i[b].arc)for(var y=i[b].abs,w=0;w<y.length;w++){var N=y[w];\"arc\"===N.type?P.call(this,N.x,N.y,N.radius,N.startAngle,N.endAngle,N.counterclockwise,void 0,e,!g):j.call(this,N.x,N.y),g=!0}else if(!0===i[b].close)this.pdf.internal.out(\"h\"),g=!1;else if(!0!==i[b].begin){var L=i[b].start.x,A=i[b].start.y;O.call(this,i[b].deltas,L,A),g=!0}n&&k.call(this,n),e&&F.call(this)}},S=function(t){var e=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,r=e*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case\"bottom\":return t-r;case\"top\":return t+e-r;case\"hanging\":return t+e-2*r;case\"middle\":return t+e/2-r;case\"ideographic\":return t;case\"alphabetic\":default:return t}},_=function(t){return t+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};p.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,e){this.colorStops.push([t,e])},t.getColor=function(){return 0===this.colorStops.length?\"#000000\":this.colorStops[0][1]},t.isCanvasGradient=!0,t},p.prototype.createPattern=function(){return this.createLinearGradient()},p.prototype.createRadialGradient=function(){return this.createLinearGradient()};var P=function(t,e,r,n,i,a,o,s,c){for(var u=M.call(this,r,n,i,a),l=0;l<u.length;l++){var h=u[l];0===l&&(c?I.call(this,h.x1+t,h.y1+e):j.call(this,h.x1+t,h.y1+e)),B.call(this,t,e,h.x2,h.y2,h.x3,h.y3,h.x4,h.y4)}s?F.call(this):k.call(this,o)},k=function(t){switch(t){case\"stroke\":this.pdf.internal.out(\"S\");break;case\"fill\":this.pdf.internal.out(\"f\")}},F=function(){this.pdf.clip(),this.pdf.discardPath()},I=function(t,e){this.pdf.internal.out(n(t)+\" \"+a(e)+\" m\")},C=function(t){var e;switch(t.align){case\"right\":case\"end\":e=\"right\";break;case\"center\":e=\"center\";break;case\"left\":case\"start\":default:e=\"left\"}var r=this.pdf.getTextDimensions(t.text),n=S.call(this,t.y),i=_.call(this,n)-r.h,a=this.ctx.transform.applyToPoint(new c(t.x,n)),o=this.ctx.transform.decompose(),s=new l;s=(s=(s=s.multiply(o.translate)).multiply(o.skew)).multiply(o.scale);for(var h,f,d,p=this.ctx.transform.applyToRectangle(new u(t.x,n,r.w,r.h)),g=s.applyToRectangle(new u(t.x,i,r.w,r.h)),m=y.call(this,g),v=[],w=0;w<m.length;w+=1)-1===v.indexOf(m[w])&&v.push(m[w]);if(L(v),this.autoPaging)for(var A=v[0],P=v[v.length-1],k=A;k<P+1;k++){this.pdf.setPage(k);var F=1===k?this.posY+this.margin[0]:this.margin[0],I=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],C=this.pdf.internal.pageSize.height-this.margin[2],j=C-this.margin[0],O=this.pdf.internal.pageSize.width-this.margin[1],B=O-this.margin[3],M=1===k?0:I+(k-2)*j;if(0!==this.ctx.clip_path.length){var E=this.path;h=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=N(h,this.posX+this.margin[3],-1*M+F),x.call(this,\"fill\",!0),this.path=E}var q=N([JSON.parse(JSON.stringify(g))],this.posX+this.margin[3],-M+F+this.ctx.prevPageLastElemOffset)[0];t.scale>=.01&&(f=this.pdf.internal.getFontSize(),this.pdf.setFontSize(f*t.scale),d=this.lineWidth,this.lineWidth=d*t.scale);var D=\"text\"!==this.autoPaging;if(D||q.y+q.h<=C){if(D||q.y>=F&&q.x<=O){var R=D?t.text:this.pdf.splitTextToSize(t.text,t.maxWidth||O-q.x)[0],T=N([JSON.parse(JSON.stringify(p))],this.posX+this.margin[3],-M+F+this.ctx.prevPageLastElemOffset)[0],U=D&&(k>A||k<P)&&b.call(this);U&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],B,j,null).clip().discardPath()),this.pdf.text(R,T.x,T.y,{angle:t.angle,align:e,renderingMode:t.renderingMode}),U&&this.pdf.restoreGraphicsState()}}else q.y<C&&(this.ctx.prevPageLastElemOffset+=C-q.y);t.scale>=.01&&(this.pdf.setFontSize(f),this.lineWidth=d)}else t.scale>=.01&&(f=this.pdf.internal.getFontSize(),this.pdf.setFontSize(f*t.scale),d=this.lineWidth,this.lineWidth=d*t.scale),this.pdf.text(t.text,a.x+this.posX,a.y+this.posY,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),t.scale>=.01&&(this.pdf.setFontSize(f),this.lineWidth=d)},j=function(t,e,r,i){r=r||0,i=i||0,this.pdf.internal.out(n(t+r)+\" \"+a(e+i)+\" l\")},O=function(t,e,r){return this.pdf.lines(t,e,r,null,null)},B=function(t,e,n,i,a,c,u,l){this.pdf.internal.out([r(o(n+t)),r(s(i+e)),r(o(a+t)),r(s(c+e)),r(o(u+t)),r(s(l+e)),\"c\"].join(\" \"))},M=function(t,e,r,n){for(var i=2*Math.PI,a=Math.PI/2;e>r;)e-=i;var o=Math.abs(r-e);o<i&&n&&(o=i-o);for(var s=[],c=n?-1:1,u=e;o>1e-5;){var l=u+c*Math.min(o,a);s.push(E.call(this,t,u,l)),o-=Math.abs(l-u),u=l}return s},E=function(t,e,r){var n=(r-e)/2,i=t*Math.cos(n),a=t*Math.sin(n),o=i,s=-a,c=o*o+s*s,u=c+o*i+s*a,l=4/3*(Math.sqrt(2*c*u)-u)/(o*a-s*i),h=o-l*s,f=s+l*o,d=h,p=-f,g=n+e,m=Math.cos(g),v=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:h*m-f*v,y2:h*v+f*m,x3:d*m-p*v,y3:d*v+p*m,x4:t*Math.cos(r),y4:t*Math.sin(r)}},q=function(t){return 180*t/Math.PI},D=function(t,e,r,n,i,a){var o=t+.5*(r-t),s=e+.5*(n-e),c=i+.5*(r-i),l=a+.5*(n-a),h=Math.min(t,i,o,c),f=Math.max(t,i,o,c),d=Math.min(e,a,s,l),p=Math.max(e,a,s,l);return new u(h,d,f-h,p-d)},R=function(t,e,r,n,i,a,o,s){var c,l,h,f,d,p,g,m,v,b,y,w,N,L,A=r-t,x=n-e,S=i-r,_=a-n,P=o-i,k=s-a;for(l=0;l<41;l++)v=(g=(h=t+(c=l/40)*A)+c*((d=r+c*S)-h))+c*(d+c*(i+c*P-d)-g),b=(m=(f=e+c*x)+c*((p=n+c*_)-f))+c*(p+c*(a+c*k-p)-m),0==l?(y=v,w=b,N=v,L=b):(y=Math.min(y,v),w=Math.min(w,b),N=Math.max(N,v),L=Math.max(L,b));return new u(Math.round(y),Math.round(w),Math.round(N-y),Math.round(L-w))},T=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var t,e,r=(t=this.ctx.lineDash,e=this.ctx.lineDashOffset,JSON.stringify({lineDash:t,lineDashOffset:e}));this.prevLineDash!==r&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=r)}}}(M.API);try{require(\"worker_threads\").Worker}catch(t){}var Ut=Uint8Array,zt=Uint16Array,Ht=Uint32Array,Wt=new Ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vt=new Ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Gt=new Ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Yt=function(t,e){for(var r=new zt(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new Ht(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)i[a]=a-r[n]<<5|n;return[r,i]},Jt=Yt(Wt,2),Xt=Jt[0],Kt=Jt[1];Xt[28]=258,Kt[258]=28;for(var Zt=Yt(Vt,0),$t=Zt[0],Qt=Zt[1],te=new zt(32768),ee=0;ee<32768;++ee){var re=(43690&ee)>>>1|(21845&ee)<<1;re=(61680&(re=(52428&re)>>>2|(13107&re)<<2))>>>4|(3855&re)<<4,te[ee]=((65280&re)>>>8|(255&re)<<8)>>>1}var ne=function(t,e,r){for(var n=t.length,i=0,a=new zt(e);i<n;++i)++a[t[i]-1];var o,s=new zt(e);for(i=0;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;if(r){o=new zt(1<<e);var c=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],l=e-t[i],h=s[t[i]-1]++<<l,f=h|(1<<l)-1;h<=f;++h)o[te[h]>>>c]=u}else for(o=new zt(n),i=0;i<n;++i)o[i]=te[s[t[i]-1]++]>>>15-t[i];return o},ie=new Ut(288);for(ee=0;ee<144;++ee)ie[ee]=8;for(ee=144;ee<256;++ee)ie[ee]=9;for(ee=256;ee<280;++ee)ie[ee]=7;for(ee=280;ee<288;++ee)ie[ee]=8;var ae=new Ut(32);for(ee=0;ee<32;++ee)ae[ee]=5;var oe=ne(ie,9,0),se=ne(ie,9,1),ce=ne(ae,5,0),ue=ne(ae,5,1),le=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},he=function(t,e,r){var n=e/8>>0;return(t[n]|t[n+1]<<8)>>>(7&e)&r},fe=function(t,e){var r=e/8>>0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>>(7&e)},de=function(t){return(t/8>>0)+(7&t&&1)},pe=function(t,e,r){(null==e||e<0)&&(e=0),(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof zt?zt:t instanceof Ht?Ht:Ut)(r-e);return n.set(t.subarray(e,r)),n},ge=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},me=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},ve=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,a=r.slice();if(!i)return[new Ut(0),0];if(1==i){var o=new Ut(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var s=r[0],c=r[1],u=0,l=1,h=2;for(r[0]={s:-1,f:s.f+c.f,l:s,r:c};l!=i-1;)s=r[r[u].f<r[h].f?u++:h++],c=r[u!=l&&r[u].f<r[h].f?u++:h++],r[l++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(n=1;n<i;++n)a[n].s>f&&(f=a[n].s);var d=new zt(f+1),p=be(r[l-1],d,0);if(p>e){n=0;var g=0,m=p-e,v=1<<m;for(a.sort((function(t,e){return d[e.s]-d[t.s]||t.f-e.f}));n<i;++n){var b=a[n].s;if(!(d[b]>e))break;g+=v-(1<<p-d[b]),d[b]=e}for(g>>>=m;g>0;){var y=a[n].s;d[y]<e?g-=1<<e-d[y]++-1:++n}for(;n>=0&&g;--n){var w=a[n].s;d[w]==e&&(--d[w],++g)}p=e}return[new Ut(d),p]},be=function(t,e,r){return-1==t.s?Math.max(be(t.l,e,r+1),be(t.r,e,r+1)):e[t.s]=r},ye=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new zt(++e),n=0,i=t[0],a=1,o=function(t){r[n++]=t},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return[r.subarray(0,n),e]},we=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},Ne=function(t,e,r){var n=r.length,i=de(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<n;++a)t[i+a+4]=r[a];return 8*(i+4+n)},Le=function(t,e,r,n,i,a,o,s,c,u,l){ge(e,l++,r),++i[256];for(var h=ve(i,15),f=h[0],d=h[1],p=ve(a,15),g=p[0],m=p[1],v=ye(f),b=v[0],y=v[1],w=ye(g),N=w[0],L=w[1],A=new zt(19),x=0;x<b.length;++x)A[31&b[x]]++;for(x=0;x<N.length;++x)A[31&N[x]]++;for(var S=ve(A,7),_=S[0],P=S[1],k=19;k>4&&!_[Gt[k-1]];--k);var F,I,C,j,O=u+5<<3,B=we(i,ie)+we(a,ae)+o,M=we(i,f)+we(a,g)+o+14+3*k+we(A,_)+(2*A[16]+3*A[17]+7*A[18]);if(O<=B&&O<=M)return Ne(e,l,t.subarray(c,c+u));if(ge(e,l,1+(M<B)),l+=2,M<B){F=ne(f,d,0),I=f,C=ne(g,m,0),j=g;var E=ne(_,P,0);ge(e,l,y-257),ge(e,l+5,L-1),ge(e,l+10,k-4),l+=14;for(x=0;x<k;++x)ge(e,l+3*x,_[Gt[x]]);l+=3*k;for(var q=[b,N],D=0;D<2;++D){var R=q[D];for(x=0;x<R.length;++x){var T=31&R[x];ge(e,l,E[T]),l+=_[T],T>15&&(ge(e,l,R[x]>>>5&127),l+=R[x]>>>12)}}}else F=oe,I=ie,C=ce,j=ae;for(x=0;x<s;++x)if(n[x]>255){T=n[x]>>>18&31;me(e,l,F[T+257]),l+=I[T+257],T>7&&(ge(e,l,n[x]>>>23&31),l+=Wt[T]);var U=31&n[x];me(e,l,C[U]),l+=j[U],U>3&&(me(e,l,n[x]>>>5&8191),l+=Vt[U])}else me(e,l,F[n[x]]),l+=I[n[x]];return me(e,l,F[256]),l+I[256]},Ae=new Ht([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xe=new Ut(0),Se=function(t,e,r,n,i){return function(t,e,r,n,i,a){var o=t.length,s=new Ut(n+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(n,s.length-i),u=0;if(!e||o<8)for(var l=0;l<=o;l+=65535){var h=l+65535;h<o?u=Ne(c,u,t.subarray(l,h)):(c[l]=a,u=Ne(c,u,t.subarray(l,o)))}else{for(var f=Ae[e-1],d=f>>>13,p=8191&f,g=(1<<r)-1,m=new zt(32768),v=new zt(g+1),b=Math.ceil(r/3),y=2*b,w=function(e){return(t[e]^t[e+1]<<b^t[e+2]<<y)&g},N=new Ht(25e3),L=new zt(288),A=new zt(32),x=0,S=0,_=(l=0,0),P=0,k=0;l<o;++l){var F=w(l),I=32767&l,C=v[F];if(m[I]=C,v[F]=I,P<=l){var j=o-l;if((x>7e3||_>24576)&&j>423){u=Le(t,c,0,N,L,A,S,_,k,l-k,u),_=x=S=0,k=l;for(var O=0;O<286;++O)L[O]=0;for(O=0;O<30;++O)A[O]=0}var B=2,M=0,E=p,q=I-C&32767;if(j>2&&F==w(l-q))for(var D=Math.min(d,j)-1,R=Math.min(32767,l),T=Math.min(258,j);q<=R&&--E&&I!=C;){if(t[l+B]==t[l+B-q]){for(var U=0;U<T&&t[l+U]==t[l+U-q];++U);if(U>B){if(B=U,M=q,U>D)break;var z=Math.min(q,U-2),H=0;for(O=0;O<z;++O){var W=l-q+O+32768&32767,V=W-m[W]+32768&32767;V>H&&(H=V,C=W)}}}q+=(I=C)-(C=m[I])+32768&32767}if(M){N[_++]=268435456|Kt[B]<<18|Qt[M];var G=31&Kt[B],Y=31&Qt[M];S+=Wt[G]+Vt[Y],++L[257+G],++A[Y],P=l+B,++x}else N[_++]=t[l],++L[t[l]]}}u=Le(t,c,a,N,L,A,S,_,k,l-k,u),a||(u=Ne(c,u,xe))}return pe(s,0,n+de(u)+i)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,n,!i)};function _e(t,e){void 0===e&&(e={});var r=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,a=r.length,o=0;o!=a;){for(var s=Math.min(o+5552,a);o<s;++o)i+=n+=r[o];n%=65521,i%=65521}t=n,e=i},d:function(){return(t>>>8<<16|(255&e)<<8|e>>>8)+2*((255&t)<<23)}}}();r.p(t);var n=Se(t,e,2,4);return function(t,e){var r=e.level,n=0==r?0:r<6?1:9==r?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)}(n,e),function(t,e,r){for(;r;++e)t[e]=r,r>>>=8}(n,n.length-4,r.d()),n}function Pe(t,e){return function(t,e,r){var n=t.length,i=!e||r,a=!r||r.i;r||(r={}),e||(e=new Ut(3*n));var o=function(t){var r=e.length;if(t>r){var n=new Ut(Math.max(2*r,t));n.set(e),e=n}},s=r.f||0,c=r.p||0,u=r.b||0,l=r.l,h=r.d,f=r.m,d=r.n,p=8*n;do{if(!l){r.f=s=he(t,c,1);var g=he(t,c+1,3);if(c+=3,!g){var m=t[(P=de(c)+4)-4]|t[P-3]<<8,v=P+m;if(v>n){if(a)throw\"unexpected EOF\";break}i&&o(u+m),e.set(t.subarray(P,v),u),r.b=u+=m,r.p=c=8*v;continue}if(1==g)l=se,h=ue,f=9,d=5;else{if(2!=g)throw\"invalid block type\";var b=he(t,c,31)+257,y=he(t,c+10,15)+4,w=b+he(t,c+5,31)+1;c+=14;for(var N=new Ut(w),L=new Ut(19),A=0;A<y;++A)L[Gt[A]]=he(t,c+3*A,7);c+=3*y;var x=le(L),S=(1<<x)-1;if(!a&&c+w*(x+7)>p)break;var _=ne(L,x,1);for(A=0;A<w;){var P,k=_[he(t,c,S)];if(c+=15&k,(P=k>>>4)<16)N[A++]=P;else{var F=0,I=0;for(16==P?(I=3+he(t,c,3),c+=2,F=N[A-1]):17==P?(I=3+he(t,c,7),c+=3):18==P&&(I=11+he(t,c,127),c+=7);I--;)N[A++]=F}}var C=N.subarray(0,b),j=N.subarray(b);f=le(C),d=le(j),l=ne(C,f,1),h=ne(j,d,1)}if(c>p)throw\"unexpected EOF\"}i&&o(u+131072);for(var O=(1<<f)-1,B=(1<<d)-1,M=f+d+18;a||c+M<p;){var E=(F=l[fe(t,c)&O])>>>4;if((c+=15&F)>p)throw\"unexpected EOF\";if(!F)throw\"invalid length/literal\";if(E<256)e[u++]=E;else{if(256==E){l=null;break}var q=E-254;if(E>264){var D=Wt[A=E-257];q=he(t,c,(1<<D)-1)+Xt[A],c+=D}var R=h[fe(t,c)&B],T=R>>>4;if(!R)throw\"invalid distance\";c+=15&R;j=$t[T];if(T>3){D=Vt[T];j+=fe(t,c)&(1<<D)-1,c+=D}if(c>p)throw\"unexpected EOF\";i&&o(u+131072);for(var U=u+q;u<U;u+=4)e[u]=e[u-j],e[u+1]=e[u+1-j],e[u+2]=e[u+2-j],e[u+3]=e[u+3-j];u=U}}r.l=l,r.p=c,r.b=u,l&&(s=1,r.m=f,r.d=h,r.n=d)}while(!s);return u==e.length?e:pe(e,0,u)}((function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw\"invalid zlib data\";if(32&t[1])throw\"invalid zlib data: preset dictionaries not supported\"}(t),t.subarray(2,-4)),e)}\n /**\n    * @license\n    * jsPDF filters PlugIn\n    * Copyright (c) 2014 Aras Abbasi\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */!function(t){var e=function(t){var e,r,n,i,a,o,s,c,u,l;for(/[^\\x00-\\xFF]/.test(t),r=[],n=0,i=(t+=e=\"\\0\\0\\0\\0\".slice(t.length%4||4)).length;i>n;n+=4)0!==(a=(t.charCodeAt(n)<<24)+(t.charCodeAt(n+1)<<16)+(t.charCodeAt(n+2)<<8)+t.charCodeAt(n+3))?(o=(a=((a=((a=((a=(a-(l=a%85))/85)-(u=a%85))/85)-(c=a%85))/85)-(s=a%85))/85)%85,r.push(o+33,s+33,c+33,u+33,l+33)):r.push(122);return function(t,e){for(var r=e;r>0;r--)t.pop()}(r,e.length),String.fromCharCode.apply(String,r)+\"~>\"},r=function(t){var e,r,n,i,a,o=String,s=\"length\",c=255,u=\"charCodeAt\",l=\"slice\",h=\"replace\";for(t[l](-2),t=t[l](0,-2)[h](/\\s/g,\"\")[h](\"z\",\"!!!!!\"),n=[],i=0,a=(t+=e=\"uuuuu\"[l](t[s]%5||5))[s];a>i;i+=5)r=52200625*(t[u](i)-33)+614125*(t[u](i+1)-33)+7225*(t[u](i+2)-33)+85*(t[u](i+3)-33)+(t[u](i+4)-33),n.push(c&r>>24,c&r>>16,c&r>>8,c&r);return function(t,e){for(var r=e;r>0;r--)t.pop()}(n,e[s]),o.fromCharCode.apply(o,n)},n=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\\s/g,\"\")).indexOf(\">\")&&(t=t.substr(0,t.indexOf(\">\"))),t.length%2&&(t+=\"0\"),!1===e.test(t))return\"\";for(var r=\"\",n=0;n<t.length;n+=2)r+=String.fromCharCode(\"0x\"+(t[n]+t[n+1]));return r},i=function(t){for(var e=new Uint8Array(t.length),r=t.length;r--;)e[r]=t.charCodeAt(r);return t=(e=_e(e)).reduce((function(t,e){return t+String.fromCharCode(e)}),\"\")};t.processDataByFilters=function(t,a){var o=0,s=t||\"\",c=[];for(\"string\"==typeof(a=a||[])&&(a=[a]),o=0;o<a.length;o+=1)switch(a[o]){case\"ASCII85Decode\":case\"/ASCII85Decode\":s=r(s),c.push(\"/ASCII85Encode\");break;case\"ASCII85Encode\":case\"/ASCII85Encode\":s=e(s),c.push(\"/ASCII85Decode\");break;case\"ASCIIHexDecode\":case\"/ASCIIHexDecode\":s=n(s),c.push(\"/ASCIIHexEncode\");break;case\"ASCIIHexEncode\":case\"/ASCIIHexEncode\":s=s.split(\"\").map((function(t){return(\"0\"+t.charCodeAt().toString(16)).slice(-2)})).join(\"\")+\">\",c.push(\"/ASCIIHexDecode\");break;case\"FlateEncode\":case\"/FlateEncode\":s=i(s),c.push(\"/FlateDecode\");break;default:throw new Error('The filter: \"'+a[o]+'\" is not implemented')}return{data:s,reverseChain:c.reverse().join(\" \")}}}(M.API),\n /**\n    * @license\n    * jsPDF fileloading PlugIn\n    * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){t.loadFile=function(t,e,r){return function(t,e,r){e=!1!==e,r=\"function\"==typeof r?r:function(){};var n=void 0;try{n=function(t,e,r){var n=new XMLHttpRequest,i=0,a=function(t){var e=t.length,r=[],n=String.fromCharCode;for(i=0;i<e;i+=1)r.push(n(255&t.charCodeAt(i)));return r.join(\"\")};if(n.open(\"GET\",t,!e),n.overrideMimeType(\"text/plain; charset=x-user-defined\"),!1===e&&(n.onload=function(){200===n.status?r(a(this.responseText)):r(void 0)}),n.send(null),e&&200===n.status)return a(n.responseText)}(t,e,r)}catch(t){}return n}(t,e,r)},t.loadImageFile=t.loadFile}(M.API),function(n){function i(){return(r.html2canvas?Promise.resolve(r.html2canvas):\"object\"===(void 0===t?\"undefined\":e(t))&&\"undefined\"!=typeof module?new Promise((function(t,e){try{t(require(\"html2canvas\"))}catch(t){e(t)}})):\"function\"==typeof define&&define.amd?new Promise((function(t,e){try{require([\"html2canvas\"],t)}catch(t){e(t)}})):Promise.reject(new Error(\"Could not load html2canvas\"))).catch((function(t){return Promise.reject(new Error(\"Could not load html2canvas: \"+t))})).then((function(t){return t.default?t.default:t}))}function a(){return(r.DOMPurify?Promise.resolve(r.DOMPurify):\"object\"===(void 0===t?\"undefined\":e(t))&&\"undefined\"!=typeof module?new Promise((function(t,e){try{t(require(\"dompurify\"))}catch(t){e(t)}})):\"function\"==typeof define&&define.amd?new Promise((function(t,e){try{require([\"dompurify\"],t)}catch(t){e(t)}})):Promise.reject(new Error(\"Could not load dompurify\"))).catch((function(t){return Promise.reject(new Error(\"Could not load dompurify: \"+t))})).then((function(t){return t.default?t.default:t}))}var o=function(t){var r=e(t);return\"undefined\"===r?\"undefined\":\"string\"===r||t instanceof String?\"string\":\"number\"===r||t instanceof Number?\"number\":\"function\"===r||t instanceof Function?\"function\":t&&t.constructor===Array?\"array\":t&&1===t.nodeType?\"element\":\"object\"===r?\"object\":\"unknown\"},s=function(t,e){var r=document.createElement(t);for(var n in e.className&&(r.className=e.className),e.innerHTML&&e.dompurify&&(r.innerHTML=e.dompurify.sanitize(e.innerHTML)),e.style)r.style[n]=e.style[n];return r},c=function t(e){var r=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),n=t.convert(Promise.resolve(),r);return n=(n=n.setProgress(1,t,1,[t])).set(e)};(c.prototype=Object.create(Promise.prototype)).constructor=c,c.convert=function(t,e){return t.__proto__=e||c.prototype,t},c.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:\"file.pdf\",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:\"transparent\"}},c.prototype.from=function(t,e){return this.then((function(){switch(e=e||function(t){switch(o(t)){case\"string\":return\"string\";case\"element\":return\"canvas\"===t.nodeName.toLowerCase()?\"canvas\":\"element\";default:return\"unknown\"}}(t)){case\"string\":return this.then(a).then((function(e){return this.set({src:s(\"div\",{innerHTML:t,dompurify:e})})}));case\"element\":return this.set({src:t});case\"canvas\":return this.set({canvas:t});case\"img\":return this.set({img:t});default:return this.error(\"Unknown source type.\")}}))},c.prototype.to=function(t){switch(t){case\"container\":return this.toContainer();case\"canvas\":return this.toCanvas();case\"img\":return this.toImg();case\"pdf\":return this.toPdf();default:return this.error(\"Invalid target.\")}},c.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error(\"Cannot duplicate - no source HTML.\")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var t={position:\"relative\",display:\"inline-block\",width:(\"number\"!=typeof this.opt.width||isNaN(this.opt.width)||\"number\"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+\"px\",left:0,right:0,top:0,margin:\"auto\",backgroundColor:this.opt.backgroundColor},e=function t(e,r){for(var n=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==r&&1===i.nodeType&&\"SCRIPT\"===i.nodeName||n.appendChild(t(i,r));return 1===e.nodeType&&(\"CANVAS\"===e.nodeName?(n.width=e.width,n.height=e.height,n.getContext(\"2d\").drawImage(e,0,0)):\"TEXTAREA\"!==e.nodeName&&\"SELECT\"!==e.nodeName||(n.value=e.value),n.addEventListener(\"load\",(function(){n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft}),!0)),n}(this.prop.src,this.opt.html2canvas.javascriptEnabled);\"BODY\"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+\"px\"),this.prop.overlay=s(\"div\",{className:\"html2pdf__overlay\",style:{position:\"fixed\",overflow:\"hidden\",zIndex:1e3,left:\"-100000px\",right:0,bottom:0,top:0}}),this.prop.container=s(\"div\",{className:\"html2pdf__container\",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(s(\"div\",{style:{clear:\"both\",border:\"0 none transparent\",margin:0,padding:0,height:0}})),this.prop.container.style.float=\"none\",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position=\"relative\",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+\"px\"}))},c.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(i).then((function(t){var e=Object.assign({},this.opt.html2canvas);return delete e.onrendered,t(this.prop.container,e)})).then((function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},c.prototype.toContext2d=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(i).then((function(t){var e=this.opt.jsPDF,r=this.opt.fontFaces,n=\"number\"!=typeof this.opt.width||isNaN(this.opt.width)||\"number\"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,i=Object.assign({async:!0,allowTaint:!0,scale:n,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:\"#ffffff\",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete i.onrendered,e.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,e.context2d.posX=this.opt.x,e.context2d.posY=this.opt.y,e.context2d.margin=this.opt.margin,e.context2d.fontFaces=r,r)for(var a=0;a<r.length;++a){var o=r[a],s=o.src.find((function(t){return\"truetype\"===t.format}));s&&e.addFont(s.url,o.ref.name,o.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,e.context2d.save(!0),t(this.prop.container,i)})).then((function(t){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},c.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var t=this.prop.canvas.toDataURL(\"image/\"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement(\"img\"),this.prop.img.src=t}))},c.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},c.prototype.output=function(t,e,r){return\"img\"===(r=r||\"pdf\").toLowerCase()||\"image\"===r.toLowerCase()?this.outputImg(t,e):this.outputPdf(t,e)},c.prototype.outputPdf=function(t,e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(t,e)}))},c.prototype.outputImg=function(t){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(t){case void 0:case\"img\":return this.prop.img;case\"datauristring\":case\"dataurlstring\":return this.prop.img.src;case\"datauri\":case\"dataurl\":return document.location.href=this.prop.img.src;default:throw'Image output type \"'+t+'\" is not supported.'}}))},c.prototype.save=function(t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},c.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},c.prototype.set=function(t){if(\"object\"!==o(t))return this;var e=Object.keys(t||{}).map((function(e){if(e in c.template.prop)return function(){this.prop[e]=t[e]};switch(e){case\"margin\":return this.setMargin.bind(this,t.margin);case\"jsPDF\":return function(){return this.opt.jsPDF=t.jsPDF,this.setPageSize()};case\"pageSize\":return this.setPageSize.bind(this,t.pageSize);default:return function(){this.opt[e]=t[e]}}}),this);return this.then((function(){return this.thenList(e)}))},c.prototype.get=function(t,e){return this.then((function(){var r=t in c.template.prop?this.prop[t]:this.opt[t];return e?e(r):r}))},c.prototype.setMargin=function(t){return this.then((function(){switch(o(t)){case\"number\":t=[t,t,t,t];case\"array\":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error(\"Invalid margin array.\")}this.opt.margin=t})).then(this.setPageSize)},c.prototype.setPageSize=function(t){function e(t,e){return Math.floor(t*e/72*96)}return this.then((function(){(t=t||M.getPageSize(this.opt.jsPDF)).hasOwnProperty(\"inner\")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:e(t.inner.width,t.k),height:e(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t}))},c.prototype.setProgress=function(t,e,r,n){return null!=t&&(this.progress.val=t),null!=e&&(this.progress.state=e),null!=r&&(this.progress.n=r),null!=n&&(this.progress.stack=n),this.progress.ratio=this.progress.val/this.progress.state,this},c.prototype.updateProgress=function(t,e,r,n){return this.setProgress(t?this.progress.val+t:null,e||null,r?this.progress.n+r:null,n?this.progress.stack.concat(n):null)},c.prototype.then=function(t,e){var r=this;return this.thenCore(t,e,(function(t,e){return r.updateProgress(null,null,1,[t]),Promise.prototype.then.call(this,(function(e){return r.updateProgress(null,t),e})).then(t,e).then((function(t){return r.updateProgress(1),t}))}))},c.prototype.thenCore=function(t,e,r){r=r||Promise.prototype.then;t&&(t=t.bind(this)),e&&(e=e.bind(this));var n=-1!==Promise.toString().indexOf(\"[native code]\")&&\"Promise\"===Promise.name?this:c.convert(Object.assign({},this),Promise.prototype),i=r.call(n,t,e);return c.convert(i,this.__proto__)},c.prototype.thenExternal=function(t,e){return Promise.prototype.then.call(this,t,e)},c.prototype.thenList=function(t){var e=this;return t.forEach((function(t){e=e.thenCore(t)})),e},c.prototype.catch=function(t){t&&(t=t.bind(this));var e=Promise.prototype.catch.call(this,t);return c.convert(e,this)},c.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},c.prototype.error=function(t){return this.then((function(){throw new Error(t)}))},c.prototype.using=c.prototype.set,c.prototype.saveAs=c.prototype.save,c.prototype.export=c.prototype.output,c.prototype.run=c.prototype.then,M.getPageSize=function(t,r,n){if(\"object\"===e(t)){var i=t;t=i.orientation,r=i.unit||r,n=i.format||n}r=r||\"mm\",n=n||\"a4\",t=(\"\"+(t||\"P\")).toLowerCase();var a,o=(\"\"+n).toLowerCase(),s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],\"government-letter\":[576,756],legal:[612,1008],\"junior-legal\":[576,360],ledger:[1224,792],tabloid:[792,1224],\"credit-card\":[153,243]};switch(r){case\"pt\":a=1;break;case\"mm\":a=72/25.4;break;case\"cm\":a=72/2.54;break;case\"in\":a=72;break;case\"px\":a=.75;break;case\"pc\":case\"em\":a=12;break;case\"ex\":a=6;break;default:throw\"Invalid unit: \"+r}var c,u=0,l=0;if(s.hasOwnProperty(o))u=s[o][1]/a,l=s[o][0]/a;else try{u=n[1],l=n[0]}catch(t){throw new Error(\"Invalid format: \"+n)}if(\"p\"===t||\"portrait\"===t)t=\"p\",l>u&&(c=l,l=u,u=c);else{if(\"l\"!==t&&\"landscape\"!==t)throw\"Invalid orientation: \"+t;t=\"l\",u>l&&(c=l,l=u,u=c)}return{width:l,height:u,unit:r,k:a,orientation:t}},n.html=function(t,e){(e=e||{}).callback=e.callback||function(){},e.html2canvas=e.html2canvas||{},e.html2canvas.canvas=e.html2canvas.canvas||this.canvas,e.jsPDF=e.jsPDF||this,e.fontFaces=e.fontFaces?e.fontFaces.map(Ct):null;var r=new c(e);return e.worker?r:r.from(t).doCallback()}}(M.API),\n /**\n    * @license\n    * ====================================================================\n    * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining\n    * a copy of this software and associated documentation files (the\n    * \"Software\"), to deal in the Software without restriction, including\n    * without limitation the rights to use, copy, modify, merge, publish,\n    * distribute, sublicense, and/or sell copies of the Software, and to\n    * permit persons to whom the Software is furnished to do so, subject to\n    * the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be\n    * included in all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n    * ====================================================================\n    */\n function(t){var e,r,n;t.addJS=function(t){return n=t,this.internal.events.subscribe(\"postPutResources\",(function(){e=this.internal.newObject(),this.internal.out(\"<<\"),this.internal.out(\"/Names [(EmbeddedJS) \"+(e+1)+\" 0 R]\"),this.internal.out(\">>\"),this.internal.out(\"endobj\"),r=this.internal.newObject(),this.internal.out(\"<<\"),this.internal.out(\"/S /JavaScript\"),this.internal.out(\"/JS (\"+n+\")\"),this.internal.out(\">>\"),this.internal.out(\"endobj\")})),this.internal.events.subscribe(\"putCatalog\",(function(){void 0!==e&&void 0!==r&&this.internal.out(\"/Names <</JavaScript \"+e+\" 0 R>>\")})),this}}(M.API),\n /**\n    * @license\n    * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e;t.events.push([\"postPutResources\",function(){var t=this,r=/^(\\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var n=t.outline.render().split(/\\r\\n/),i=0;i<n.length;i++){var a=n[i],o=r.exec(a);if(null!=o){var s=o[1];t.internal.newObjectDeferredBegin(s,!1)}t.internal.write(a)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(i=0;i<c;i++){var l=t.internal.newObject();u.push(l);var h=t.internal.getPageInfo(i+1);t.internal.write(\"<< /D[\"+h.objId+\" 0 R /XYZ null null null]>> endobj\")}var f=t.internal.newObject();t.internal.write(\"<< /Names [ \");for(i=0;i<u.length;i++)t.internal.write(\"(page_\"+(i+1)+\")\"+u[i]+\" 0 R\");t.internal.write(\" ] >>\",\"endobj\"),e=t.internal.newObject(),t.internal.write(\"<< /Dests \"+f+\" 0 R\"),t.internal.write(\">>\",\"endobj\")}}]),t.events.push([\"putCatalog\",function(){this.outline.root.children.length>0&&(this.internal.write(\"/Outlines\",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write(\"/Names \"+e+\" 0 R\"))}]),t.events.push([\"initialized\",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(t,e,r){var n={title:e,options:r,children:[]};return null==t&&(t=this.root),t.children.push(n),n},t.outline.render=function(){return this.ctx={},this.ctx.val=\"\",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(e){e.id=t.internal.newObjectDeferred();for(var r=0;r<e.children.length;r++)this.genIds_r(e.children[r])},t.outline.renderRoot=function(t){this.objStart(t),this.line(\"/Type /Outlines\"),t.children.length>0&&(this.line(\"/First \"+this.makeRef(t.children[0])),this.line(\"/Last \"+this.makeRef(t.children[t.children.length-1]))),this.line(\"/Count \"+this.count_r({count:0},t)),this.objEnd()},t.outline.renderItems=function(e){for(var r=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<e.children.length;n++){var i=e.children[n];this.objStart(i),this.line(\"/Title \"+this.makeString(i.title)),this.line(\"/Parent \"+this.makeRef(e)),n>0&&this.line(\"/Prev \"+this.makeRef(e.children[n-1])),n<e.children.length-1&&this.line(\"/Next \"+this.makeRef(e.children[n+1])),i.children.length>0&&(this.line(\"/First \"+this.makeRef(i.children[0])),this.line(\"/Last \"+this.makeRef(i.children[i.children.length-1])));var a=this.count=this.count_r({count:0},i);if(a>0&&this.line(\"/Count \"+a),i.options&&i.options.pageNumber){var o=t.internal.getPageInfo(i.options.pageNumber);this.line(\"/Dest [\"+o.objId+\" 0 R /XYZ 0 \"+r(0)+\" 0]\")}this.objEnd()}for(var s=0;s<e.children.length;s++)this.renderItems(e.children[s])},t.outline.line=function(t){this.ctx.val+=t+\"\\r\\n\"},t.outline.makeRef=function(t){return t.id+\" 0 R\"},t.outline.makeString=function(e){return\"(\"+t.internal.pdfEscape(e)+\")\"},t.outline.objStart=function(t){this.ctx.val+=\"\\r\\n\"+t.id+\" 0 obj\\r\\n<<\\r\\n\"},t.outline.objEnd=function(){this.ctx.val+=\">> \\r\\nendobj\\r\\n\"},t.outline.count_r=function(t,e){for(var r=0;r<e.children.length;r++)t.count++,this.count_r(t,e.children[r]);return t.count}}])}(M.API),\n /**\n    * @license\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(t,r,n,i,a,o){var s,c=this.decode.DCT_DECODE,u=null;if(\"string\"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=a||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(s=function(t){for(var r,n=256*t.charCodeAt(4)+t.charCodeAt(5),i=t.length,a={width:0,height:0,numcomponents:1},o=4;o<i;o+=2){if(o+=n,-1!==e.indexOf(t.charCodeAt(o+1))){r=256*t.charCodeAt(o+5)+t.charCodeAt(o+6),a={width:256*t.charCodeAt(o+7)+t.charCodeAt(o+8),height:r,numcomponents:t.charCodeAt(o+9)};break}n=256*t.charCodeAt(o+2)+t.charCodeAt(o+3)}return a}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}u={data:t,width:s.width,height:s.height,colorSpace:o,bitsPerComponent:8,filter:c,index:r,alias:n}}return u}}(M.API);var ke,Fe,Ie,Ce,je,Oe=function(){var t,e,n;function i(t){var e,r,n,i,a,o,s,c,u,l,h,f,d,p;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},o=null;;){switch(e=this.readUInt32(),u=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join(\"\")){case\"IHDR\":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case\"acTL\":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case\"PLTE\":this.palette=this.read(e);break;case\"fcTL\":o&&this.animation.frames.push(o),this.pos+=4,o={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},a=this.readUInt16(),i=this.readUInt16()||100,o.delay=1e3*a/i,o.disposeOp=this.data[this.pos++],o.blendOp=this.data[this.pos++],o.data=[];break;case\"IDAT\":case\"fdAT\":for(\"fdAT\"===u&&(this.pos+=4,e-=4),t=(null!=o?o.data:void 0)||this.imgData,f=0;0<=e?f<e:f>e;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case\"tRNS\":switch(this.transparency={},this.colorType){case 3:if(n=this.palette.length/3,this.transparency.indexed=this.read(e),this.transparency.indexed.length>n)throw new Error(\"More transparent colors than palette size\");if((l=n-this.transparency.indexed.length)>0)for(d=0;0<=l?d<l:d>l;0<=l?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case\"tEXt\":s=(h=this.read(e)).indexOf(0),c=String.fromCharCode.apply(String,h.slice(0,s)),this.text[c]=String.fromCharCode.apply(String,h.slice(s+1));break;case\"IEND\":return o&&this.animation.frames.push(o),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(p=this.colorType)||6===p,r=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*r,this.colorSpace=function(){switch(this.colors){case 1:return\"DeviceGray\";case 3:return\"DeviceRGB\"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error(\"Incomplete or corrupt PNG file\")}}i.prototype.read=function(t){var e,r;for(r=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)r.push(this.data[this.pos++]);return r},i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.decodePixels=function(t){var e=this.pixelBitlength/8,r=new Uint8Array(this.width*this.height*e),n=0,i=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function a(a,o,s,c){var u,l,h,f,d,p,g,m,v,b,y,w,N,L,A,x,S,_,P,k,F,I=Math.ceil((i.width-a)/s),C=Math.ceil((i.height-o)/c),j=i.width==I&&i.height==C;for(L=e*I,w=j?r:new Uint8Array(L*C),p=t.length,N=0,l=0;N<C&&n<p;){switch(t[n++]){case 0:for(f=S=0;S<L;f=S+=1)w[l++]=t[n++];break;case 1:for(f=_=0;_<L;f=_+=1)u=t[n++],d=f<e?0:w[l-e],w[l++]=(u+d)%256;break;case 2:for(f=P=0;P<L;f=P+=1)u=t[n++],h=(f-f%e)/e,A=N&&w[(N-1)*L+h*e+f%e],w[l++]=(A+u)%256;break;case 3:for(f=k=0;k<L;f=k+=1)u=t[n++],h=(f-f%e)/e,d=f<e?0:w[l-e],A=N&&w[(N-1)*L+h*e+f%e],w[l++]=(u+Math.floor((d+A)/2))%256;break;case 4:for(f=F=0;F<L;f=F+=1)u=t[n++],h=(f-f%e)/e,d=f<e?0:w[l-e],0===N?A=x=0:(A=w[(N-1)*L+h*e+f%e],x=h&&w[(N-1)*L+(h-1)*e+f%e]),g=d+A-x,m=Math.abs(g-d),b=Math.abs(g-A),y=Math.abs(g-x),v=m<=b&&m<=y?d:b<=y?A:x,w[l++]=(u+v)%256;break;default:throw new Error(\"Invalid filter algorithm: \"+t[n-1])}if(!j){var O=((o+N*c)*i.width+a)*e,B=N*L;for(f=0;f<I;f+=1){for(var M=0;M<e;M+=1)r[O++]=w[B++];O+=(s-1)*e}}N++}}return t=Pe(t),1==i.interlaceMethod?(a(0,0,8,8),a(4,0,8,8),a(0,4,4,8),a(2,0,4,4),a(0,2,2,4),a(1,0,2,2),a(0,1,1,2)):a(0,0,1,1),r},i.prototype.decodePalette=function(){var t,e,r,n,i,a,o,s,c;for(r=this.palette,a=this.transparency.indexed||[],i=new Uint8Array((a.length||0)+r.length),n=0,t=0,e=o=0,s=r.length;o<s;e=o+=3)i[n++]=r[e],i[n++]=r[e+1],i[n++]=r[e+2],i[n++]=null!=(c=a[t++])?c:255;return i},i.prototype.copyToImageData=function(t,e){var r,n,i,a,o,s,c,u,l,h,f;if(n=this.colors,l=null,r=this.hasAlphaChannel,this.palette.length&&(l=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),n=4,r=!0),u=(i=t.data||t).length,o=l||e,a=s=0,1===n)for(;a<u;)c=l?4*e[a/4]:s,h=o[c++],i[a++]=h,i[a++]=h,i[a++]=h,i[a++]=r?o[c++]:255,s=c;else for(;a<u;)c=l?4*e[a/4]:s,i[a++]=o[c++],i[a++]=o[c++],i[a++]=o[c++],i[a++]=r?o[c++]:255,s=c},i.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var a=function(){if(\"[object Window]\"===Object.prototype.toString.call(r)){try{e=r.document.createElement(\"canvas\"),n=e.getContext(\"2d\")}catch(t){return!1}return!0}return!1};return a(),t=function(t){var r;if(!0===a())return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(r=new Image).src=e.toDataURL(),r;throw new Error(\"This method requires a Browser with Canvas-capability.\")},i.prototype.decodeFrames=function(e){var r,n,i,a,o,s,c,u;if(this.animation){for(u=[],n=o=0,s=(c=this.animation.frames).length;o<s;n=++o)r=c[n],i=e.createImageData(r.width,r.height),a=this.decodePixels(new Uint8Array(r.data)),this.copyToImageData(i,a),r.imageData=i,u.push(r.image=t(i));return u}},i.prototype.renderFrame=function(t,e){var r,n,i;return r=(n=this.animation.frames)[e],i=n[e-1],0===e&&t.clearRect(0,0,this.width,this.height),1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset),0===r.blendOp&&t.clearRect(r.xOffset,r.yOffset,r.width,r.height),t.drawImage(r.image,r.xOffset,r.yOffset)},i.prototype.animate=function(t){var e,r,n,i,a,o,s=this;return r=0,o=this.animation,i=o.numFrames,n=o.frames,a=o.numPlays,(e=function(){var o,c;if(o=r++%i,c=n[o],s.renderFrame(t,o),i>1&&r/i<a)return s.animation._timeout=setTimeout(e,c.delay)})()},i.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},i.prototype.render=function(t){var e,r;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext(\"2d\"),this.animation?(this.decodeFrames(e),this.animate(e)):(r=e.createImageData(this.width,this.height),this.copyToImageData(r,this.decodePixels()),e.putImageData(r,0,0))},i}();\n /**\n    * @license\n    *\n    * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining\n    * a copy of this software and associated documentation files (the\n    * \"Software\"), to deal in the Software without restriction, including\n    * without limitation the rights to use, copy, modify, merge, publish,\n    * distribute, sublicense, and/or sell copies of the Software, and to\n    * permit persons to whom the Software is furnished to do so, subject to\n    * the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be\n    * included in all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n    * ====================================================================\n    */\n /**\n    * @license\n    * (c) Dean McNamee <dean@gmail.com>, 2013.\n    *\n    * https://github.com/deanm/omggif\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining a copy\n    * of this software and associated documentation files (the \"Software\"), to\n    * deal in the Software without restriction, including without limitation the\n    * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n    * sell copies of the Software, and to permit persons to whom the Software is\n    * furnished to do so, subject to the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be included in\n    * all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n    * IN THE SOFTWARE.\n    *\n    * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,\n    * including animation and compression.  It does not rely on any specific\n    * underlying system, so should run in the browser, Node, or Plask.\n    */\n function Be(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error(\"Invalid GIF 87a/89a header.\");var r=t[e++]|t[e++]<<8,n=t[e++]|t[e++]<<8,i=t[e++],a=i>>7,o=1<<(7&i)+1;t[e++];t[e++];var s=null,c=null;a&&(s=e,c=o,e+=3*o);var u=!0,l=[],h=0,f=null,d=0,p=null;for(this.width=r,this.height=n;u&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,p=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((P=t[e++])>=0))throw Error(\"Invalid block size\");if(0===P)break;e+=P}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error(\"Invalid graphics extension block.\");var g=t[e++];h=t[e++]|t[e++]<<8,f=t[e++],0==(1&g)&&(f=null),d=g>>2&7,e++;break;case 254:for(;;){if(!((P=t[e++])>=0))throw Error(\"Invalid block size\");if(0===P)break;e+=P}break;default:throw new Error(\"Unknown graphic control label: 0x\"+t[e-1].toString(16))}break;case 44:var m=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,w=t[e++],N=w>>6&1,L=1<<(7&w)+1,A=s,x=c,S=!1;if(w>>7){S=!0;A=e,x=L,e+=3*L}var _=e;for(e++;;){var P;if(!((P=t[e++])>=0))throw Error(\"Invalid block size\");if(0===P)break;e+=P}l.push({x:m,y:v,width:b,height:y,has_local_palette:S,palette_offset:A,palette_size:x,data_offset:_,data_length:e-_,transparent_index:f,interlaced:!!N,delay:h,disposal:d});break;case 59:u=!1;break;default:throw new Error(\"Unknown gif block: 0x\"+t[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return p},this.frameInfo=function(t){if(t<0||t>=l.length)throw new Error(\"Frame index out of range.\");return l[t]},this.decodeAndBlitFrameBGRA=function(e,n){var i=this.frameInfo(e),a=i.width*i.height,o=new Uint8Array(a);Me(t,i.data_offset,o,a);var s=i.palette_offset,c=i.transparent_index;null===c&&(c=256);var u=i.width,l=r-u,h=u,f=4*(i.y*r+i.x),d=4*((i.y+i.height)*r+i.x),p=f,g=4*l;!0===i.interlaced&&(g+=4*r*7);for(var m=8,v=0,b=o.length;v<b;++v){var y=o[v];if(0===h&&(h=u,(p+=g)>=d&&(g=4*l+4*r*(m-1),p=f+(u+l)*(m<<1),m>>=1)),y===c)p+=4;else{var w=t[s+3*y],N=t[s+3*y+1],L=t[s+3*y+2];n[p++]=L,n[p++]=N,n[p++]=w,n[p++]=255}--h}},this.decodeAndBlitFrameRGBA=function(e,n){var i=this.frameInfo(e),a=i.width*i.height,o=new Uint8Array(a);Me(t,i.data_offset,o,a);var s=i.palette_offset,c=i.transparent_index;null===c&&(c=256);var u=i.width,l=r-u,h=u,f=4*(i.y*r+i.x),d=4*((i.y+i.height)*r+i.x),p=f,g=4*l;!0===i.interlaced&&(g+=4*r*7);for(var m=8,v=0,b=o.length;v<b;++v){var y=o[v];if(0===h&&(h=u,(p+=g)>=d&&(g=4*l+4*r*(m-1),p=f+(u+l)*(m<<1),m>>=1)),y===c)p+=4;else{var w=t[s+3*y],N=t[s+3*y+1],L=t[s+3*y+2];n[p++]=w,n[p++]=N,n[p++]=L,n[p++]=255}--h}}}function Me(t,e,r,n){for(var a=t[e++],o=1<<a,s=o+1,c=s+1,u=a+1,l=(1<<u)-1,h=0,f=0,d=0,p=t[e++],g=new Int32Array(4096),m=null;;){for(;h<16&&0!==p;)f|=t[e++]<<h,h+=8,1===p?p=t[e++]:--p;if(h<u)break;var v=f&l;if(f>>=u,h-=u,v!==o){if(v===s)break;for(var b=v<c?v:m,y=0,w=b;w>o;)w=g[w]>>8,++y;var N=w;if(d+y+(b!==v?1:0)>n)return void i.log(\"Warning, gif stream longer than expected.\");r[d++]=N;var L=d+=y;for(b!==v&&(r[d++]=N),w=b;y--;)w=g[w],r[--L]=255&w,w>>=8;null!==m&&c<4096&&(g[c++]=m<<8|N,c>=l+1&&u<12&&(++u,l=l<<1|1)),m=v}else c=s+1,l=(1<<(u=a+1))-1,m=null}return d!==n&&i.log(\"Warning, gif stream shorter than expected.\"),r}\n /**\n    * @license\n     Copyright (c) 2008, Adobe Systems Incorporated\n     All rights reserved.\n\n     Redistribution and use in source and binary forms, with or without\n     modification, are permitted provided that the following conditions are\n     met:\n\n     * Redistributions of source code must retain the above copyright notice,\n       this list of conditions and the following disclaimer.\n\n     * Redistributions in binary form must reproduce the above copyright\n       notice, this list of conditions and the following disclaimer in the\n       documentation and/or other materials provided with the distribution.\n\n     * Neither the name of Adobe Systems Incorporated nor the names of its\n       contributors may be used to endorse or promote products derived from\n       this software without specific prior written permission.\n\n     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n     IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n   */function Ee(t){var e,r,n,i,a,o=Math.floor,s=new Array(64),c=new Array(64),u=new Array(64),l=new Array(64),h=new Array(65535),f=new Array(65535),d=new Array(64),p=new Array(64),g=[],m=0,v=7,b=new Array(64),y=new Array(64),w=new Array(64),N=new Array(256),L=new Array(2048),A=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],x=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],S=[0,1,2,3,4,5,6,7,8,9,10,11],_=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],k=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],C=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function j(t,e){for(var r=0,n=0,i=new Array,a=1;a<=16;a++){for(var o=1;o<=t[a];o++)i[e[n]]=[],i[e[n]][0]=r,i[e[n]][1]=a,n++,r++;r*=2}return i}function O(t){for(var e=t[0],r=t[1]-1;r>=0;)e&1<<r&&(m|=1<<v),r--,--v<0&&(255==m?(B(255),B(0)):B(m),v=7,m=0)}function B(t){g.push(t)}function M(t){B(t>>8&255),B(255&t)}function E(t,e,r,n,i){for(var a,o=i[0],s=i[240],c=function(t,e){var r,n,i,a,o,s,c,u,l,h,f=0;for(l=0;l<8;++l){r=t[f],n=t[f+1],i=t[f+2],a=t[f+3],o=t[f+4],s=t[f+5],c=t[f+6];var p=r+(u=t[f+7]),g=r-u,m=n+c,v=n-c,b=i+s,y=i-s,w=a+o,N=a-o,L=p+w,A=p-w,x=m+b,S=m-b;t[f]=L+x,t[f+4]=L-x;var _=.707106781*(S+A);t[f+2]=A+_,t[f+6]=A-_;var P=.382683433*((L=N+y)-(S=v+g)),k=.5411961*L+P,F=1.306562965*S+P,I=.707106781*(x=y+v),C=g+I,j=g-I;t[f+5]=j+k,t[f+3]=j-k,t[f+1]=C+F,t[f+7]=C-F,f+=8}for(f=0,l=0;l<8;++l){r=t[f],n=t[f+8],i=t[f+16],a=t[f+24],o=t[f+32],s=t[f+40],c=t[f+48];var O=r+(u=t[f+56]),B=r-u,M=n+c,E=n-c,q=i+s,D=i-s,R=a+o,T=a-o,U=O+R,z=O-R,H=M+q,W=M-q;t[f]=U+H,t[f+32]=U-H;var V=.707106781*(W+z);t[f+16]=z+V,t[f+48]=z-V;var G=.382683433*((U=T+D)-(W=E+B)),Y=.5411961*U+G,J=1.306562965*W+G,X=.707106781*(H=D+E),K=B+X,Z=B-X;t[f+40]=Z+Y,t[f+24]=Z-Y,t[f+8]=K+J,t[f+56]=K-J,f++}for(l=0;l<64;++l)h=t[l]*e[l],d[l]=h>0?h+.5|0:h-.5|0;return d}(t,e),u=0;u<64;++u)p[A[u]]=c[u];var l=p[0]-r;r=p[0],0==l?O(n[0]):(O(n[f[a=32767+l]]),O(h[a]));for(var g=63;g>0&&0==p[g];)g--;if(0==g)return O(o),r;for(var m,v=1;v<=g;){for(var b=v;0==p[v]&&v<=g;)++v;var y=v-b;if(y>=16){m=y>>4;for(var w=1;w<=m;++w)O(s);y&=15}a=32767+p[v],O(i[(y<<4)+f[a]]),O(h[a]),v++}return 63!=g&&O(o),r}function q(t){(t=Math.min(Math.max(t,1),100),a!=t)&&(!function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=o((e[r]*t+50)/100);n=Math.min(Math.max(n,1),255),s[A[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var h=o((i[a]*t+50)/100);h=Math.min(Math.max(h,1),255),c[A[a]]=h}for(var f=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,p=0;p<8;p++)for(var g=0;g<8;g++)u[d]=1/(s[A[d]]*f[p]*f[g]*8),l[d]=1/(c[A[d]]*f[p]*f[g]*8),d++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t)}this.encode=function(t,a){a&&q(a),g=new Array,m=0,v=7,M(65496),M(65504),M(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),M(1),M(1),B(0),B(0),function(){M(65499),M(132),B(0);for(var t=0;t<64;t++)B(s[t]);B(1);for(var e=0;e<64;e++)B(c[e])}(),function(t,e){M(65472),M(17),B(8),M(e),M(t),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(t.width,t.height),function(){M(65476),M(418),B(0);for(var t=0;t<16;t++)B(x[t+1]);for(var e=0;e<=11;e++)B(S[e]);B(16);for(var r=0;r<16;r++)B(_[r+1]);for(var n=0;n<=161;n++)B(P[n]);B(1);for(var i=0;i<16;i++)B(k[i+1]);for(var a=0;a<=11;a++)B(F[a]);B(17);for(var o=0;o<16;o++)B(I[o+1]);for(var s=0;s<=161;s++)B(C[s])}(),M(65498),M(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var o=0,h=0,f=0;m=0,v=7,this.encode.displayName=\"_encode_\";for(var d,p,N,A,j,D,R,T,U,z=t.data,H=t.width,W=t.height,V=4*H,G=0;G<W;){for(d=0;d<V;){for(j=V*G+d,R=-1,T=0,U=0;U<64;U++)D=j+(T=U>>3)*V+(R=4*(7&U)),G+T>=W&&(D-=V*(G+1+T-W)),d+R>=V&&(D-=d+R-V+4),p=z[D++],N=z[D++],A=z[D++],b[U]=(L[p]+L[N+256>>0]+L[A+512>>0]>>16)-128,y[U]=(L[p+768>>0]+L[N+1024>>0]+L[A+1280>>0]>>16)-128,w[U]=(L[p+1280>>0]+L[N+1536>>0]+L[A+1792>>0]>>16)-128;o=E(b,u,o,e,n),h=E(y,l,h,r,i),f=E(w,l,f,r,i),d+=32}G+=8}if(v>=0){var Y=[];Y[1]=v+1,Y[0]=(1<<v+1)-1,O(Y)}return M(65497),new Uint8Array(g)},t=t||50,function(){for(var t=String.fromCharCode,e=0;e<256;e++)N[e]=t(e)}(),e=j(x,S),r=j(k,F),n=j(_,P),i=j(I,C),function(){for(var t=1,e=2,r=1;r<=15;r++){for(var n=t;n<e;n++)f[32767+n]=r,h[32767+n]=[],h[32767+n][1]=r,h[32767+n][0]=n;for(var i=-(e-1);i<=-t;i++)f[32767+i]=r,h[32767+i]=[],h[32767+i][1]=r,h[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)L[t]=19595*t,L[t+256>>0]=38470*t,L[t+512>>0]=7471*t+32768,L[t+768>>0]=-11059*t,L[t+1024>>0]=-21709*t,L[t+1280>>0]=32768*t+8421375,L[t+1536>>0]=-27439*t,L[t+1792>>0]=-5329*t}(),q(t)}\n /**\n    * @license\n    * Copyright (c) 2017 Aras Abbasi\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */function qe(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===[\"BM\",\"BA\",\"CI\",\"CP\",\"IC\",\"PT\"].indexOf(this.flag))throw new Error(\"Invalid BMP File\");this.parseHeader(),this.parseBGR()}function De(t){function e(t){if(!t)throw Error(\"assert :P\")}function r(t,e,r){for(var n=0;4>n;n++)if(t[e+n]!=r.charCodeAt(n))return!0;return!1}function n(t,e,r,n,i){for(var a=0;a<i;a++)t[e+a]=r[n+a]}function i(t,e,r,n){for(var i=0;i<n;i++)t[e+i]=r}function a(t){return new Int32Array(t)}function o(t,e){for(var r=[],n=0;n<t;n++)r.push(new e);return r}function s(t,e){var r=[];return function t(r,n,i){for(var a=i[n],o=0;o<a&&(r.push(i.length>n+1?[]:new e),!(i.length<n+1));o++)t(r[o],n+1,i)}(r,0,t),r}var c=function(){var t=this;function c(t,e){for(var r=1<<e-1>>>0;t&r;)r>>>=1;return r?(t&r-1)+r:t}function u(t,r,n,i,a){e(!(i%n));do{t[r+(i-=n)]=a}while(0<i)}function l(t,r,n,i,o){if(e(2328>=o),512>=o)var s=a(512);else if(null==(s=a(o)))return 0;return function(t,r,n,i,o,s){var l,f,d=r,p=1<<n,g=a(16),m=a(16);for(e(0!=o),e(null!=i),e(null!=t),e(0<n),f=0;f<o;++f){if(15<i[f])return 0;++g[i[f]]}if(g[0]==o)return 0;for(m[1]=0,l=1;15>l;++l){if(g[l]>1<<l)return 0;m[l+1]=m[l]+g[l]}for(f=0;f<o;++f)l=i[f],0<i[f]&&(s[m[l]++]=f);if(1==m[15])return(i=new h).g=0,i.value=s[0],u(t,d,1,p,i),p;var v,b=-1,y=p-1,w=0,N=1,L=1,A=1<<n;for(f=0,l=1,o=2;l<=n;++l,o<<=1){if(N+=L<<=1,0>(L-=g[l]))return 0;for(;0<g[l];--g[l])(i=new h).g=l,i.value=s[f++],u(t,d+w,o,A,i),w=c(w,l)}for(l=n+1,o=2;15>=l;++l,o<<=1){if(N+=L<<=1,0>(L-=g[l]))return 0;for(;0<g[l];--g[l]){if(i=new h,(w&y)!=b){for(d+=A,v=1<<(b=l)-n;15>b&&!(0>=(v-=g[b]));)++b,v<<=1;p+=A=1<<(v=b-n),t[r+(b=w&y)].g=v+n,t[r+b].value=d-r-b}i.g=l-n,i.value=s[f++],u(t,d+(w>>n),o,A,i),w=c(w,l)}}return N!=2*m[15]-1?0:p}(t,r,n,i,o,s)}function h(){this.value=this.g=0}function f(){this.value=this.g=0}function d(){this.G=o(5,h),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Dr,f)}function p(t,r,n,i){e(null!=t),e(null!=r),e(2147483648>i),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=r,t.pa=n,t.Jd=r,t.Yc=n+i,t.Zc=4<=i?n+i-4+1:n,_(t)}function g(t,e){for(var r=0;0<e--;)r|=k(t,128)<<e;return r}function m(t,e){var r=g(t,e);return P(t)?-r:r}function v(t,r,n,i){var a,o=0;for(e(null!=t),e(null!=r),e(4294967288>i),t.Sb=i,t.Ra=0,t.u=0,t.h=0,4<i&&(i=4),a=0;a<i;++a)o+=r[n+a]<<8*a;t.Ra=o,t.bb=i,t.oa=r,t.pa=n}function b(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Ur-8>>>0,++t.bb,t.u-=8;A(t)&&(t.h=1,t.u=0)}function y(t,r){if(e(0<=r),!t.h&&r<=Tr){var n=L(t)&Rr[r];return t.u+=r,b(t),n}return t.h=1,t.u=0}function w(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function N(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function L(t){return t.Ra>>>(t.u&Ur-1)>>>0}function A(t){return e(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Ur}function x(t,e){t.u=e,t.h=A(t)}function S(t){t.u>=zr&&(e(t.u>=zr),b(t))}function _(t){e(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(e(null!=t&&null!=t.oa),t.pa<t.Yc?(t.b+=8,t.I=t.oa[t.pa++]|t.I<<8):t.Ka?t.b=0:(t.I<<=8,t.b+=8,t.Ka=1))}function P(t){return g(t,1)}function k(t,e){var r=t.Ca;0>t.b&&_(t);var n=t.b,i=r*e>>>8,a=(t.I>>>n>i)+0;for(a?(r-=i,t.I-=i+1<<n>>>0):r=i+1,n=r,i=0;256<=n;)i+=8,n>>=8;return n=7^i+Hr[n],t.b-=n,t.Ca=(r<<n)-1,a}function F(t,e,r){t[e+0]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r>>0&255}function I(t,e){return t[e+0]<<0|t[e+1]<<8}function C(t,e){return I(t,e)|t[e+2]<<16}function j(t,e){return I(t,e)|I(t,e+2)<<16}function O(t,r){var n=1<<r;return e(null!=t),e(0<r),t.X=a(n),null==t.X?0:(t.Mb=32-r,t.Xa=r,1)}function B(t,r){e(null!=t),e(null!=r),e(t.Xa==r.Xa),n(r.X,0,t.X,0,1<<r.Xa)}function M(){this.X=[],this.Xa=this.Mb=0}function E(t,r,n,i){e(null!=n),e(null!=i);var a=n[0],o=i[0];return 0==a&&(a=(t*o+r/2)/r),0==o&&(o=(r*a+t/2)/t),0>=a||0>=o?0:(n[0]=a,i[0]=o,1)}function q(t,e){return t+(1<<e)-1>>>e}function D(t,e){return((4278255360&t)+(4278255360&e)>>>0&4278255360)+((16711935&t)+(16711935&e)>>>0&16711935)>>>0}function R(e,r){t[r]=function(r,n,i,a,o,s,c){var u;for(u=0;u<o;++u){var l=t[e](s[c+u-1],i,a+u);s[c+u]=D(r[n+u],l)}}}function T(){this.ud=this.hd=this.jd=0}function U(t,e){return((4278124286&(t^e))>>>1)+(t&e)>>>0}function z(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function H(t,e){return z(t+(t-e+.5>>1))}function W(t,e,r){return Math.abs(e-r)-Math.abs(t-r)}function V(t,e,r,n,i,a,o){for(n=a[o-1],r=0;r<i;++r)a[o+r]=n=D(t[e+r],n)}function G(t,e,r,n,i){var a;for(a=0;a<r;++a){var o=t[e+a],s=o>>8&255,c=16711935&(c=(c=16711935&o)+((s<<16)+s));n[i+a]=(4278255360&o)+c>>>0}}function Y(t,e){e.jd=t>>0&255,e.hd=t>>8&255,e.ud=t>>16&255}function J(t,e,r,n,i,a){var o;for(o=0;o<n;++o){var s=e[r+o],c=s>>>8,u=s,l=255&(l=(l=s>>>16)+((t.jd<<24>>24)*(c<<24>>24)>>>5));u=255&(u=(u=u+((t.hd<<24>>24)*(c<<24>>24)>>>5))+((t.ud<<24>>24)*(l<<24>>24)>>>5));i[a+o]=(4278255360&s)+(l<<16)+u}}function X(e,r,n,i,a){t[r]=function(t,e,r,n,o,s,c,u,l){for(n=c;n<u;++n)for(c=0;c<l;++c)o[s++]=a(r[i(t[e++])])},t[e]=function(e,r,o,s,c,u,l){var h=8>>e.b,f=e.Ea,d=e.K[0],p=e.w;if(8>h)for(e=(1<<e.b)-1,p=(1<<h)-1;r<o;++r){var g,m=0;for(g=0;g<f;++g)g&e||(m=i(s[c++])),u[l++]=a(d[m&p]),m>>=h}else t[\"VP8LMapColor\"+n](s,c,d,p,u,l,r,o,f)}}function K(t,e,r,n,i){for(r=e+r;e<r;){var a=t[e++];n[i++]=a>>16&255,n[i++]=a>>8&255,n[i++]=a>>0&255}}function Z(t,e,r,n,i){for(r=e+r;e<r;){var a=t[e++];n[i++]=a>>16&255,n[i++]=a>>8&255,n[i++]=a>>0&255,n[i++]=a>>24&255}}function $(t,e,r,n,i){for(r=e+r;e<r;){var a=(o=t[e++])>>16&240|o>>12&15,o=o>>0&240|o>>28&15;n[i++]=a,n[i++]=o}}function Q(t,e,r,n,i){for(r=e+r;e<r;){var a=(o=t[e++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;n[i++]=a,n[i++]=o}}function tt(t,e,r,n,i){for(r=e+r;e<r;){var a=t[e++];n[i++]=a>>0&255,n[i++]=a>>8&255,n[i++]=a>>16&255}}function et(t,e,r,i,a,o){if(0==o)for(r=e+r;e<r;)F(i,((o=t[e++])[0]>>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),a+=32;else n(i,a,t,e,r)}function rt(e,r){t[r][0]=t[e+\"0\"],t[r][1]=t[e+\"1\"],t[r][2]=t[e+\"2\"],t[r][3]=t[e+\"3\"],t[r][4]=t[e+\"4\"],t[r][5]=t[e+\"5\"],t[r][6]=t[e+\"6\"],t[r][7]=t[e+\"7\"],t[r][8]=t[e+\"8\"],t[r][9]=t[e+\"9\"],t[r][10]=t[e+\"10\"],t[r][11]=t[e+\"11\"],t[r][12]=t[e+\"12\"],t[r][13]=t[e+\"13\"],t[r][14]=t[e+\"0\"],t[r][15]=t[e+\"0\"]}function nt(t){return t==Hn||t==Wn||t==Vn||t==Gn}function it(){this.eb=[],this.size=this.A=this.fb=0}function at(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function ot(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new it,this.f.kb=new at,this.sd=null}function st(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ct(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ut(t){return alert(\"todo:WebPSamplerProcessPlane\"),t.T}function lt(t,e){var r=t.T,i=e.ba.f.RGBA,a=i.eb,o=i.fb+t.ka*i.A,s=vi[e.ba.S],c=t.y,u=t.O,l=t.f,h=t.N,f=t.ea,d=t.W,p=e.cc,g=e.dc,m=e.Mc,v=e.Nc,b=t.ka,y=t.ka+t.T,w=t.U,N=w+1>>1;for(0==b?s(c,u,null,null,l,h,f,d,l,h,f,d,a,o,null,null,w):(s(e.ec,e.fc,c,u,p,g,m,v,l,h,f,d,a,o-i.A,a,o,w),++r);b+2<y;b+=2)p=l,g=h,m=f,v=d,h+=t.Rc,d+=t.Rc,o+=2*i.A,s(c,(u+=2*t.fa)-t.fa,c,u,p,g,m,v,l,h,f,d,a,o-i.A,a,o,w);return u+=t.fa,t.j+y<t.o?(n(e.ec,e.fc,c,u,w),n(e.cc,e.dc,l,h,N),n(e.Mc,e.Nc,f,d,N),r--):1&y||s(c,u,null,null,l,h,f,d,l,h,f,d,a,o+i.A,null,null,w),r}function ht(t,r,n){var i=t.F,a=[t.J];if(null!=i){var o=t.U,s=r.ba.S,c=s==Tn||s==Vn;r=r.ba.f.RGBA;var u=[0],l=t.ka;u[0]=t.T,t.Kb&&(0==l?--u[0]:(--l,a[0]-=t.width),t.j+t.ka+t.T==t.o&&(u[0]=t.o-t.j-l));var h=r.eb;l=r.fb+l*r.A;t=Sn(i,a[0],t.width,o,u,h,l+(c?0:3),r.A),e(n==u),t&&nt(s)&&An(h,l,c,o,u,r.A)}return 0}function ft(t){var e=t.ma,r=e.ba.S,n=11>r,i=r==qn||r==Rn||r==Tn||r==Un||12==r||nt(r);if(e.memory=null,e.Ib=null,e.Jb=null,e.Nd=null,!Mr(e.Oa,t,i?11:12))return 0;if(i&&nt(r)&&br(),t.da)alert(\"todo:use_scaling\");else{if(n){if(e.Ib=ut,t.Kb){if(r=t.U+1>>1,e.memory=a(t.U+2*r),null==e.memory)return 0;e.ec=e.memory,e.fc=0,e.cc=e.ec,e.dc=e.fc+t.U,e.Mc=e.cc,e.Nc=e.dc+r,e.Ib=lt,br()}}else alert(\"todo:EmitYUV\");i&&(e.Jb=ht,n&&mr())}if(n&&!Ci){for(t=0;256>t;++t)ji[t]=89858*(t-128)+_i>>Si,Mi[t]=-22014*(t-128)+_i,Bi[t]=-45773*(t-128),Oi[t]=113618*(t-128)+_i>>Si;for(t=Pi;t<ki;++t)e=76283*(t-16)+_i>>Si,Ei[t-Pi]=Vt(e,255),qi[t-Pi]=Vt(e+8>>4,15);Ci=1}return 1}function dt(t){var r=t.ma,n=t.U,i=t.T;return e(!(1&t.ka)),0>=n||0>=i?0:(n=r.Ib(t,r),null!=r.Jb&&r.Jb(t,r,n),r.Dc+=n,1)}function pt(t){t.ma.memory=null}function gt(t,e,r,n){return 47!=y(t,8)?0:(e[0]=y(t,14)+1,r[0]=y(t,14)+1,n[0]=y(t,1),0!=y(t,3)?0:!t.h)}function mt(t,e){if(4>t)return t+1;var r=t-2>>1;return(2+(1&t)<<r)+y(e,r)+1}function vt(t,e){return 120<e?e-120:1<=(r=((r=$n[e-1])>>4)*t+(8-(15&r)))?r:1;var r}function bt(t,e,r){var n=L(r),i=t[e+=255&n].g-8;return 0<i&&(x(r,r.u+8),n=L(r),e+=t[e].value,e+=n&(1<<i)-1),x(r,r.u+t[e].g),t[e].value}function yt(t,r,n){return n.g+=t.g,n.value+=t.value<<r>>>0,e(8>=n.g),t.g}function wt(t,r,n){var i=t.xc;return e((r=0==i?0:t.vc[t.md*(n>>i)+(r>>i)])<t.Wb),t.Ya[r]}function Nt(t,r,i,a){var o=t.ab,s=t.c*r,c=t.C;r=c+r;var u=i,l=a;for(a=t.Ta,i=t.Ua;0<o--;){var h=t.gc[o],f=c,d=r,p=u,g=l,m=(l=a,u=i,h.Ea);switch(e(f<d),e(d<=h.nc),h.hc){case 2:Gr(p,g,(d-f)*m,l,u);break;case 0:var v=f,b=d,y=l,w=u,N=(_=h).Ea;0==v&&(Wr(p,g,null,null,1,y,w),V(p,g+1,0,0,N-1,y,w+1),g+=N,w+=N,++v);for(var L=1<<_.b,A=L-1,x=q(N,_.b),S=_.K,_=_.w+(v>>_.b)*x;v<b;){var P=S,k=_,F=1;for(Vr(p,g,y,w-N,1,y,w);F<N;){var I=(F&~A)+L;I>N&&(I=N),(0,Zr[P[k++]>>8&15])(p,g+ +F,y,w+F-N,I-F,y,w+F),F=I}g+=N,w+=N,++v&A||(_+=x)}d!=h.nc&&n(l,u-m,l,u+(d-f-1)*m,m);break;case 1:for(m=p,b=g,N=(p=h.Ea)-(w=p&~(y=(g=1<<h.b)-1)),v=q(p,h.b),L=h.K,h=h.w+(f>>h.b)*v;f<d;){for(A=L,x=h,S=new T,_=b+w,P=b+p;b<_;)Y(A[x++],S),$r(S,m,b,g,l,u),b+=g,u+=g;b<P&&(Y(A[x++],S),$r(S,m,b,N,l,u),b+=N,u+=N),++f&y||(h+=v)}break;case 3:if(p==l&&g==u&&0<h.b){for(b=l,p=m=u+(d-f)*m-(w=(d-f)*q(h.Ea,h.b)),g=l,y=u,v=[],w=(N=w)-1;0<=w;--w)v[w]=g[y+w];for(w=N-1;0<=w;--w)b[p+w]=v[w];Yr(h,f,d,l,m,l,u)}else Yr(h,f,d,p,g,l,u)}u=a,l=i}l!=i&&n(a,i,u,l,s)}function Lt(t,r){var n=t.V,i=t.Ba+t.c*t.C,a=r-t.C;if(e(r<=t.l.o),e(16>=a),0<a){var o=t.l,s=t.Ta,c=t.Ua,u=o.width;if(Nt(t,a,n,i),a=c=[c],e((n=t.C)<(i=r)),e(o.v<o.va),i>o.o&&(i=o.o),n<o.j){var l=o.j-n;n=o.j;a[0]+=l*u}if(n>=i?n=0:(a[0]+=4*o.v,o.ka=n-o.j,o.U=o.va-o.v,o.T=i-n,n=1),n){if(c=c[0],11>(n=t.ca).S){var h=n.f.RGBA,f=(i=n.S,a=o.U,o=o.T,l=h.eb,h.A),d=o;for(h=h.fb+t.Ma*h.A;0<d--;){var p=s,g=c,m=a,v=l,b=h;switch(i){case En:Qr(p,g,m,v,b);break;case qn:tn(p,g,m,v,b);break;case Hn:tn(p,g,m,v,b),An(v,b,0,m,1,0);break;case Dn:nn(p,g,m,v,b);break;case Rn:et(p,g,m,v,b,1);break;case Wn:et(p,g,m,v,b,1),An(v,b,0,m,1,0);break;case Tn:et(p,g,m,v,b,0);break;case Vn:et(p,g,m,v,b,0),An(v,b,1,m,1,0);break;case Un:en(p,g,m,v,b);break;case Gn:en(p,g,m,v,b),xn(v,b,m,1,0);break;case zn:rn(p,g,m,v,b);break;default:e(0)}c+=u,h+=f}t.Ma+=o}else alert(\"todo:EmitRescaledRowsYUVA\");e(t.Ma<=n.height)}}t.C=r,e(t.C<=t.i)}function At(t){var e;if(0<t.ua)return 0;for(e=0;e<t.Wb;++e){var r=t.Ya[e].G,n=t.Ya[e].H;if(0<r[1][n[1]+0].g||0<r[2][n[2]+0].g||0<r[3][n[3]+0].g)return 0}return 1}function xt(t,r,n,i,a,o){if(0!=t.Z){var s=t.qd,c=t.rd;for(e(null!=mi[t.Z]);r<n;++r)mi[t.Z](s,c,i,a,i,a,o),s=i,c=a,a+=o;t.qd=s,t.rd=c}}function St(t,r){var n=t.l.ma,i=0==n.Z||1==n.Z?t.l.j:t.C;i=t.C<i?i:t.C;if(e(r<=t.l.o),r>i){var a=t.l.width,o=n.ca,s=n.tb+a*i,c=t.V,u=t.Ba+t.c*i,l=t.gc;e(1==t.ab),e(3==l[0].hc),Xr(l[0],i,r,c,u,o,s),xt(n,i,r,o,s,a)}t.C=t.Ma=r}function _t(t,r,n,i,a,o,s){var c=t.$/i,u=t.$%i,l=t.m,h=t.s,f=n+t.$,d=f;a=n+i*a;var p=n+i*o,g=280+h.ua,m=t.Pb?c:16777216,v=0<h.ua?h.Wa:null,b=h.wc,y=f<p?wt(h,u,c):null;e(t.C<o),e(p<=a);var w=!1;t:for(;;){for(;w||f<p;){var N=0;if(c>=m){var _=f-n;e((m=t).Pb),m.wd=m.m,m.xd=_,0<m.s.ua&&B(m.s.Wa,m.s.vb),m=c+ti}if(u&b||(y=wt(h,u,c)),e(null!=y),y.Qb&&(r[f]=y.qb,w=!0),!w)if(S(l),y.jc){N=l,_=r;var P=f,k=y.pd[L(N)&Dr-1];e(y.jc),256>k.g?(x(N,N.u+k.g),_[P]=k.value,N=0):(x(N,N.u+k.g-256),e(256<=k.value),N=k.value),0==N&&(w=!0)}else N=bt(y.G[0],y.H[0],l);if(l.h)break;if(w||256>N){if(!w)if(y.nd)r[f]=(y.qb|N<<8)>>>0;else{if(S(l),w=bt(y.G[1],y.H[1],l),S(l),_=bt(y.G[2],y.H[2],l),P=bt(y.G[3],y.H[3],l),l.h)break;r[f]=(P<<24|w<<16|N<<8|_)>>>0}if(w=!1,++f,++u>=i&&(u=0,++c,null!=s&&c<=o&&!(c%16)&&s(t,c),null!=v))for(;d<f;)N=r[d++],v.X[(506832829*N&4294967295)>>>v.Mb]=N}else if(280>N){if(N=mt(N-256,l),_=bt(y.G[4],y.H[4],l),S(l),_=vt(i,_=mt(_,l)),l.h)break;if(f-n<_||a-f<N)break t;for(P=0;P<N;++P)r[f+P]=r[f+P-_];for(f+=N,u+=N;u>=i;)u-=i,++c,null!=s&&c<=o&&!(c%16)&&s(t,c);if(e(f<=a),u&b&&(y=wt(h,u,c)),null!=v)for(;d<f;)N=r[d++],v.X[(506832829*N&4294967295)>>>v.Mb]=N}else{if(!(N<g))break t;for(w=N-280,e(null!=v);d<f;)N=r[d++],v.X[(506832829*N&4294967295)>>>v.Mb]=N;N=f,e(!(w>>>(_=v).Xa)),r[N]=_.X[w],w=!0}w||e(l.h==A(l))}if(t.Pb&&l.h&&f<a)e(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&B(t.s.vb,t.s.Wa);else{if(l.h)break t;null!=s&&s(t,c>o?o:c),t.a=0,t.$=f-n}return 1}return t.a=3,0}function Pt(t){e(null!=t),t.vc=null,t.yc=null,t.Ya=null;var r=t.Wa;null!=r&&(r.X=null),t.vb=null,e(null!=t)}function kt(){var e=new or;return null==e?null:(e.a=0,e.xb=gi,rt(\"Predictor\",\"VP8LPredictors\"),rt(\"Predictor\",\"VP8LPredictors_C\"),rt(\"PredictorAdd\",\"VP8LPredictorsAdd\"),rt(\"PredictorAdd\",\"VP8LPredictorsAdd_C\"),Gr=G,$r=J,Qr=K,tn=Z,en=$,rn=Q,nn=tt,t.VP8LMapColor32b=Jr,t.VP8LMapColor8b=Kr,e)}function Ft(t,r,n,s,c){var u=1,f=[t],p=[r],g=s.m,m=s.s,v=null,b=0;t:for(;;){if(n)for(;u&&y(g,1);){var w=f,N=p,A=s,_=1,P=A.m,k=A.gc[A.ab],F=y(P,2);if(A.Oc&1<<F)u=0;else{switch(A.Oc|=1<<F,k.hc=F,k.Ea=w[0],k.nc=N[0],k.K=[null],++A.ab,e(4>=A.ab),F){case 0:case 1:k.b=y(P,3)+2,_=Ft(q(k.Ea,k.b),q(k.nc,k.b),0,A,k.K),k.K=k.K[0];break;case 3:var I,C=y(P,8)+1,j=16<C?0:4<C?1:2<C?2:3;if(w[0]=q(k.Ea,j),k.b=j,I=_=Ft(C,1,0,A,k.K)){var B,M=C,E=k,R=1<<(8>>E.b),T=a(R);if(null==T)I=0;else{var U=E.K[0],z=E.w;for(T[0]=E.K[0][0],B=1;B<1*M;++B)T[B]=D(U[z+B],T[B-1]);for(;B<4*R;++B)T[B]=0;E.K[0]=null,E.K[0]=T,I=1}}_=I;break;case 2:break;default:e(0)}u=_}}if(f=f[0],p=p[0],u&&y(g,1)&&!(u=1<=(b=y(g,4))&&11>=b)){s.a=3;break t}var H;if(H=u)e:{var W,V,G,Y=s,J=f,X=p,K=b,Z=n,$=Y.m,Q=Y.s,tt=[null],et=1,rt=0,nt=Qn[K];r:for(;;){if(Z&&y($,1)){var it=y($,3)+2,at=q(J,it),ot=q(X,it),st=at*ot;if(!Ft(at,ot,0,Y,tt))break r;for(tt=tt[0],Q.xc=it,W=0;W<st;++W){var ct=tt[W]>>8&65535;tt[W]=ct,ct>=et&&(et=ct+1)}}if($.h)break r;for(V=0;5>V;++V){var ut=Xn[V];!V&&0<K&&(ut+=1<<K),rt<ut&&(rt=ut)}var lt=o(et*nt,h),ht=et,ft=o(ht,d);if(null==ft)var dt=null;else e(65536>=ht),dt=ft;var pt=a(rt);if(null==dt||null==pt||null==lt){Y.a=1;break r}var gt=lt;for(W=G=0;W<et;++W){var mt=dt[W],vt=mt.G,bt=mt.H,wt=0,Nt=1,Lt=0;for(V=0;5>V;++V){ut=Xn[V],vt[V]=gt,bt[V]=G,!V&&0<K&&(ut+=1<<K);n:{var At,xt=ut,St=Y,kt=pt,It=gt,Ct=G,jt=0,Ot=St.m,Bt=y(Ot,1);if(i(kt,0,0,xt),Bt){var Mt=y(Ot,1)+1,Et=y(Ot,1),qt=y(Ot,0==Et?1:8);kt[qt]=1,2==Mt&&(kt[qt=y(Ot,8)]=1);var Dt=1}else{var Rt=a(19),Tt=y(Ot,4)+4;if(19<Tt){St.a=3;var Ut=0;break n}for(At=0;At<Tt;++At)Rt[Zn[At]]=y(Ot,3);var zt=void 0,Ht=void 0,Wt=St,Vt=Rt,Gt=xt,Yt=kt,Jt=0,Xt=Wt.m,Kt=8,Zt=o(128,h);i:for(;l(Zt,0,7,Vt,19);){if(y(Xt,1)){var $t=2+2*y(Xt,3);if((zt=2+y(Xt,$t))>Gt)break i}else zt=Gt;for(Ht=0;Ht<Gt&&zt--;){S(Xt);var Qt=Zt[0+(127&L(Xt))];x(Xt,Xt.u+Qt.g);var te=Qt.value;if(16>te)Yt[Ht++]=te,0!=te&&(Kt=te);else{var ee=16==te,re=te-16,ne=Jn[re],ie=y(Xt,Yn[re])+ne;if(Ht+ie>Gt)break i;for(var ae=ee?Kt:0;0<ie--;)Yt[Ht++]=ae}}Jt=1;break i}Jt||(Wt.a=3),Dt=Jt}(Dt=Dt&&!Ot.h)&&(jt=l(It,Ct,8,kt,xt)),Dt&&0!=jt?Ut=jt:(St.a=3,Ut=0)}if(0==Ut)break r;if(Nt&&1==Kn[V]&&(Nt=0==gt[G].g),wt+=gt[G].g,G+=Ut,3>=V){var oe,se=pt[0];for(oe=1;oe<ut;++oe)pt[oe]>se&&(se=pt[oe]);Lt+=se}}if(mt.nd=Nt,mt.Qb=0,Nt&&(mt.qb=(vt[3][bt[3]+0].value<<24|vt[1][bt[1]+0].value<<16|vt[2][bt[2]+0].value)>>>0,0==wt&&256>vt[0][bt[0]+0].value&&(mt.Qb=1,mt.qb+=vt[0][bt[0]+0].value<<8)),mt.jc=!mt.Qb&&6>Lt,mt.jc){var ce,ue=mt;for(ce=0;ce<Dr;++ce){var le=ce,he=ue.pd[le],fe=ue.G[0][ue.H[0]+le];256<=fe.value?(he.g=fe.g+256,he.value=fe.value):(he.g=0,he.value=0,le>>=yt(fe,8,he),le>>=yt(ue.G[1][ue.H[1]+le],16,he),le>>=yt(ue.G[2][ue.H[2]+le],0,he),yt(ue.G[3][ue.H[3]+le],24,he))}}}Q.vc=tt,Q.Wb=et,Q.Ya=dt,Q.yc=lt,H=1;break e}H=0}if(!(u=H)){s.a=3;break t}if(0<b){if(m.ua=1<<b,!O(m.Wa,b)){s.a=1,u=0;break t}}else m.ua=0;var de=s,pe=f,ge=p,me=de.s,ve=me.xc;if(de.c=pe,de.i=ge,me.md=q(pe,ve),me.wc=0==ve?-1:(1<<ve)-1,n){s.xb=pi;break t}if(null==(v=a(f*p))){s.a=1,u=0;break t}u=(u=_t(s,v,0,f,p,p,null))&&!g.h;break t}return u?(null!=c?c[0]=v:(e(null==v),e(n)),s.$=0,n||Pt(m)):Pt(m),u}function It(t,r){var n=t.c*t.i,i=n+r+16*r;return e(t.c<=r),t.V=a(i),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+n+r,1)}function Ct(t,r){var n=t.C,i=r-n,a=t.V,o=t.Ba+t.c*n;for(e(r<=t.l.o);0<i;){var s=16<i?16:i,c=t.l.ma,u=t.l.width,l=u*s,h=c.ca,f=c.tb+u*n,d=t.Ta,p=t.Ua;Nt(t,s,a,o),_n(d,p,h,f,l),xt(c,n,n+s,h,f,u),i-=s,a+=s*t.c,n+=s}e(n==r),t.C=t.Ma=r}function jt(){this.ub=this.yd=this.td=this.Rb=0}function Ot(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Bt(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function Mt(){this.Yb=function(){var t=[];return function t(e,r,n){for(var i=n[r],a=0;a<i&&(e.push(n.length>r+1?[]:0),!(n.length<r+1));a++)t(e[a],r+1,n)}(t,0,[3,11]),t}()}function Et(){this.jb=a(3),this.Wc=s([4,8],Mt),this.Xc=s([4,17],Mt)}function qt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Dt(){this.ld=this.La=this.dd=this.tc=0}function Rt(){this.Na=this.la=0}function Tt(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ut(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function zt(){this.uc=this.M=this.Nb=0,this.wa=Array(new Dt),this.Y=0,this.ya=Array(new Ut),this.aa=0,this.l=new Gt}function Ht(){this.y=a(16),this.f=a(8),this.ea=a(8)}function Wt(){this.cb=this.a=0,this.sc=\"\",this.m=new w,this.Od=new jt,this.Kc=new Ot,this.ed=new qt,this.Qa=new Bt,this.Ic=this.$c=this.Aa=0,this.D=new zt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,w),this.ia=0,this.pb=o(4,Tt),this.Pa=new Et,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Ht),this.Hd=0,this.rb=Array(new Rt),this.sb=0,this.wa=Array(new Dt),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ut),this.L=this.aa=0,this.gd=s([4,2],Dt),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Vt(t,e){return 0>t?0:t>e?e:t}function Gt(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma=\"void\",this.put=\"VP8IoPutHook\",this.ac=\"VP8IoSetupHook\",this.bc=\"VP8IoTeardownHook\",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Yt(){var t=new Wt;return null!=t&&(t.a=0,t.sc=\"OK\",t.cb=0,t.Xb=0,ni||(ni=Zt)),t}function Jt(t,e,r){return 0==t.a&&(t.a=e,t.sc=r,t.cb=0),0}function Xt(t,e,r){return 3<=r&&157==t[e+0]&&1==t[e+1]&&42==t[e+2]}function Kt(t,r){if(null==t)return 0;if(t.a=0,t.sc=\"OK\",null==r)return Jt(t,2,\"null VP8Io passed to VP8GetHeaders()\");var n=r.data,a=r.w,o=r.ha;if(4>o)return Jt(t,7,\"Truncated header.\");var s=n[a+0]|n[a+1]<<8|n[a+2]<<16,c=t.Od;if(c.Rb=!(1&s),c.td=s>>1&7,c.yd=s>>4&1,c.ub=s>>5,3<c.td)return Jt(t,3,\"Incorrect keyframe parameters.\");if(!c.yd)return Jt(t,4,\"Frame not displayable.\");a+=3,o-=3;var u=t.Kc;if(c.Rb){if(7>o)return Jt(t,7,\"cannot parse picture header\");if(!Xt(n,a,o))return Jt(t,3,\"Bad code word\");u.c=16383&(n[a+4]<<8|n[a+3]),u.Td=n[a+4]>>6,u.i=16383&(n[a+6]<<8|n[a+5]),u.Ud=n[a+6]>>6,a+=7,o-=7,t.za=u.c+15>>4,t.Ub=u.i+15>>4,r.width=u.c,r.height=u.i,r.Da=0,r.j=0,r.v=0,r.va=r.width,r.o=r.height,r.da=0,r.ib=r.width,r.hb=r.height,r.U=r.width,r.T=r.height,i((s=t.Pa).jb,0,255,s.jb.length),e(null!=(s=t.Qa)),s.Cb=0,s.Bb=0,s.Fb=1,i(s.Zb,0,0,s.Zb.length),i(s.Lb,0,0,s.Lb)}if(c.ub>o)return Jt(t,7,\"bad partition length\");p(s=t.m,n,a,c.ub),a+=c.ub,o-=c.ub,c.Rb&&(u.Ld=P(s),u.Kd=P(s)),u=t.Qa;var l,h=t.Pa;if(e(null!=s),e(null!=u),u.Cb=P(s),u.Cb){if(u.Bb=P(s),P(s)){for(u.Fb=P(s),l=0;4>l;++l)u.Zb[l]=P(s)?m(s,7):0;for(l=0;4>l;++l)u.Lb[l]=P(s)?m(s,6):0}if(u.Bb)for(l=0;3>l;++l)h.jb[l]=P(s)?g(s,8):255}else u.Bb=0;if(s.Ka)return Jt(t,3,\"cannot parse segment header\");if((u=t.ed).zd=P(s),u.Tb=g(s,6),u.wb=g(s,3),u.Pc=P(s),u.Pc&&P(s)){for(h=0;4>h;++h)P(s)&&(u.vd[h]=m(s,6));for(h=0;4>h;++h)P(s)&&(u.od[h]=m(s,6))}if(t.L=0==u.Tb?0:u.zd?1:2,s.Ka)return Jt(t,3,\"cannot parse filter header\");var f=o;if(o=l=a,a=l+f,u=f,t.Xb=(1<<g(t.m,2))-1,f<3*(h=t.Xb))n=7;else{for(l+=3*h,u-=3*h,f=0;f<h;++f){var d=n[o+0]|n[o+1]<<8|n[o+2]<<16;d>u&&(d=u),p(t.Jc[+f],n,l,d),l+=d,u-=d,o+=3}p(t.Jc[+h],n,l,u),n=l<a?0:5}if(0!=n)return Jt(t,n,\"cannot parse partitions\");for(n=g(l=t.m,7),o=P(l)?m(l,4):0,a=P(l)?m(l,4):0,u=P(l)?m(l,4):0,h=P(l)?m(l,4):0,l=P(l)?m(l,4):0,f=t.Qa,d=0;4>d;++d){if(f.Cb){var v=f.Zb[d];f.Fb||(v+=n)}else{if(0<d){t.pb[d]=t.pb[0];continue}v=n}var b=t.pb[d];b.Sc[0]=ei[Vt(v+o,127)],b.Sc[1]=ri[Vt(v+0,127)],b.Eb[0]=2*ei[Vt(v+a,127)],b.Eb[1]=101581*ri[Vt(v+u,127)]>>16,8>b.Eb[1]&&(b.Eb[1]=8),b.Qc[0]=ei[Vt(v+h,117)],b.Qc[1]=ri[Vt(v+l,127)],b.lc=v+l}if(!c.Rb)return Jt(t,4,\"Not a key frame.\");for(P(s),c=t.Pa,n=0;4>n;++n){for(o=0;8>o;++o)for(a=0;3>a;++a)for(u=0;11>u;++u)h=k(s,ui[n][o][a][u])?g(s,8):si[n][o][a][u],c.Wc[n][o].Yb[a][u]=h;for(o=0;17>o;++o)c.Xc[n][o]=c.Wc[n][li[o]]}return t.kc=P(s),t.kc&&(t.Bd=g(s,8)),t.cb=1}function Zt(t,e,r,n,i,a,o){var s=e[i].Yb[r];for(r=0;16>i;++i){if(!k(t,s[r+0]))return i;for(;!k(t,s[r+1]);)if(s=e[++i].Yb[0],r=0,16==i)return 16;var c=e[i+1].Yb;if(k(t,s[r+2])){var u=t,l=0;if(k(u,(f=s)[(h=r)+3]))if(k(u,f[h+6])){for(s=0,h=2*(l=k(u,f[h+8]))+(f=k(u,f[h+9+l])),l=0,f=ii[h];f[s];++s)l+=l+k(u,f[s]);l+=3+(8<<h)}else k(u,f[h+7])?(l=7+2*k(u,165),l+=k(u,145)):l=5+k(u,159);else l=k(u,f[h+4])?3+k(u,f[h+5]):2;s=c[2]}else l=1,s=c[1];c=o+ai[i],0>(u=t).b&&_(u);var h,f=u.b,d=(h=u.Ca>>1)-(u.I>>f)>>31;--u.b,u.Ca+=d,u.Ca|=1,u.I-=(h+1&d)<<f,a[c]=((l^d)-d)*n[(0<i)+0]}return 16}function $t(t){var e=t.rb[t.sb-1];e.la=0,e.Na=0,i(t.zc,0,0,t.zc.length),t.ja=0}function Qt(t,r){if(null==t)return 0;if(null==r)return Jt(t,2,\"NULL VP8Io parameter in VP8Decode().\");if(!t.cb&&!Kt(t,r))return 0;if(e(t.cb),null==r.ac||r.ac(r)){r.ob&&(t.L=0);var s=Ri[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=r.v-s>>4,t.zb=r.j-s>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=r.o+15+s>>4,t.Hb=r.va+15+s>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0<t.L){var c=t.ed;for(s=0;4>s;++s){var u;if(t.Qa.Cb){var l=t.Qa.Lb[s];t.Qa.Fb||(l+=c.Tb)}else l=c.Tb;for(u=0;1>=u;++u){var h=t.gd[s][u],f=l;if(c.Pc&&(f+=c.vd[0],u&&(f+=c.od[0])),0<(f=0>f?0:63<f?63:f)){var d=f;0<c.wb&&((d=4<c.wb?d>>2:d>>1)>9-c.wb&&(d=9-c.wb)),1>d&&(d=1),h.dd=d,h.tc=2*f+d,h.ld=40<=f?2:15<=f?1:0}else h.tc=0;h.La=u}}}s=0}else Jt(t,6,\"Frame setup failed\"),s=t.a;if(s=0==s){if(s){t.$c=0,0<t.Aa||(t.Ic=Ui);t:{s=t.Ic;c=4*(d=t.za);var p=32*d,g=d+1,m=0<t.L?d*(0<t.Aa?2:1):0,v=(2==t.Aa?2:1)*d;if((h=c+832+(u=3*(16*s+Ri[t.L])/2*p)+(l=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=h)s=0;else{if(h>t.Vb){if(t.Vb=0,t.Ec=a(h),t.Fc=0,null==t.Ec){s=Jt(t,1,\"no memory during frame initialization.\");break t}t.Vb=h}h=t.Ec,f=t.Fc,t.Ac=h,t.Bc=f,f+=c,t.Gd=o(p,Ht),t.Hd=0,t.rb=o(g+1,Rt),t.sb=1,t.wa=m?o(m,Dt):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=d),e(!0),t.oc=h,t.pc=f,f+=832,t.ya=o(v,Ut),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=d),t.R=16*d,t.B=8*d,d=(p=Ri[t.L])*t.R,p=p/2*t.B,t.sa=h,t.ta=f+d,t.qa=t.sa,t.ra=t.ta+16*s*t.R+p,t.Ha=t.qa,t.Ia=t.ra+8*s*t.B+p,t.$c=0,f+=u,t.mb=l?h:null,t.nb=l?f:null,e(f+l<=t.Fc+t.Vb),$t(t),i(t.Ac,t.Bc,0,c),s=1}}if(s){if(r.ka=0,r.y=t.sa,r.O=t.ta,r.f=t.qa,r.N=t.ra,r.ea=t.Ha,r.Vd=t.Ia,r.fa=t.R,r.Rc=t.B,r.F=null,r.J=0,!Cn){for(s=-255;255>=s;++s)Pn[255+s]=0>s?-s:s;for(s=-1020;1020>=s;++s)kn[1020+s]=-128>s?-128:127<s?127:s;for(s=-112;112>=s;++s)Fn[112+s]=-16>s?-16:15<s?15:s;for(s=-255;510>=s;++s)In[255+s]=0>s?0:255<s?255:s;Cn=1}an=ue,on=ae,cn=oe,un=se,ln=ce,sn=ie,hn=Je,fn=Xe,dn=$e,pn=Qe,gn=Ke,mn=Ze,vn=tr,bn=er,yn=ze,wn=He,Nn=We,Ln=Ve,fi[0]=xe,fi[1]=he,fi[2]=Le,fi[3]=Ae,fi[4]=Se,fi[5]=Pe,fi[6]=_e,fi[7]=ke,fi[8]=Ie,fi[9]=Fe,hi[0]=ve,hi[1]=de,hi[2]=pe,hi[3]=ge,hi[4]=be,hi[5]=ye,hi[6]=we,di[0]=Be,di[1]=fe,di[2]=Ce,di[3]=je,di[4]=Ee,di[5]=Me,di[6]=qe,s=1}else s=0}s&&(s=function(t,r){for(t.M=0;t.M<t.Va;++t.M){var o,s=t.Jc[t.M&t.Xb],c=t.m,u=t;for(o=0;o<u.za;++o){var l=c,h=u,f=h.Ac,d=h.Bc+4*o,p=h.zc,g=h.ya[h.aa+o];if(h.Qa.Bb?g.$b=k(l,h.Pa.jb[0])?2+k(l,h.Pa.jb[2]):k(l,h.Pa.jb[1]):g.$b=0,h.kc&&(g.Ad=k(l,h.Bd)),g.Za=!k(l,145)+0,g.Za){var m=g.Ob,v=0;for(h=0;4>h;++h){var b,y=p[0+h];for(b=0;4>b;++b){y=ci[f[d+b]][y];for(var w=oi[k(l,y[0])];0<w;)w=oi[2*w+k(l,y[w])];y=-w,f[d+b]=y}n(m,v,f,d,4),v+=4,p[0+h]=y}}else y=k(l,156)?k(l,128)?1:3:k(l,163)?2:0,g.Ob[0]=y,i(f,d,y,4),i(p,0,y,4);g.Dd=k(l,142)?k(l,114)?k(l,183)?1:3:2:0}if(u.m.Ka)return Jt(t,7,\"Premature end-of-partition0 encountered.\");for(;t.ja<t.za;++t.ja){if(u=s,l=(c=t).rb[c.sb-1],f=c.rb[c.sb+c.ja],o=c.ya[c.aa+c.ja],d=c.kc?o.Ad:0)l.la=f.la=0,o.Za||(l.Na=f.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{var N,L;l=f,f=u,d=c.Pa.Xc,p=c.ya[c.aa+c.ja],g=c.pb[p.$b];if(h=p.ad,m=0,v=c.rb[c.sb-1],y=b=0,i(h,m,0,384),p.Za)var A=0,x=d[3];else{w=a(16);var S=l.Na+v.Na;if(S=ni(f,d[1],S,g.Eb,0,w,0),l.Na=v.Na=(0<S)+0,1<S)an(w,0,h,m);else{var _=w[0]+3>>3;for(w=0;256>w;w+=16)h[m+w]=_}A=1,x=d[0]}var P=15&l.la,F=15&v.la;for(w=0;4>w;++w){var I=1&F;for(_=L=0;4>_;++_)P=P>>1|(I=(S=ni(f,x,S=I+(1&P),g.Sc,A,h,m))>A)<<7,L=L<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;P>>=4,F=F>>1|I<<7,b=(b<<8|L)>>>0}for(x=P,A=F>>4,N=0;4>N;N+=2){for(L=0,P=l.la>>4+N,F=v.la>>4+N,w=0;2>w;++w){for(I=1&F,_=0;2>_;++_)S=I+(1&P),P=P>>1|(I=0<(S=ni(f,d[2],S,g.Qc,0,h,m)))<<3,L=L<<2|(3<S?3:1<S?2:0!=h[m+0]),m+=16;P>>=2,F=F>>1|I<<5}y|=L<<4*N,x|=P<<4<<N,A|=(240&F)<<N}l.la=x,v.la=A,p.Hc=b,p.Gc=y,p.ia=43690&y?0:g.ia,d=!(b|y)}if(0<c.L&&(c.wa[c.Y+c.ja]=c.gd[o.$b][o.Za],c.wa[c.Y+c.ja].La|=!d),u.Ka)return Jt(t,7,\"Premature end-of-file encountered.\")}if($t(t),c=r,u=1,o=(s=t).D,l=0<s.L&&s.M>=s.zb&&s.M<=s.Va,0==s.Aa)t:{if(o.M=s.M,o.uc=l,Or(s,o),u=1,o=(L=s.D).Nb,l=(y=Ri[s.L])*s.R,f=y/2*s.B,w=16*o*s.R,_=8*o*s.B,d=s.sa,p=s.ta-l+w,g=s.qa,h=s.ra-f+_,m=s.Ha,v=s.Ia-f+_,F=0==(P=L.M),b=P>=s.Va-1,2==s.Aa&&Or(s,L),L.uc)for(I=(S=s).D.M,e(S.D.uc),L=S.yb;L<S.Hb;++L){A=L,x=I;var C=(j=(U=S).D).Nb;N=U.R;var j=j.wa[j.Y+A],O=U.sa,B=U.ta+16*C*N+16*A,M=j.dd,E=j.tc;if(0!=E)if(e(3<=E),1==U.L)0<A&&wn(O,B,N,E+4),j.La&&Ln(O,B,N,E),0<x&&yn(O,B,N,E+4),j.La&&Nn(O,B,N,E);else{var q=U.B,D=U.qa,R=U.ra+8*C*q+8*A,T=U.Ha,U=U.Ia+8*C*q+8*A;C=j.ld;0<A&&(fn(O,B,N,E+4,M,C),pn(D,R,T,U,q,E+4,M,C)),j.La&&(mn(O,B,N,E,M,C),bn(D,R,T,U,q,E,M,C)),0<x&&(hn(O,B,N,E+4,M,C),dn(D,R,T,U,q,E+4,M,C)),j.La&&(gn(O,B,N,E,M,C),vn(D,R,T,U,q,E,M,C))}}if(s.ia&&alert(\"todo:DitherRow\"),null!=c.put){if(L=16*P,P=16*(P+1),F?(c.y=s.sa,c.O=s.ta+w,c.f=s.qa,c.N=s.ra+_,c.ea=s.Ha,c.W=s.Ia+_):(L-=y,c.y=d,c.O=p,c.f=g,c.N=h,c.ea=m,c.W=v),b||(P-=y),P>c.o&&(P=c.o),c.F=null,c.J=null,null!=s.Fa&&0<s.Fa.length&&L<P&&(c.J=hr(s,c,L,P-L),c.F=s.mb,null==c.F&&0==c.F.length)){u=Jt(s,3,\"Could not decode alpha data.\");break t}L<c.j&&(y=c.j-L,L=c.j,e(!(1&y)),c.O+=s.R*y,c.N+=s.B*(y>>1),c.W+=s.B*(y>>1),null!=c.F&&(c.J+=c.width*y)),L<P&&(c.O+=c.v,c.N+=c.v>>1,c.W+=c.v>>1,null!=c.F&&(c.J+=c.v),c.ka=L-c.j,c.U=c.va-c.v,c.T=P-L,u=c.put(c))}o+1!=s.Ic||b||(n(s.sa,s.ta-l,d,p+16*s.R,l),n(s.qa,s.ra-f,g,h+8*s.B,f),n(s.Ha,s.Ia-f,m,v+8*s.B,f))}if(!u)return Jt(t,6,\"Output aborted.\")}return 1}(t,r)),null!=r.bc&&r.bc(r),s&=1}return s?(t.cb=0,s):0}function te(t,e,r,n,i){i=t[e+r+32*n]+(i>>3),t[e+r+32*n]=-256&i?0>i?0:255:i}function ee(t,e,r,n,i,a){te(t,e,0,r,n+i),te(t,e,1,r,n+a),te(t,e,2,r,n-a),te(t,e,3,r,n-i)}function re(t){return(20091*t>>16)+t}function ne(t,e,r,n){var i,o=0,s=a(16);for(i=0;4>i;++i){var c=t[e+0]+t[e+8],u=t[e+0]-t[e+8],l=(35468*t[e+4]>>16)-re(t[e+12]),h=re(t[e+4])+(35468*t[e+12]>>16);s[o+0]=c+h,s[o+1]=u+l,s[o+2]=u-l,s[o+3]=c-h,o+=4,e++}for(i=o=0;4>i;++i)c=(t=s[o+0]+4)+s[o+8],u=t-s[o+8],l=(35468*s[o+4]>>16)-re(s[o+12]),te(r,n,0,0,c+(h=re(s[o+4])+(35468*s[o+12]>>16))),te(r,n,1,0,u+l),te(r,n,2,0,u-l),te(r,n,3,0,c-h),o++,n+=32}function ie(t,e,r,n){var i=t[e+0]+4,a=35468*t[e+4]>>16,o=re(t[e+4]),s=35468*t[e+1]>>16;ee(r,n,0,i+o,t=re(t[e+1]),s),ee(r,n,1,i+a,t,s),ee(r,n,2,i-a,t,s),ee(r,n,3,i-o,t,s)}function ae(t,e,r,n,i){ne(t,e,r,n),i&&ne(t,e+16,r,n+4)}function oe(t,e,r,n){on(t,e+0,r,n,1),on(t,e+32,r,n+128,1)}function se(t,e,r,n){var i;for(t=t[e+0]+4,i=0;4>i;++i)for(e=0;4>e;++e)te(r,n,e,i,t)}function ce(t,e,r,n){t[e+0]&&un(t,e+0,r,n),t[e+16]&&un(t,e+16,r,n+4),t[e+32]&&un(t,e+32,r,n+128),t[e+48]&&un(t,e+48,r,n+128+4)}function ue(t,e,r,n){var i,o=a(16);for(i=0;4>i;++i){var s=t[e+0+i]+t[e+12+i],c=t[e+4+i]+t[e+8+i],u=t[e+4+i]-t[e+8+i],l=t[e+0+i]-t[e+12+i];o[0+i]=s+c,o[8+i]=s-c,o[4+i]=l+u,o[12+i]=l-u}for(i=0;4>i;++i)s=(t=o[0+4*i]+3)+o[3+4*i],c=o[1+4*i]+o[2+4*i],u=o[1+4*i]-o[2+4*i],l=t-o[3+4*i],r[n+0]=s+c>>3,r[n+16]=l+u>>3,r[n+32]=s-c>>3,r[n+48]=l-u>>3,n+=64}function le(t,e,r){var n,i=e-32,a=Bn,o=255-t[i-1];for(n=0;n<r;++n){var s,c=a,u=o+t[e-1];for(s=0;s<r;++s)t[e+s]=c[u+t[i+s]];e+=32}}function he(t,e){le(t,e,4)}function fe(t,e){le(t,e,8)}function de(t,e){le(t,e,16)}function pe(t,e){var r;for(r=0;16>r;++r)n(t,e+32*r,t,e-32,16)}function ge(t,e){var r;for(r=16;0<r;--r)i(t,e,t[e-1],16),e+=32}function me(t,e,r){var n;for(n=0;16>n;++n)i(e,r+32*n,t,16)}function ve(t,e){var r,n=16;for(r=0;16>r;++r)n+=t[e-1+32*r]+t[e+r-32];me(n>>5,t,e)}function be(t,e){var r,n=8;for(r=0;16>r;++r)n+=t[e-1+32*r];me(n>>4,t,e)}function ye(t,e){var r,n=8;for(r=0;16>r;++r)n+=t[e+r-32];me(n>>4,t,e)}function we(t,e){me(128,t,e)}function Ne(t,e,r){return t+2*e+r+2>>2}function Le(t,e){var r,i=e-32;i=new Uint8Array([Ne(t[i-1],t[i+0],t[i+1]),Ne(t[i+0],t[i+1],t[i+2]),Ne(t[i+1],t[i+2],t[i+3]),Ne(t[i+2],t[i+3],t[i+4])]);for(r=0;4>r;++r)n(t,e+32*r,i,0,i.length)}function Ae(t,e){var r=t[e-1],n=t[e-1+32],i=t[e-1+64],a=t[e-1+96];F(t,e+0,16843009*Ne(t[e-1-32],r,n)),F(t,e+32,16843009*Ne(r,n,i)),F(t,e+64,16843009*Ne(n,i,a)),F(t,e+96,16843009*Ne(i,a,a))}function xe(t,e){var r,n=4;for(r=0;4>r;++r)n+=t[e+r-32]+t[e-1+32*r];for(n>>=3,r=0;4>r;++r)i(t,e+32*r,n,4)}function Se(t,e){var r=t[e-1+0],n=t[e-1+32],i=t[e-1+64],a=t[e-1-32],o=t[e+0-32],s=t[e+1-32],c=t[e+2-32],u=t[e+3-32];t[e+0+96]=Ne(n,i,t[e-1+96]),t[e+1+96]=t[e+0+64]=Ne(r,n,i),t[e+2+96]=t[e+1+64]=t[e+0+32]=Ne(a,r,n),t[e+3+96]=t[e+2+64]=t[e+1+32]=t[e+0+0]=Ne(o,a,r),t[e+3+64]=t[e+2+32]=t[e+1+0]=Ne(s,o,a),t[e+3+32]=t[e+2+0]=Ne(c,s,o),t[e+3+0]=Ne(u,c,s)}function _e(t,e){var r=t[e+1-32],n=t[e+2-32],i=t[e+3-32],a=t[e+4-32],o=t[e+5-32],s=t[e+6-32],c=t[e+7-32];t[e+0+0]=Ne(t[e+0-32],r,n),t[e+1+0]=t[e+0+32]=Ne(r,n,i),t[e+2+0]=t[e+1+32]=t[e+0+64]=Ne(n,i,a),t[e+3+0]=t[e+2+32]=t[e+1+64]=t[e+0+96]=Ne(i,a,o),t[e+3+32]=t[e+2+64]=t[e+1+96]=Ne(a,o,s),t[e+3+64]=t[e+2+96]=Ne(o,s,c),t[e+3+96]=Ne(s,c,c)}function Pe(t,e){var r=t[e-1+0],n=t[e-1+32],i=t[e-1+64],a=t[e-1-32],o=t[e+0-32],s=t[e+1-32],c=t[e+2-32],u=t[e+3-32];t[e+0+0]=t[e+1+64]=a+o+1>>1,t[e+1+0]=t[e+2+64]=o+s+1>>1,t[e+2+0]=t[e+3+64]=s+c+1>>1,t[e+3+0]=c+u+1>>1,t[e+0+96]=Ne(i,n,r),t[e+0+64]=Ne(n,r,a),t[e+0+32]=t[e+1+96]=Ne(r,a,o),t[e+1+32]=t[e+2+96]=Ne(a,o,s),t[e+2+32]=t[e+3+96]=Ne(o,s,c),t[e+3+32]=Ne(s,c,u)}function ke(t,e){var r=t[e+0-32],n=t[e+1-32],i=t[e+2-32],a=t[e+3-32],o=t[e+4-32],s=t[e+5-32],c=t[e+6-32],u=t[e+7-32];t[e+0+0]=r+n+1>>1,t[e+1+0]=t[e+0+64]=n+i+1>>1,t[e+2+0]=t[e+1+64]=i+a+1>>1,t[e+3+0]=t[e+2+64]=a+o+1>>1,t[e+0+32]=Ne(r,n,i),t[e+1+32]=t[e+0+96]=Ne(n,i,a),t[e+2+32]=t[e+1+96]=Ne(i,a,o),t[e+3+32]=t[e+2+96]=Ne(a,o,s),t[e+3+64]=Ne(o,s,c),t[e+3+96]=Ne(s,c,u)}function Fe(t,e){var r=t[e-1+0],n=t[e-1+32],i=t[e-1+64],a=t[e-1+96];t[e+0+0]=r+n+1>>1,t[e+2+0]=t[e+0+32]=n+i+1>>1,t[e+2+32]=t[e+0+64]=i+a+1>>1,t[e+1+0]=Ne(r,n,i),t[e+3+0]=t[e+1+32]=Ne(n,i,a),t[e+3+32]=t[e+1+64]=Ne(i,a,a),t[e+3+64]=t[e+2+64]=t[e+0+96]=t[e+1+96]=t[e+2+96]=t[e+3+96]=a}function Ie(t,e){var r=t[e-1+0],n=t[e-1+32],i=t[e-1+64],a=t[e-1+96],o=t[e-1-32],s=t[e+0-32],c=t[e+1-32],u=t[e+2-32];t[e+0+0]=t[e+2+32]=r+o+1>>1,t[e+0+32]=t[e+2+64]=n+r+1>>1,t[e+0+64]=t[e+2+96]=i+n+1>>1,t[e+0+96]=a+i+1>>1,t[e+3+0]=Ne(s,c,u),t[e+2+0]=Ne(o,s,c),t[e+1+0]=t[e+3+32]=Ne(r,o,s),t[e+1+32]=t[e+3+64]=Ne(n,r,o),t[e+1+64]=t[e+3+96]=Ne(i,n,r),t[e+1+96]=Ne(a,i,n)}function Ce(t,e){var r;for(r=0;8>r;++r)n(t,e+32*r,t,e-32,8)}function je(t,e){var r;for(r=0;8>r;++r)i(t,e,t[e-1],8),e+=32}function Oe(t,e,r){var n;for(n=0;8>n;++n)i(e,r+32*n,t,8)}function Be(t,e){var r,n=8;for(r=0;8>r;++r)n+=t[e+r-32]+t[e-1+32*r];Oe(n>>4,t,e)}function Me(t,e){var r,n=4;for(r=0;8>r;++r)n+=t[e+r-32];Oe(n>>3,t,e)}function Ee(t,e){var r,n=4;for(r=0;8>r;++r)n+=t[e-1+32*r];Oe(n>>3,t,e)}function qe(t,e){Oe(128,t,e)}function De(t,e,r){var n=t[e-r],i=t[e+0],a=3*(i-n)+jn[1020+t[e-2*r]-t[e+r]],o=On[112+(a+4>>3)];t[e-r]=Bn[255+n+On[112+(a+3>>3)]],t[e+0]=Bn[255+i-o]}function Re(t,e,r,n){var i=t[e+0],a=t[e+r];return Mn[255+t[e-2*r]-t[e-r]]>n||Mn[255+a-i]>n}function Te(t,e,r,n){return 4*Mn[255+t[e-r]-t[e+0]]+Mn[255+t[e-2*r]-t[e+r]]<=n}function Ue(t,e,r,n,i){var a=t[e-3*r],o=t[e-2*r],s=t[e-r],c=t[e+0],u=t[e+r],l=t[e+2*r],h=t[e+3*r];return 4*Mn[255+s-c]+Mn[255+o-u]>n?0:Mn[255+t[e-4*r]-a]<=i&&Mn[255+a-o]<=i&&Mn[255+o-s]<=i&&Mn[255+h-l]<=i&&Mn[255+l-u]<=i&&Mn[255+u-c]<=i}function ze(t,e,r,n){var i=2*n+1;for(n=0;16>n;++n)Te(t,e+n,r,i)&&De(t,e+n,r)}function He(t,e,r,n){var i=2*n+1;for(n=0;16>n;++n)Te(t,e+n*r,1,i)&&De(t,e+n*r,1)}function We(t,e,r,n){var i;for(i=3;0<i;--i)ze(t,e+=4*r,r,n)}function Ve(t,e,r,n){var i;for(i=3;0<i;--i)He(t,e+=4,r,n)}function Ge(t,e,r,n,i,a,o,s){for(a=2*a+1;0<i--;){if(Ue(t,e,r,a,o))if(Re(t,e,r,s))De(t,e,r);else{var c=t,u=e,l=r,h=c[u-2*l],f=c[u-l],d=c[u+0],p=c[u+l],g=c[u+2*l],m=27*(b=jn[1020+3*(d-f)+jn[1020+h-p]])+63>>7,v=18*b+63>>7,b=9*b+63>>7;c[u-3*l]=Bn[255+c[u-3*l]+b],c[u-2*l]=Bn[255+h+v],c[u-l]=Bn[255+f+m],c[u+0]=Bn[255+d-m],c[u+l]=Bn[255+p-v],c[u+2*l]=Bn[255+g-b]}e+=n}}function Ye(t,e,r,n,i,a,o,s){for(a=2*a+1;0<i--;){if(Ue(t,e,r,a,o))if(Re(t,e,r,s))De(t,e,r);else{var c=t,u=e,l=r,h=c[u-l],f=c[u+0],d=c[u+l],p=On[112+((g=3*(f-h))+4>>3)],g=On[112+(g+3>>3)],m=p+1>>1;c[u-2*l]=Bn[255+c[u-2*l]+m],c[u-l]=Bn[255+h+g],c[u+0]=Bn[255+f-p],c[u+l]=Bn[255+d-m]}e+=n}}function Je(t,e,r,n,i,a){Ge(t,e,r,1,16,n,i,a)}function Xe(t,e,r,n,i,a){Ge(t,e,1,r,16,n,i,a)}function Ke(t,e,r,n,i,a){var o;for(o=3;0<o;--o)Ye(t,e+=4*r,r,1,16,n,i,a)}function Ze(t,e,r,n,i,a){var o;for(o=3;0<o;--o)Ye(t,e+=4,1,r,16,n,i,a)}function $e(t,e,r,n,i,a,o,s){Ge(t,e,i,1,8,a,o,s),Ge(r,n,i,1,8,a,o,s)}function Qe(t,e,r,n,i,a,o,s){Ge(t,e,1,i,8,a,o,s),Ge(r,n,1,i,8,a,o,s)}function tr(t,e,r,n,i,a,o,s){Ye(t,e+4*i,i,1,8,a,o,s),Ye(r,n+4*i,i,1,8,a,o,s)}function er(t,e,r,n,i,a,o,s){Ye(t,e+4,1,i,8,a,o,s),Ye(r,n+4,1,i,8,a,o,s)}function rr(){this.ba=new ot,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ct,this.memory=0,this.Ib=\"OutputFunc\",this.Jb=\"OutputAlphaFunc\",this.Nd=\"OutputRowFunc\"}function nr(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ir(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function ar(){this.ua=0,this.Wa=new M,this.vb=new M,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new h}function or(){this.xb=this.a=0,this.l=new Gt,this.ca=new ot,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new N,this.Pb=0,this.wd=new N,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new ar,this.ab=0,this.gc=o(4,ir),this.Oc=0}function sr(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Gt,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function cr(t,e,r,n,i,a,o){for(t=null==t?0:t[e+0],e=0;e<o;++e)i[a+e]=t+r[n+e]&255,t=i[a+e]}function ur(t,e,r,n,i,a,o){var s;if(null==t)cr(null,null,r,n,i,a,o);else for(s=0;s<o;++s)i[a+s]=t[e+s]+r[n+s]&255}function lr(t,e,r,n,i,a,o){if(null==t)cr(null,null,r,n,i,a,o);else{var s,c=t[e+0],u=c,l=c;for(s=0;s<o;++s)u=l+(c=t[e+s])-u,l=r[n+s]+(-256&u?0>u?0:255:u)&255,u=c,i[a+s]=l}}function hr(t,r,i,o){var s=r.width,c=r.o;if(e(null!=t&&null!=r),0>i||0>=o||i+o>c)return null;if(!t.Cc){if(null==t.ga){var u;if(t.ga=new sr,(u=null==t.ga)||(u=r.width*r.o,e(0==t.Gb.length),t.Gb=a(u),t.Uc=0,null==t.Gb?u=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,u=1),u=!u),!u){u=t.ga;var l=t.Fa,h=t.P,f=t.qc,d=t.mb,p=t.nb,g=h+1,m=f-1,b=u.l;if(e(null!=l&&null!=d&&null!=r),mi[0]=null,mi[1]=cr,mi[2]=ur,mi[3]=lr,u.ca=d,u.tb=p,u.c=r.width,u.i=r.height,e(0<u.c&&0<u.i),1>=f)r=0;else if(u.$a=l[h+0]>>0&3,u.Z=l[h+0]>>2&3,u.Lc=l[h+0]>>4&3,h=l[h+0]>>6&3,0>u.$a||1<u.$a||4<=u.Z||1<u.Lc||h)r=0;else if(b.put=dt,b.ac=ft,b.bc=pt,b.ma=u,b.width=r.width,b.height=r.height,b.Da=r.Da,b.v=r.v,b.va=r.va,b.j=r.j,b.o=r.o,u.$a)t:{e(1==u.$a),r=kt();e:for(;;){if(null==r){r=0;break t}if(e(null!=u),u.mc=r,r.c=u.c,r.i=u.i,r.l=u.l,r.l.ma=u,r.l.width=u.c,r.l.height=u.i,r.a=0,v(r.m,l,g,m),!Ft(u.c,u.i,1,r,null))break e;if(1==r.ab&&3==r.gc[0].hc&&At(r.s)?(u.ic=1,l=r.c*r.i,r.Ta=null,r.Ua=0,r.V=a(l),r.Ba=0,null==r.V?(r.a=1,r=0):r=1):(u.ic=0,r=It(r,u.c)),!r)break e;r=1;break t}u.mc=null,r=0}else r=m>=u.c*u.i;u=!r}if(u)return null;1!=t.ga.Lc?t.Ga=0:o=c-i}e(null!=t.ga),e(i+o<=c);t:{if(r=(l=t.ga).c,c=l.l.o,0==l.$a){if(g=t.rc,m=t.Vc,b=t.Fa,h=t.P+1+i*r,f=t.mb,d=t.nb+i*r,e(h<=t.P+t.qc),0!=l.Z)for(e(null!=mi[l.Z]),u=0;u<o;++u)mi[l.Z](g,m,b,h,f,d,r),g=f,m=d,d+=r,h+=r;else for(u=0;u<o;++u)n(f,d,b,h,r),g=f,m=d,d+=r,h+=r;t.rc=g,t.Vc=m}else{if(e(null!=l.mc),r=i+o,e(null!=(u=l.mc)),e(r<=u.i),u.C>=r)r=1;else if(l.ic||mr(),l.ic){l=u.V,g=u.Ba,m=u.c;var y=u.i,w=(b=1,h=u.$/m,f=u.$%m,d=u.m,p=u.s,u.$),N=m*y,L=m*r,x=p.wc,_=w<L?wt(p,f,h):null;e(w<=N),e(r<=y),e(At(p));e:for(;;){for(;!d.h&&w<L;){if(f&x||(_=wt(p,f,h)),e(null!=_),S(d),256>(y=bt(_.G[0],_.H[0],d)))l[g+w]=y,++w,++f>=m&&(f=0,++h<=r&&!(h%16)&&St(u,h));else{if(!(280>y)){b=0;break e}y=mt(y-256,d);var P,k=bt(_.G[4],_.H[4],d);if(S(d),!(w>=(k=vt(m,k=mt(k,d)))&&N-w>=y)){b=0;break e}for(P=0;P<y;++P)l[g+w+P]=l[g+w+P-k];for(w+=y,f+=y;f>=m;)f-=m,++h<=r&&!(h%16)&&St(u,h);w<L&&f&x&&(_=wt(p,f,h))}e(d.h==A(d))}St(u,h>r?r:h);break e}!b||d.h&&w<N?(b=0,u.a=d.h?5:3):u.$=w,r=b}else r=_t(u,u.V,u.Ba,u.c,u.i,r,Ct);if(!r){o=0;break t}}i+o>=c&&(t.Cc=1),o=1}if(!o)return null;if(t.Cc&&(null!=(o=t.ga)&&(o.mc=null),t.ga=null,0<t.Ga))return alert(\"todo:WebPDequantizeLevels\"),null}return t.nb+i*s}function fr(t,e,r,n,i,a){for(;0<i--;){var o,s=t,c=e+(r?1:0),u=t,l=e+(r?0:3);for(o=0;o<n;++o){var h=u[l+4*o];255!=h&&(h*=32897,s[c+4*o+0]=s[c+4*o+0]*h>>23,s[c+4*o+1]=s[c+4*o+1]*h>>23,s[c+4*o+2]=s[c+4*o+2]*h>>23)}e+=a}}function dr(t,e,r,n,i){for(;0<n--;){var a;for(a=0;a<r;++a){var o=t[e+2*a+0],s=15&(u=t[e+2*a+1]),c=4369*s,u=(240&u|u>>4)*c>>16;t[e+2*a+0]=(240&o|o>>4)*c>>16&240|(15&o|o<<4)*c>>16>>4&15,t[e+2*a+1]=240&u|s}e+=i}}function pr(t,e,r,n,i,a,o,s){var c,u,l=255;for(u=0;u<i;++u){for(c=0;c<n;++c){var h=t[e+c];a[o+4*c]=h,l&=h}e+=r,o+=s}return 255!=l}function gr(t,e,r,n,i){var a;for(a=0;a<i;++a)r[n+a]=t[e+a]>>8}function mr(){An=fr,xn=dr,Sn=pr,_n=gr}function vr(r,n,i){t[r]=function(t,r,a,o,s,c,u,l,h,f,d,p,g,m,v,b,y){var w,N=y-1>>1,L=s[c+0]|u[l+0]<<16,A=h[f+0]|d[p+0]<<16;e(null!=t);var x=3*L+A+131074>>2;for(n(t[r+0],255&x,x>>16,g,m),null!=a&&(x=3*A+L+131074>>2,n(a[o+0],255&x,x>>16,v,b)),w=1;w<=N;++w){var S=s[c+w]|u[l+w]<<16,_=h[f+w]|d[p+w]<<16,P=L+S+A+_+524296,k=P+2*(S+A)>>3;x=k+L>>1,L=(P=P+2*(L+_)>>3)+S>>1,n(t[r+2*w-1],255&x,x>>16,g,m+(2*w-1)*i),n(t[r+2*w-0],255&L,L>>16,g,m+(2*w-0)*i),null!=a&&(x=P+A>>1,L=k+_>>1,n(a[o+2*w-1],255&x,x>>16,v,b+(2*w-1)*i),n(a[o+2*w+0],255&L,L>>16,v,b+(2*w+0)*i)),L=S,A=_}1&y||(x=3*L+A+131074>>2,n(t[r+y-1],255&x,x>>16,g,m+(y-1)*i),null!=a&&(x=3*A+L+131074>>2,n(a[o+y-1],255&x,x>>16,v,b+(y-1)*i)))}}function br(){vi[En]=bi,vi[qn]=wi,vi[Dn]=yi,vi[Rn]=Ni,vi[Tn]=Li,vi[Un]=Ai,vi[zn]=xi,vi[Hn]=wi,vi[Wn]=Ni,vi[Vn]=Li,vi[Gn]=Ai}function yr(t){return t&~Ii?0>t?0:255:t>>Fi}function wr(t,e){return yr((19077*t>>8)+(26149*e>>8)-14234)}function Nr(t,e,r){return yr((19077*t>>8)-(6419*e>>8)-(13320*r>>8)+8708)}function Lr(t,e){return yr((19077*t>>8)+(33050*e>>8)-17685)}function Ar(t,e,r,n,i){n[i+0]=wr(t,r),n[i+1]=Nr(t,e,r),n[i+2]=Lr(t,e)}function xr(t,e,r,n,i){n[i+0]=Lr(t,e),n[i+1]=Nr(t,e,r),n[i+2]=wr(t,r)}function Sr(t,e,r,n,i){var a=Nr(t,e,r);e=a<<3&224|Lr(t,e)>>3,n[i+0]=248&wr(t,r)|a>>5,n[i+1]=e}function _r(t,e,r,n,i){var a=240&Lr(t,e)|15;n[i+0]=240&wr(t,r)|Nr(t,e,r)>>4,n[i+1]=a}function Pr(t,e,r,n,i){n[i+0]=255,Ar(t,e,r,n,i+1)}function kr(t,e,r,n,i){xr(t,e,r,n,i),n[i+3]=255}function Fr(t,e,r,n,i){Ar(t,e,r,n,i),n[i+3]=255}function Vt(t,e){return 0>t?0:t>e?e:t}function Ir(e,r,n){t[e]=function(t,e,i,a,o,s,c,u,l){for(var h=u+(-2&l)*n;u!=h;)r(t[e+0],i[a+0],o[s+0],c,u),r(t[e+1],i[a+0],o[s+0],c,u+n),e+=2,++a,++s,u+=2*n;1&l&&r(t[e+0],i[a+0],o[s+0],c,u)}}function Cr(t,e,r){return 0==r?0==t?0==e?6:5:0==e?4:0:r}function jr(t,e,r,n,i){switch(t>>>30){case 3:on(e,r,n,i,0);break;case 2:sn(e,r,n,i);break;case 1:un(e,r,n,i)}}function Or(t,e){var r,a,o=e.M,s=e.Nb,c=t.oc,u=t.pc+40,l=t.oc,h=t.pc+584,f=t.oc,d=t.pc+600;for(r=0;16>r;++r)c[u+32*r-1]=129;for(r=0;8>r;++r)l[h+32*r-1]=129,f[d+32*r-1]=129;for(0<o?c[u-1-32]=l[h-1-32]=f[d-1-32]=129:(i(c,u-32-1,127,21),i(l,h-32-1,127,9),i(f,d-32-1,127,9)),a=0;a<t.za;++a){var p=e.ya[e.aa+a];if(0<a){for(r=-1;16>r;++r)n(c,u+32*r-4,c,u+32*r+12,4);for(r=-1;8>r;++r)n(l,h+32*r-4,l,h+32*r+4,4),n(f,d+32*r-4,f,d+32*r+4,4)}var g=t.Gd,m=t.Hd+a,v=p.ad,b=p.Hc;if(0<o&&(n(c,u-32,g[m].y,0,16),n(l,h-32,g[m].f,0,8),n(f,d-32,g[m].ea,0,8)),p.Za){var y=c,w=u-32+16;for(0<o&&(a>=t.za-1?i(y,w,g[m].y[15],4):n(y,w,g[m+1].y,0,4)),r=0;4>r;r++)y[w+128+r]=y[w+256+r]=y[w+384+r]=y[w+0+r];for(r=0;16>r;++r,b<<=2)y=c,w=u+Di[r],fi[p.Ob[r]](y,w),jr(b,v,16*+r,y,w)}else if(y=Cr(a,o,p.Ob[0]),hi[y](c,u),0!=b)for(r=0;16>r;++r,b<<=2)jr(b,v,16*+r,c,u+Di[r]);for(r=p.Gc,y=Cr(a,o,p.Dd),di[y](l,h),di[y](f,d),b=v,y=l,w=h,255&(p=r>>0)&&(170&p?cn(b,256,y,w):ln(b,256,y,w)),p=f,b=d,255&(r>>=8)&&(170&r?cn(v,320,p,b):ln(v,320,p,b)),o<t.Ub-1&&(n(g[m].y,0,c,u+480,16),n(g[m].f,0,l,h+224,8),n(g[m].ea,0,f,d+224,8)),r=8*s*t.B,g=t.sa,m=t.ta+16*a+16*s*t.R,v=t.qa,p=t.ra+8*a+r,b=t.Ha,y=t.Ia+8*a+r,r=0;16>r;++r)n(g,m+r*t.R,c,u+32*r,16);for(r=0;8>r;++r)n(v,p+r*t.B,l,h+32*r,8),n(b,y+r*t.B,f,d+32*r,8)}}function Br(t,n,i,a,o,s,c,u,l){var h=[0],f=[0],d=0,p=null!=l?l.kd:0,g=null!=l?l:new nr;if(null==t||12>i)return 7;g.data=t,g.w=n,g.ha=i,n=[n],i=[i],g.gb=[g.gb];t:{var m=n,b=i,y=g.gb;if(e(null!=t),e(null!=b),e(null!=y),y[0]=0,12<=b[0]&&!r(t,m[0],\"RIFF\")){if(r(t,m[0]+8,\"WEBP\")){y=3;break t}var w=j(t,m[0]+4);if(12>w||4294967286<w){y=3;break t}if(p&&w>b[0]-8){y=7;break t}y[0]=w,m[0]+=12,b[0]-=12}y=0}if(0!=y)return y;for(w=0<g.gb[0],i=i[0];;){t:{var L=t;b=n,y=i;var A=h,x=f,S=m=[0];if((k=d=[d])[0]=0,8>y[0])y=7;else{if(!r(L,b[0],\"VP8X\")){if(10!=j(L,b[0]+4)){y=3;break t}if(18>y[0]){y=7;break t}var _=j(L,b[0]+8),P=1+C(L,b[0]+12);if(2147483648<=P*(L=1+C(L,b[0]+15))){y=3;break t}null!=S&&(S[0]=_),null!=A&&(A[0]=P),null!=x&&(x[0]=L),b[0]+=18,y[0]-=18,k[0]=1}y=0}}if(d=d[0],m=m[0],0!=y)return y;if(b=!!(2&m),!w&&d)return 3;if(null!=s&&(s[0]=!!(16&m)),null!=c&&(c[0]=b),null!=u&&(u[0]=0),c=h[0],m=f[0],d&&b&&null==l){y=0;break}if(4>i){y=7;break}if(w&&d||!w&&!d&&!r(t,n[0],\"ALPH\")){i=[i],g.na=[g.na],g.P=[g.P],g.Sa=[g.Sa];t:{_=t,y=n,w=i;var k=g.gb;A=g.na,x=g.P,S=g.Sa;P=22,e(null!=_),e(null!=w),L=y[0];var F=w[0];for(e(null!=A),e(null!=S),A[0]=null,x[0]=null,S[0]=0;;){if(y[0]=L,w[0]=F,8>F){y=7;break t}var I=j(_,L+4);if(4294967286<I){y=3;break t}var O=8+I+1&-2;if(P+=O,0<k&&P>k){y=3;break t}if(!r(_,L,\"VP8 \")||!r(_,L,\"VP8L\")){y=0;break t}if(F[0]<O){y=7;break t}r(_,L,\"ALPH\")||(A[0]=_,x[0]=L+8,S[0]=I),L+=O,F-=O}}if(i=i[0],g.na=g.na[0],g.P=g.P[0],g.Sa=g.Sa[0],0!=y)break}i=[i],g.Ja=[g.Ja],g.xa=[g.xa];t:if(k=t,y=n,w=i,A=g.gb[0],x=g.Ja,S=g.xa,_=y[0],L=!r(k,_,\"VP8 \"),P=!r(k,_,\"VP8L\"),e(null!=k),e(null!=w),e(null!=x),e(null!=S),8>w[0])y=7;else{if(L||P){if(k=j(k,_+4),12<=A&&k>A-12){y=3;break t}if(p&&k>w[0]-8){y=7;break t}x[0]=k,y[0]+=8,w[0]-=8,S[0]=P}else S[0]=5<=w[0]&&47==k[_+0]&&!(k[_+4]>>5),x[0]=w[0];y=0}if(i=i[0],g.Ja=g.Ja[0],g.xa=g.xa[0],n=n[0],0!=y)break;if(4294967286<g.Ja)return 3;if(null==u||b||(u[0]=g.xa?2:1),c=[c],m=[m],g.xa){if(5>i){y=7;break}u=c,p=m,b=s,null==t||5>i?t=0:5<=i&&47==t[n+0]&&!(t[n+4]>>5)?(w=[0],k=[0],A=[0],v(x=new N,t,n,i),gt(x,w,k,A)?(null!=u&&(u[0]=w[0]),null!=p&&(p[0]=k[0]),null!=b&&(b[0]=A[0]),t=1):t=0):t=0}else{if(10>i){y=7;break}u=m,null==t||10>i||!Xt(t,n+3,i-3)?t=0:(p=t[n+0]|t[n+1]<<8|t[n+2]<<16,b=16383&(t[n+7]<<8|t[n+6]),t=16383&(t[n+9]<<8|t[n+8]),1&p||3<(p>>1&7)||!(p>>4&1)||p>>5>=g.Ja||!b||!t?t=0:(c&&(c[0]=b),u&&(u[0]=t),t=1))}if(!t)return 3;if(c=c[0],m=m[0],d&&(h[0]!=c||f[0]!=m))return 3;null!=l&&(l[0]=g,l.offset=n-l.w,e(4294967286>n-l.w),e(l.offset==l.ha-i));break}return 0==y||7==y&&d&&null==l?(null!=s&&(s[0]|=null!=g.na&&0<g.na.length),null!=a&&(a[0]=c),null!=o&&(o[0]=m),0):y}function Mr(t,e,r){var n=e.width,i=e.height,a=0,o=0,s=n,c=i;if(e.Da=null!=t&&0<t.Da,e.Da&&(s=t.cd,c=t.bd,a=t.v,o=t.j,11>r||(a&=-2,o&=-2),0>a||0>o||0>=s||0>=c||a+s>n||o+c>i))return 0;if(e.v=a,e.j=o,e.va=a+s,e.o=o+c,e.U=s,e.T=c,e.da=null!=t&&0<t.da,e.da){if(!E(s,c,r=[t.ib],a=[t.hb]))return 0;e.ib=r[0],e.hb=a[0]}return e.ob=null!=t&&t.ob,e.Kb=null==t||!t.Sd,e.da&&(e.ob=e.ib<3*n/4&&e.hb<3*i/4,e.Kb=0),1}function Er(t){if(null==t)return 2;if(11>t.S){var e=t.f.RGBA;e.fb+=(t.height-1)*e.A,e.A=-e.A}else e=t.f.kb,t=t.height,e.O+=(t-1)*e.fa,e.fa=-e.fa,e.N+=(t-1>>1)*e.Ab,e.Ab=-e.Ab,e.W+=(t-1>>1)*e.Db,e.Db=-e.Db,null!=e.F&&(e.J+=(t-1)*e.lb,e.lb=-e.lb);return 0}function qr(t,e,r,n){if(null==n||0>=t||0>=e)return 2;if(null!=r){if(r.Da){var i=r.cd,o=r.bd,s=-2&r.v,c=-2&r.j;if(0>s||0>c||0>=i||0>=o||s+i>t||c+o>e)return 2;t=i,e=o}if(r.da){if(!E(t,e,i=[r.ib],o=[r.hb]))return 2;t=i[0],e=o[0]}}n.width=t,n.height=e;t:{var u=n.width,l=n.height;if(t=n.S,0>=u||0>=l||!(t>=En&&13>t))t=2;else{if(0>=n.Rd&&null==n.sd){s=o=i=e=0;var h=(c=u*zi[t])*l;if(11>t||(o=(l+1)/2*(e=(u+1)/2),12==t&&(s=(i=u)*l)),null==(l=a(h+2*o+s))){t=1;break t}n.sd=l,11>t?((u=n.f.RGBA).eb=l,u.fb=0,u.A=c,u.size=h):((u=n.f.kb).y=l,u.O=0,u.fa=c,u.Fd=h,u.f=l,u.N=0+h,u.Ab=e,u.Cd=o,u.ea=l,u.W=0+h+o,u.Db=e,u.Ed=o,12==t&&(u.F=l,u.J=0+h+2*o),u.Tc=s,u.lb=i)}if(e=1,i=n.S,o=n.width,s=n.height,i>=En&&13>i)if(11>i)t=n.f.RGBA,e&=(c=Math.abs(t.A))*(s-1)+o<=t.size,e&=c>=o*zi[i],e&=null!=t.eb;else{t=n.f.kb,c=(o+1)/2,h=(s+1)/2,u=Math.abs(t.fa);l=Math.abs(t.Ab);var f=Math.abs(t.Db),d=Math.abs(t.lb),p=d*(s-1)+o;e&=u*(s-1)+o<=t.Fd,e&=l*(h-1)+c<=t.Cd,e=(e&=f*(h-1)+c<=t.Ed)&u>=o&l>=c&f>=c,e&=null!=t.y,e&=null!=t.f,e&=null!=t.ea,12==i&&(e&=d>=o,e&=p<=t.Tc,e&=null!=t.F)}else e=0;t=e?0:2}}return 0!=t||null!=r&&r.fd&&(t=Er(n)),t}var Dr=64,Rr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Tr=24,Ur=32,zr=8,Hr=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];R(\"Predictor0\",\"PredictorAdd0\"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,e,r){return e[r+0]},t.Predictor3=function(t,e,r){return e[r+1]},t.Predictor4=function(t,e,r){return e[r-1]},t.Predictor5=function(t,e,r){return U(U(t,e[r+1]),e[r+0])},t.Predictor6=function(t,e,r){return U(t,e[r-1])},t.Predictor7=function(t,e,r){return U(t,e[r+0])},t.Predictor8=function(t,e,r){return U(e[r-1],e[r+0])},t.Predictor9=function(t,e,r){return U(e[r+0],e[r+1])},t.Predictor10=function(t,e,r){return U(U(t,e[r-1]),U(e[r+0],e[r+1]))},t.Predictor11=function(t,e,r){var n=e[r+0];return 0>=W(n>>24&255,t>>24&255,(e=e[r-1])>>24&255)+W(n>>16&255,t>>16&255,e>>16&255)+W(n>>8&255,t>>8&255,e>>8&255)+W(255&n,255&t,255&e)?n:t},t.Predictor12=function(t,e,r){var n=e[r+0];return(z((t>>24&255)+(n>>24&255)-((e=e[r-1])>>24&255))<<24|z((t>>16&255)+(n>>16&255)-(e>>16&255))<<16|z((t>>8&255)+(n>>8&255)-(e>>8&255))<<8|z((255&t)+(255&n)-(255&e)))>>>0},t.Predictor13=function(t,e,r){var n=e[r-1];return(H((t=U(t,e[r+0]))>>24&255,n>>24&255)<<24|H(t>>16&255,n>>16&255)<<16|H(t>>8&255,n>>8&255)<<8|H(t>>0&255,n>>0&255))>>>0};var Wr=t.PredictorAdd0;t.PredictorAdd1=V,R(\"Predictor2\",\"PredictorAdd2\"),R(\"Predictor3\",\"PredictorAdd3\"),R(\"Predictor4\",\"PredictorAdd4\"),R(\"Predictor5\",\"PredictorAdd5\"),R(\"Predictor6\",\"PredictorAdd6\"),R(\"Predictor7\",\"PredictorAdd7\"),R(\"Predictor8\",\"PredictorAdd8\"),R(\"Predictor9\",\"PredictorAdd9\"),R(\"Predictor10\",\"PredictorAdd10\"),R(\"Predictor11\",\"PredictorAdd11\"),R(\"Predictor12\",\"PredictorAdd12\"),R(\"Predictor13\",\"PredictorAdd13\");var Vr=t.PredictorAdd2;X(\"ColorIndexInverseTransform\",\"MapARGB\",\"32b\",(function(t){return t>>8&255}),(function(t){return t})),X(\"VP8LColorIndexInverseTransformAlpha\",\"MapAlpha\",\"8b\",(function(t){return t}),(function(t){return t>>8&255}));var Gr,Yr=t.ColorIndexInverseTransform,Jr=t.MapARGB,Xr=t.VP8LColorIndexInverseTransformAlpha,Kr=t.MapAlpha,Zr=t.VP8LPredictorsAdd=[];Zr.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var $r,Qr,tn,en,rn,nn,an,on,sn,cn,un,ln,hn,fn,dn,pn,gn,mn,vn,bn,yn,wn,Nn,Ln,An,xn,Sn,_n,Pn=a(511),kn=a(2041),Fn=a(225),In=a(767),Cn=0,jn=kn,On=Fn,Bn=In,Mn=Pn,En=0,qn=1,Dn=2,Rn=3,Tn=4,Un=5,zn=6,Hn=7,Wn=8,Vn=9,Gn=10,Yn=[2,3,7],Jn=[3,3,11],Xn=[280,256,256,256,40],Kn=[0,1,1,1,0],Zn=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],$n=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Qn=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ti=8,ei=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ri=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ni=null,ii=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],ai=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],oi=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],si=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ci=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ui=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],li=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],hi=[],fi=[],di=[],pi=1,gi=2,mi=[],vi=[];vr(\"UpsampleRgbLinePair\",Ar,3),vr(\"UpsampleBgrLinePair\",xr,3),vr(\"UpsampleRgbaLinePair\",Fr,4),vr(\"UpsampleBgraLinePair\",kr,4),vr(\"UpsampleArgbLinePair\",Pr,4),vr(\"UpsampleRgba4444LinePair\",_r,2),vr(\"UpsampleRgb565LinePair\",Sr,2);var bi=t.UpsampleRgbLinePair,yi=t.UpsampleBgrLinePair,wi=t.UpsampleRgbaLinePair,Ni=t.UpsampleBgraLinePair,Li=t.UpsampleArgbLinePair,Ai=t.UpsampleRgba4444LinePair,xi=t.UpsampleRgb565LinePair,Si=16,_i=1<<Si-1,Pi=-227,ki=482,Fi=6,Ii=(256<<Fi)-1,Ci=0,ji=a(256),Oi=a(256),Bi=a(256),Mi=a(256),Ei=a(ki-Pi),qi=a(ki-Pi);Ir(\"YuvToRgbRow\",Ar,3),Ir(\"YuvToBgrRow\",xr,3),Ir(\"YuvToRgbaRow\",Fr,4),Ir(\"YuvToBgraRow\",kr,4),Ir(\"YuvToArgbRow\",Pr,4),Ir(\"YuvToRgba4444Row\",_r,2),Ir(\"YuvToRgb565Row\",Sr,2);var Di=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Ri=[0,2,8],Ti=[8,7,6,4,4,2,2,2,1,1,1,1],Ui=1;this.WebPDecodeRGBA=function(t,r,n,i,a){var o=qn,s=new rr,c=new ot;s.ba=c,c.S=o,c.width=[c.width],c.height=[c.height];var u=c.width,l=c.height,h=new st;if(null==h||null==t)var f=2;else e(null!=h),f=Br(t,r,n,h.width,h.height,h.Pd,h.Qd,h.format,null);if(0!=f?u=0:(null!=u&&(u[0]=h.width[0]),null!=l&&(l[0]=h.height[0]),u=1),u){c.width=c.width[0],c.height=c.height[0],null!=i&&(i[0]=c.width),null!=a&&(a[0]=c.height);t:{if(i=new Gt,(a=new nr).data=t,a.w=r,a.ha=n,a.kd=1,r=[0],e(null!=a),(0==(t=Br(a.data,a.w,a.ha,null,null,null,r,null,a))||7==t)&&r[0]&&(t=4),0==(r=t)){if(e(null!=s),i.data=a.data,i.w=a.w+a.offset,i.ha=a.ha-a.offset,i.put=dt,i.ac=ft,i.bc=pt,i.ma=s,a.xa){if(null==(t=kt())){s=1;break t}if(function(t,r){var n=[0],i=[0],a=[0];e:for(;;){if(null==t)return 0;if(null==r)return t.a=2,0;if(t.l=r,t.a=0,v(t.m,r.data,r.w,r.ha),!gt(t.m,n,i,a)){t.a=3;break e}if(t.xb=gi,r.width=n[0],r.height=i[0],!Ft(n[0],i[0],1,t,null))break e;return 1}return e(0!=t.a),0}(t,i)){if(i=0==(r=qr(i.width,i.height,s.Oa,s.ba))){e:{i=t;r:for(;;){if(null==i){i=0;break e}if(e(null!=i.s.yc),e(null!=i.s.Ya),e(0<i.s.Wb),e(null!=(n=i.l)),e(null!=(a=n.ma)),0!=i.xb){if(i.ca=a.ba,i.tb=a.tb,e(null!=i.ca),!Mr(a.Oa,n,Rn)){i.a=2;break r}if(!It(i,n.width))break r;if(n.da)break r;if((n.da||nt(i.ca.S))&&mr(),11>i.ca.S||(alert(\"todo:WebPInitConvertARGBToYUV\"),null!=i.ca.f.kb.F&&mr()),i.Pb&&0<i.s.ua&&null==i.s.vb.X&&!O(i.s.vb,i.s.Wa.Xa)){i.a=1;break r}i.xb=0}if(!_t(i,i.V,i.Ba,i.c,i.i,n.o,Lt))break r;a.Dc=i.Ma,i=1;break e}e(0!=i.a),i=0}i=!i}i&&(r=t.a)}else r=t.a}else{if(null==(t=new Yt)){s=1;break t}if(t.Fa=a.na,t.P=a.P,t.qc=a.Sa,Kt(t,i)){if(0==(r=qr(i.width,i.height,s.Oa,s.ba))){if(t.Aa=0,n=s.Oa,e(null!=(a=t)),null!=n){if(0<(u=0>(u=n.Md)?0:100<u?255:255*u/100)){for(l=h=0;4>l;++l)12>(f=a.pb[l]).lc&&(f.ia=u*Ti[0>f.lc?0:f.lc]>>3),h|=f.ia;h&&(alert(\"todo:VP8InitRandom\"),a.ia=1)}a.Ga=n.Id,100<a.Ga?a.Ga=100:0>a.Ga&&(a.Ga=0)}Qt(t,i)||(r=t.a)}}else r=t.a}0==r&&null!=s.Oa&&s.Oa.fd&&(r=Er(s.ba))}s=r}o=0!=s?null:11>o?c.f.RGBA.eb:c.f.kb.y}else o=null;return o};var zi=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(t,e){for(var r=\"\",n=0;n<4;n++)r+=String.fromCharCode(t[e++]);return r}function l(t,e){return(t[e+0]<<0|t[e+1]<<8|t[e+2]<<16)>>>0}function h(t,e){return(t[e+0]<<0|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}new c;var f=[0],d=[0],p=[],g=new c,m=t,v=function(t,e){var r={},n=0,i=!1,a=0,o=0;if(r.frames=[],!\n /** @license\n      * Copyright (c) 2017 Dominik Homberger\n     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n     https://webpjs.appspot.com\n     WebPRiffParser dominikhlbg@gmail.com\n     */\n function(t,e,r,n){for(var i=0;i<n;i++)if(t[e+i]!=r.charCodeAt(i))return!0;return!1}(t,e,\"RIFF\",4)){var s,c;h(t,e+=4);for(e+=8;e<t.length;){var f=u(t,e),d=h(t,e+=4);e+=4;var p=d+(1&d);switch(f){case\"VP8 \":case\"VP8L\":void 0===r.frames[n]&&(r.frames[n]={});(v=r.frames[n]).src_off=i?o:e-8,v.src_size=a+d+8,n++,i&&(i=!1,a=0,o=0);break;case\"VP8X\":(v=r.header={}).feature_flags=t[e];var g=e+4;v.canvas_width=1+l(t,g);g+=3;v.canvas_height=1+l(t,g);g+=3;break;case\"ALPH\":i=!0,a=p+8,o=e-8;break;case\"ANIM\":(v=r.header).bgcolor=h(t,e);g=e+4;v.loop_count=(s=t)[(c=g)+0]<<0|s[c+1]<<8;g+=2;break;case\"ANMF\":var m,v;(v=r.frames[n]={}).offset_x=2*l(t,e),e+=3,v.offset_y=2*l(t,e),e+=3,v.width=1+l(t,e),e+=3,v.height=1+l(t,e),e+=3,v.duration=l(t,e),e+=3,m=t[e++],v.dispose=1&m,v.blend=m>>1&1}\"ANMF\"!=f&&(e+=p)}return r}}(m,0);v.response=m,v.rgbaoutput=!0,v.dataurl=!1;var b=v.header?v.header:null,y=v.frames?v.frames:null;if(b){b.loop_counter=b.loop_count,f=[b.canvas_height],d=[b.canvas_width];for(var w=0;w<y.length&&0!=y[w].blend;w++);}var N=y[0],L=g.WebPDecodeRGBA(m,N.src_off,N.src_size,d,f);N.rgba=L,N.imgwidth=d[0],N.imgheight=f[0];for(var A=0;A<d[0]*f[0]*4;A++)p[A]=L[A];return this.width=d,this.height=f,this.data=p,this}!function(t){var e=function(){return!0},r=function(e,r,i,u){var l=4,h=o;switch(u){case t.image_compression.FAST:l=1,h=a;break;case t.image_compression.MEDIUM:l=6,h=s;break;case t.image_compression.SLOW:l=9,h=c}var f=_e(e=n(e,r,i,h),{level:l});return t.__addimage__.arrayBufferToBinaryString(f)},n=function(t,e,r,n){for(var i,a,o,s=t.length/e,c=new Uint8Array(t.length+s),u=l(),f=0;f<s;f+=1){if(o=f*e,i=t.subarray(o,o+e),n)c.set(n(i,r,a),o+f);else{for(var d,p=u.length,g=[];d<p;d+=1)g[d]=u[d](i,r,a);var m=h(g.concat());c.set(g[m],o+f)}a=i}return c},i=function(t){var e=Array.apply([],t);return e.unshift(0),e},a=function(t,e){var r,n=[],i=t.length;n[0]=1;for(var a=0;a<i;a+=1)r=t[a-e]||0,n[a+1]=t[a]-r+256&255;return n},o=function(t,e,r){var n,i=[],a=t.length;i[0]=2;for(var o=0;o<a;o+=1)n=r&&r[o]||0,i[o+1]=t[o]-n+256&255;return i},s=function(t,e,r){var n,i,a=[],o=t.length;a[0]=3;for(var s=0;s<o;s+=1)n=t[s-e]||0,i=r&&r[s]||0,a[s+1]=t[s]+256-(n+i>>>1)&255;return a},c=function(t,e,r){var n,i,a,o,s=[],c=t.length;s[0]=4;for(var l=0;l<c;l+=1)n=t[l-e]||0,i=r&&r[l]||0,a=r&&r[l-e]||0,o=u(n,i,a),s[l+1]=t[l]-o+256&255;return s},u=function(t,e,r){if(t===e&&e===r)return t;var n=Math.abs(e-r),i=Math.abs(t-r),a=Math.abs(t+e-r-r);return n<=i&&n<=a?t:i<=a?e:r},l=function(){return[i,a,o,s,c]},h=function(t){var e=t.map((function(t){return t.reduce((function(t,e){return t+Math.abs(e)}),0)}));return e.indexOf(Math.min.apply(null,e))};t.processPNG=function(n,i,a,o){var s,c,u,l,h,f,d,p,g,m,v,b,y,w,N,L=this.decode.FLATE_DECODE,A=\"\";if(this.__addimage__.isArrayBuffer(n)&&(n=new Uint8Array(n)),this.__addimage__.isArrayBufferView(n)){if(n=(u=new Oe(n)).imgData,c=u.bits,s=u.colorSpace,h=u.colors,-1!==[4,6].indexOf(u.colorType)){if(8===u.bits){g=(p=32==u.pixelBitlength?new Uint32Array(u.decodePixels().buffer):16==u.pixelBitlength?new Uint16Array(u.decodePixels().buffer):new Uint8Array(u.decodePixels().buffer)).length,v=new Uint8Array(g*u.colors),m=new Uint8Array(g);var x,S=u.pixelBitlength-u.bits;for(w=0,N=0;w<g;w++){for(y=p[w],x=0;x<S;)v[N++]=y>>>x&255,x+=u.bits;m[w]=y>>>x&255}}if(16===u.bits){g=(p=new Uint32Array(u.decodePixels().buffer)).length,v=new Uint8Array(g*(32/u.pixelBitlength)*u.colors),m=new Uint8Array(g*(32/u.pixelBitlength)),b=u.colors>1,w=0,N=0;for(var _=0;w<g;)y=p[w++],v[N++]=y>>>0&255,b&&(v[N++]=y>>>16&255,y=p[w++],v[N++]=y>>>0&255),m[_++]=y>>>16&255;c=8}o!==t.image_compression.NONE&&e()?(n=r(v,u.width*u.colors,u.colors,o),d=r(m,u.width,1,o)):(n=v,d=m,L=void 0)}if(3===u.colorType&&(s=this.color_spaces.INDEXED,f=u.palette,u.transparency.indexed)){var P=u.transparency.indexed,k=0;for(w=0,g=P.length;w<g;++w)k+=P[w];if((k/=255)===g-1&&-1!==P.indexOf(0))l=[P.indexOf(0)];else if(k!==g){for(p=u.decodePixels(),m=new Uint8Array(p.length),w=0,g=p.length;w<g;w++)m[w]=P[p[w]];d=r(m,u.width,1)}}var F=function(e){var r;switch(e){case t.image_compression.FAST:r=11;break;case t.image_compression.MEDIUM:r=13;break;case t.image_compression.SLOW:r=14;break;default:r=12}return r}(o);return L===this.decode.FLATE_DECODE&&(A=\"/Predictor \"+F+\" \"),A+=\"/Colors \"+h+\" /BitsPerComponent \"+c+\" /Columns \"+u.width,(this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n))&&(n=this.__addimage__.arrayBufferToBinaryString(n)),(d&&this.__addimage__.isArrayBuffer(d)||this.__addimage__.isArrayBufferView(d))&&(d=this.__addimage__.arrayBufferToBinaryString(d)),{alias:a,data:n,index:i,filter:L,decodeParameters:A,transparency:l,palette:f,sMask:d,predictor:F,width:u.width,height:u.height,bitsPerComponent:c,colorSpace:s}}}}(M.API),function(t){t.processGIF89A=function(e,r,n,i){var a=new Be(e),o=a.width,s=a.height,c=[];a.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:o,height:s},l=new Ee(100).encode(u,100);return t.processJPEG.call(this,l,r,n,i)},t.processGIF87A=t.processGIF89A}(M.API),qe.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},qe.prototype.parseBGR=function(){this.pos=this.offset;try{var t=\"bit\"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(t){i.log(\"bit decode error:\"+t)}},qe.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),r=e%4;for(t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var c=this.palette[a>>7-s&1];this.data[o+4*s]=c.blue,this.data[o+4*s+1]=c.green,this.data[o+4*s+2]=c.red,this.data[o+4*s+3]=255}0!==r&&(this.pos+=4-r)}},qe.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*i*4,s=a>>4,c=15&a,u=this.palette[s];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*i+1>=this.width)break;u=this.palette[c],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}0!==e&&(this.pos+=4-e)}},qe.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}0!==t&&(this.pos+=4-t)}},qe.prototype.bit15=function(){for(var t=this.width%3,e=parseInt(\"11111\",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,c=(a>>10&e)/e*255|0,u=a>>15?255:0,l=n*this.width*4+4*i;this.data[l]=c,this.data[l+1]=s,this.data[l+2]=o,this.data[l+3]=u}this.pos+=t}},qe.prototype.bit16=function(){for(var t=this.width%3,e=parseInt(\"11111\",2),r=parseInt(\"111111\",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,c=(o>>5&r)/r*255|0,u=(o>>11)/e*255|0,l=i*this.width*4+4*a;this.data[l]=u,this.data[l+1]=c,this.data[l+2]=s,this.data[l+3]=255}this.pos+=t}},qe.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*r;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},qe.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*r;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=n,this.data[s+3]=o}},qe.prototype.getData=function(){return this.data},\n /**\n    * @license\n    * Copyright (c) 2018 Aras Abbasi\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){t.processBMP=function(e,r,n,i){var a=new qe(e,!1),o=a.width,s=a.height,c={data:a.getData(),width:o,height:s},u=new Ee(100).encode(c,100);return t.processJPEG.call(this,u,r,n,i)}}(M.API),De.prototype.getData=function(){return this.data},\n /**\n    * @license\n    * Copyright (c) 2019 Aras Abbasi\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){t.processWEBP=function(e,r,n,i){var a=new De(e,!1),o=a.width,s=a.height,c={data:a.getData(),width:o,height:s},u=new Ee(100).encode(c,100);return t.processJPEG.call(this,u,r,n,i)}}(M.API),\n /**\n    * @license\n    *\n    * Copyright (c) 2021 Antti Palola, https://github.com/Pantura\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining\n    * a copy of this software and associated documentation files (the\n    * \"Software\"), to deal in the Software without restriction, including\n    * without limitation the rights to use, copy, modify, merge, publish,\n    * distribute, sublicense, and/or sell copies of the Software, and to\n    * permit persons to whom the Software is furnished to do so, subject to\n    * the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be\n    * included in all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n    * ====================================================================\n    */\n function(t){t.processRGBA=function(t,e,r){for(var n=t.data,i=n.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,c=0,u=0;u<i;u+=4){var l=n[u],h=n[u+1],f=n[u+2],d=n[u+3];a[s++]=l,a[s++]=h,a[s++]=f,o[c++]=d}var p=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:p,index:e,alias:r,colorSpace:\"DeviceRGB\",bitsPerComponent:8,width:t.width,height:t.height}}}(M.API),\n /**\n    * @license\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){t.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:\"Afrikaans\",sq:\"Albanian\",ar:\"Arabic (Standard)\",\"ar-DZ\":\"Arabic (Algeria)\",\"ar-BH\":\"Arabic (Bahrain)\",\"ar-EG\":\"Arabic (Egypt)\",\"ar-IQ\":\"Arabic (Iraq)\",\"ar-JO\":\"Arabic (Jordan)\",\"ar-KW\":\"Arabic (Kuwait)\",\"ar-LB\":\"Arabic (Lebanon)\",\"ar-LY\":\"Arabic (Libya)\",\"ar-MA\":\"Arabic (Morocco)\",\"ar-OM\":\"Arabic (Oman)\",\"ar-QA\":\"Arabic (Qatar)\",\"ar-SA\":\"Arabic (Saudi Arabia)\",\"ar-SY\":\"Arabic (Syria)\",\"ar-TN\":\"Arabic (Tunisia)\",\"ar-AE\":\"Arabic (U.A.E.)\",\"ar-YE\":\"Arabic (Yemen)\",an:\"Aragonese\",hy:\"Armenian\",as:\"Assamese\",ast:\"Asturian\",az:\"Azerbaijani\",eu:\"Basque\",be:\"Belarusian\",bn:\"Bengali\",bs:\"Bosnian\",br:\"Breton\",bg:\"Bulgarian\",my:\"Burmese\",ca:\"Catalan\",ch:\"Chamorro\",ce:\"Chechen\",zh:\"Chinese\",\"zh-HK\":\"Chinese (Hong Kong)\",\"zh-CN\":\"Chinese (PRC)\",\"zh-SG\":\"Chinese (Singapore)\",\"zh-TW\":\"Chinese (Taiwan)\",cv:\"Chuvash\",co:\"Corsican\",cr:\"Cree\",hr:\"Croatian\",cs:\"Czech\",da:\"Danish\",nl:\"Dutch (Standard)\",\"nl-BE\":\"Dutch (Belgian)\",en:\"English\",\"en-AU\":\"English (Australia)\",\"en-BZ\":\"English (Belize)\",\"en-CA\":\"English (Canada)\",\"en-IE\":\"English (Ireland)\",\"en-JM\":\"English (Jamaica)\",\"en-NZ\":\"English (New Zealand)\",\"en-PH\":\"English (Philippines)\",\"en-ZA\":\"English (South Africa)\",\"en-TT\":\"English (Trinidad & Tobago)\",\"en-GB\":\"English (United Kingdom)\",\"en-US\":\"English (United States)\",\"en-ZW\":\"English (Zimbabwe)\",eo:\"Esperanto\",et:\"Estonian\",fo:\"Faeroese\",fj:\"Fijian\",fi:\"Finnish\",fr:\"French (Standard)\",\"fr-BE\":\"French (Belgium)\",\"fr-CA\":\"French (Canada)\",\"fr-FR\":\"French (France)\",\"fr-LU\":\"French (Luxembourg)\",\"fr-MC\":\"French (Monaco)\",\"fr-CH\":\"French (Switzerland)\",fy:\"Frisian\",fur:\"Friulian\",gd:\"Gaelic (Scots)\",\"gd-IE\":\"Gaelic (Irish)\",gl:\"Galacian\",ka:\"Georgian\",de:\"German (Standard)\",\"de-AT\":\"German (Austria)\",\"de-DE\":\"German (Germany)\",\"de-LI\":\"German (Liechtenstein)\",\"de-LU\":\"German (Luxembourg)\",\"de-CH\":\"German (Switzerland)\",el:\"Greek\",gu:\"Gujurati\",ht:\"Haitian\",he:\"Hebrew\",hi:\"Hindi\",hu:\"Hungarian\",is:\"Icelandic\",id:\"Indonesian\",iu:\"Inuktitut\",ga:\"Irish\",it:\"Italian (Standard)\",\"it-CH\":\"Italian (Switzerland)\",ja:\"Japanese\",kn:\"Kannada\",ks:\"Kashmiri\",kk:\"Kazakh\",km:\"Khmer\",ky:\"Kirghiz\",tlh:\"Klingon\",ko:\"Korean\",\"ko-KP\":\"Korean (North Korea)\",\"ko-KR\":\"Korean (South Korea)\",la:\"Latin\",lv:\"Latvian\",lt:\"Lithuanian\",lb:\"Luxembourgish\",mk:\"North Macedonia\",ms:\"Malay\",ml:\"Malayalam\",mt:\"Maltese\",mi:\"Maori\",mr:\"Marathi\",mo:\"Moldavian\",nv:\"Navajo\",ng:\"Ndonga\",ne:\"Nepali\",no:\"Norwegian\",nb:\"Norwegian (Bokmal)\",nn:\"Norwegian (Nynorsk)\",oc:\"Occitan\",or:\"Oriya\",om:\"Oromo\",fa:\"Persian\",\"fa-IR\":\"Persian/Iran\",pl:\"Polish\",pt:\"Portuguese\",\"pt-BR\":\"Portuguese (Brazil)\",pa:\"Punjabi\",\"pa-IN\":\"Punjabi (India)\",\"pa-PK\":\"Punjabi (Pakistan)\",qu:\"Quechua\",rm:\"Rhaeto-Romanic\",ro:\"Romanian\",\"ro-MO\":\"Romanian (Moldavia)\",ru:\"Russian\",\"ru-MO\":\"Russian (Moldavia)\",sz:\"Sami (Lappish)\",sg:\"Sango\",sa:\"Sanskrit\",sc:\"Sardinian\",sd:\"Sindhi\",si:\"Singhalese\",sr:\"Serbian\",sk:\"Slovak\",sl:\"Slovenian\",so:\"Somani\",sb:\"Sorbian\",es:\"Spanish\",\"es-AR\":\"Spanish (Argentina)\",\"es-BO\":\"Spanish (Bolivia)\",\"es-CL\":\"Spanish (Chile)\",\"es-CO\":\"Spanish (Colombia)\",\"es-CR\":\"Spanish (Costa Rica)\",\"es-DO\":\"Spanish (Dominican Republic)\",\"es-EC\":\"Spanish (Ecuador)\",\"es-SV\":\"Spanish (El Salvador)\",\"es-GT\":\"Spanish (Guatemala)\",\"es-HN\":\"Spanish (Honduras)\",\"es-MX\":\"Spanish (Mexico)\",\"es-NI\":\"Spanish (Nicaragua)\",\"es-PA\":\"Spanish (Panama)\",\"es-PY\":\"Spanish (Paraguay)\",\"es-PE\":\"Spanish (Peru)\",\"es-PR\":\"Spanish (Puerto Rico)\",\"es-ES\":\"Spanish (Spain)\",\"es-UY\":\"Spanish (Uruguay)\",\"es-VE\":\"Spanish (Venezuela)\",sx:\"Sutu\",sw:\"Swahili\",sv:\"Swedish\",\"sv-FI\":\"Swedish (Finland)\",\"sv-SV\":\"Swedish (Sweden)\",ta:\"Tamil\",tt:\"Tatar\",te:\"Teluga\",th:\"Thai\",tig:\"Tigre\",ts:\"Tsonga\",tn:\"Tswana\",tr:\"Turkish\",tk:\"Turkmen\",uk:\"Ukrainian\",hsb:\"Upper Sorbian\",ur:\"Urdu\",ve:\"Venda\",vi:\"Vietnamese\",vo:\"Volapuk\",wa:\"Walloon\",cy:\"Welsh\",xh:\"Xhosa\",ji:\"Yiddish\",zu:\"Zulu\"}[t]&&(this.internal.languageSettings.languageCode=t,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe(\"putCatalog\",(function(){this.internal.write(\"/Lang (\"+this.internal.languageSettings.languageCode+\")\")})),this.internal.languageSettings.isSubscribed=!0)),this}}(M.API),ke=M.API,Fe=ke.getCharWidthsArray=function(t,r){var n,i,a=(r=r||{}).font||this.internal.getFont(),o=r.fontSize||this.internal.getFontSize(),s=r.charSpace||this.internal.getCharSpace(),c=r.widths?r.widths:a.metadata.Unicode.widths,u=c.fof?c.fof:1,l=r.kerning?r.kerning:a.metadata.Unicode.kerning,h=l.fof?l.fof:1,f=!1!==r.doKerning,d=0,p=t.length,g=0,m=c[0]||u,v=[];for(n=0;n<p;n++)i=t.charCodeAt(n),\"function\"==typeof a.metadata.widthOfString?v.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(i))+s*(1e3/o)||0)/1e3):(d=f&&\"object\"===e(l[i])&&!isNaN(parseInt(l[i][g],10))?l[i][g]/h:0,v.push((c[i]||m)/u+d)),g=i;return v},Ie=ke.getStringUnitWidth=function(t,e){var r=(e=e||{}).fontSize||this.internal.getFontSize(),n=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return ke.processArabic&&(t=ke.processArabic(t)),\"function\"==typeof n.metadata.widthOfString?n.metadata.widthOfString(t,r,i)/r:Fe.apply(this,arguments).reduce((function(t,e){return t+e}),0)},Ce=function(t,e,r,n){for(var i=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<r;)s+=e[a],a++;i.push(t.slice(0,a));var c=a;for(s=0;a!==o;)s+e[a]>n&&(i.push(t.slice(c,a)),s=0,c=a),s+=e[a],a++;return c!==a&&i.push(t.slice(c,a)),i},je=function(t,e,r){r||(r={});var n,i,a,o,s,c,u,l=[],h=[l],f=r.textIndent||0,d=0,p=0,g=t.split(\" \"),m=Fe.apply(this,[\" \",r])[0];if(c=-1===r.lineIndent?g[0].length+2:r.lineIndent||0){var v=Array(c).join(\" \"),b=[];g.map((function(t){(t=t.split(/\\s*\\n/)).length>1?b=b.concat(t.map((function(t,e){return(e&&t.length?\"\\n\":\"\")+t}))):b.push(t[0])})),g=b,c=Ie.apply(this,[v,r])}for(a=0,o=g.length;a<o;a++){var y=0;if(n=g[a],c&&\"\\n\"==n[0]&&(n=n.substr(1),y=1),f+d+(p=(i=Fe.apply(this,[n,r])).reduce((function(t,e){return t+e}),0))>e||y){if(p>e){for(s=Ce.apply(this,[n,i,e-(f+d),e]),l.push(s.shift()),l=[s.pop()];s.length;)h.push([s.shift()]);p=i.slice(n.length-(l[0]?l[0].length:0)).reduce((function(t,e){return t+e}),0)}else l=[n];h.push(l),f=p+c,d=m}else l.push(n),f+=d+p,d=m}return u=c?function(t,e){return(e?v:\"\")+t.join(\" \")}:function(t){return t.join(\" \")},h.map(u)},ke.splitTextToSize=function(t,e,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),a=function(t){if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var e=this.internal.getFont(t.fontName,t.fontStyle);return e.metadata.Unicode?{widths:e.metadata.Unicode.widths||{0:1},kerning:e.metadata.Unicode.kerning||{}}:{font:e.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,r);n=Array.isArray(t)?t:String(t).split(/\\r?\\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=r.lineIndent;var s,c,u=[];for(s=0,c=n.length;s<c;s++)u=u.concat(je.apply(this,[n[s],o,a]));return u},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var r=\"klmnopqrstuvwxyz\",n={},i={},a=0;a<r.length;a++)n[r[a]]=\"0123456789abcdef\"[a],i[\"0123456789abcdef\"[a]]=r[a];var o=function(t){return\"0x\"+parseInt(t,10).toString(16)},s=t.__fontmetrics__.compress=function(t){var r,n,a,c,u=[\"{\"];for(var l in t){if(r=t[l],isNaN(parseInt(l,10))?n=\"'\"+l+\"'\":(l=parseInt(l,10),n=(n=o(l).slice(2)).slice(0,-1)+i[n.slice(-1)]),\"number\"==typeof r)r<0?(a=o(r).slice(3),c=\"-\"):(a=o(r).slice(2),c=\"\"),a=c+a.slice(0,-1)+i[a.slice(-1)];else{if(\"object\"!==e(r))throw new Error(\"Don't know what to do with value type \"+e(r)+\".\");a=s(r)}u.push(n+a)}return u.push(\"}\"),u.join(\"\")},c=t.__fontmetrics__.uncompress=function(t){if(\"string\"!=typeof t)throw new Error(\"Invalid argument passed to uncompress.\");for(var e,r,i,a,o={},s=1,c=o,u=[],l=\"\",h=\"\",f=t.length-1,d=1;d<f;d+=1)\"'\"==(a=t[d])?e?(i=e.join(\"\"),e=void 0):e=[]:e?e.push(a):\"{\"==a?(u.push([c,i]),c={},i=void 0):\"}\"==a?((r=u.pop())[0][r[1]]=c,i=void 0,c=r[0]):\"-\"==a?s=-1:void 0===i?n.hasOwnProperty(a)?(l+=n[a],i=parseInt(l,16)*s,s=1,l=\"\"):l+=a:n.hasOwnProperty(a)?(h+=n[a],c[i]=parseInt(h,16)*s,s=1,i=void 0,h=\"\"):h+=a;return o},u={codePages:[\"WinAnsiEncoding\"],WinAnsiEncoding:c(\"{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}\")},l={Unicode:{Courier:u,\"Courier-Bold\":u,\"Courier-BoldOblique\":u,\"Courier-Oblique\":u,Helvetica:u,\"Helvetica-Bold\":u,\"Helvetica-BoldOblique\":u,\"Helvetica-Oblique\":u,\"Times-Roman\":u,\"Times-Bold\":u,\"Times-BoldItalic\":u,\"Times-Italic\":u}},h={Unicode:{\"Courier-Oblique\":c(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\"Times-BoldItalic\":c(\"{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}\"),\"Helvetica-Bold\":c(\"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"),Courier:c(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\"Courier-BoldOblique\":c(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\"Times-Bold\":c(\"{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}\"),Symbol:c(\"{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}\"),Helvetica:c(\"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\"),\"Helvetica-BoldOblique\":c(\"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"),ZapfDingbats:c(\"{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}\"),\"Courier-Bold\":c(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\"Times-Italic\":c(\"{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}\"),\"Times-Roman\":c(\"{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}\"),\"Helvetica-Oblique\":c(\"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\")}};t.events.push([\"addFont\",function(t){var e=t.font,r=h.Unicode[e.postScriptName];r&&(e.metadata.Unicode={},e.metadata.Unicode.widths=r.widths,e.metadata.Unicode.kerning=r.kerning);var n=l.Unicode[e.postScriptName];n&&(e.metadata.Unicode.encoding=n,e.encoding=n.codePages[0])}])}(M.API),\n /**\n    * @license\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++)r[n]=t.charCodeAt(n);return r};t.API.events.push([\"addFont\",function(r){var n=void 0,i=r.font,a=r.instance;if(!i.isStandardFont){if(void 0===a)throw new Error(\"Font does not exist in vFS, import fonts or remove declaration doc.addFont('\"+i.postScriptName+\"').\");if(\"string\"!=typeof(n=!1===a.existsFileInVFS(i.postScriptName)?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName)))throw new Error(\"Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('\"+i.postScriptName+\"').\");!function(r,n){n=/^\\x00\\x01\\x00\\x00/.test(n)?e(n):e(c(n)),r.metadata=t.API.TTFFont.open(n),r.metadata.Unicode=r.metadata.Unicode||{encoding:{},kerning:{},widths:[]},r.metadata.glyIdsUsed=[0]}(i,n)}}])}(M),function(n){function a(){return(r.canvg?Promise.resolve(r.canvg):\"object\"===(void 0===t?\"undefined\":e(t))&&\"undefined\"!=typeof module?new Promise((function(t,e){try{t(require(\"canvg\"))}catch(t){e(t)}})):\"function\"==typeof define&&define.amd?new Promise((function(t,e){try{require([\"canvg\"],t)}catch(t){e(t)}})):Promise.reject(new Error(\"Could not load canvg\"))).catch((function(t){return Promise.reject(new Error(\"Could not load canvg: \"+t))})).then((function(t){return t.default?t.default:t}))}n.addSvgAsImage=function(t,e,r,n,o,s,c,u){if(isNaN(e)||isNaN(r))throw i.error(\"jsPDF.addSvgAsImage: Invalid coordinates\",arguments),new Error(\"Invalid coordinates passed to jsPDF.addSvgAsImage\");if(isNaN(n)||isNaN(o))throw i.error(\"jsPDF.addSvgAsImage: Invalid measurements\",arguments),new Error(\"Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage\");var l=document.createElement(\"canvas\");l.width=n,l.height=o;var h=l.getContext(\"2d\");h.fillStyle=\"#fff\",h.fillRect(0,0,l.width,l.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return a().then((function(e){return e.fromString(h,t,f)}),(function(){return Promise.reject(new Error(\"Could not load canvg.\"))})).then((function(t){return t.render(f)})).then((function(){d.addImage(l.toDataURL(\"image/jpeg\",1),e,r,n,o,c,u)}))}}(M.API),\n /**\n    * @license\n    * ====================================================================\n    * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining\n    * a copy of this software and associated documentation files (the\n    * \"Software\"), to deal in the Software without restriction, including\n    * without limitation the rights to use, copy, modify, merge, publish,\n    * distribute, sublicense, and/or sell copies of the Software, and to\n    * permit persons to whom the Software is furnished to do so, subject to\n    * the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be\n    * included in all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n    * ====================================================================\n    */\n function(t){t.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,\"g\"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),\"g\"),r=this.pdfEscape16(this.internal.getNumberOfPages()+\"\",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this}}(M.API),function(t){t.viewerPreferences=function(t,r){var n;t=t||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:\"UseNone\",value:\"UseNone\",type:\"name\",explicitSet:!1,valueSet:[\"UseNone\",\"UseOutlines\",\"UseThumbs\",\"UseOC\"],pdfVersion:1.3},Direction:{defaultValue:\"L2R\",value:\"L2R\",type:\"name\",explicitSet:!1,valueSet:[\"L2R\",\"R2L\"],pdfVersion:1.3},ViewArea:{defaultValue:\"CropBox\",value:\"CropBox\",type:\"name\",explicitSet:!1,valueSet:[\"MediaBox\",\"CropBox\",\"TrimBox\",\"BleedBox\",\"ArtBox\"],pdfVersion:1.4},ViewClip:{defaultValue:\"CropBox\",value:\"CropBox\",type:\"name\",explicitSet:!1,valueSet:[\"MediaBox\",\"CropBox\",\"TrimBox\",\"BleedBox\",\"ArtBox\"],pdfVersion:1.4},PrintArea:{defaultValue:\"CropBox\",value:\"CropBox\",type:\"name\",explicitSet:!1,valueSet:[\"MediaBox\",\"CropBox\",\"TrimBox\",\"BleedBox\",\"ArtBox\"],pdfVersion:1.4},PrintClip:{defaultValue:\"CropBox\",value:\"CropBox\",type:\"name\",explicitSet:!1,valueSet:[\"MediaBox\",\"CropBox\",\"TrimBox\",\"BleedBox\",\"ArtBox\"],pdfVersion:1.4},PrintScaling:{defaultValue:\"AppDefault\",value:\"AppDefault\",type:\"name\",explicitSet:!1,valueSet:[\"AppDefault\",\"None\"],pdfVersion:1.6},Duplex:{defaultValue:\"\",value:\"none\",type:\"name\",explicitSet:!1,valueSet:[\"Simplex\",\"DuplexFlipShortEdge\",\"DuplexFlipLongEdge\",\"none\"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:\"boolean\",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:\"\",value:\"\",type:\"array\",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:\"integer\",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],l=0,h=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,\"reset\"===t||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1}if(\"object\"===e(t))for(a in t)if(o=t[a],d(c,a)&&void 0!==o){if(\"boolean\"===n[a].type&&\"boolean\"==typeof o)n[a].value=o;else if(\"name\"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if(\"integer\"===n[a].type&&Number.isInteger(o))n[a].value=o;else if(\"array\"===n[a].type){for(l=0;l<o.length;l+=1)if(i=!0,1===o[l].length&&\"number\"==typeof o[l][0])u.push(String(o[l]-1));else if(o[l].length>1){for(h=0;h<o[l].length;h+=1)\"number\"!=typeof o[l][h]&&(i=!1);!0===i&&u.push([o[l][0]-1,o[l][1]-1].join(\" \"))}n[a].value=\"[\"+u.join(\" \")+\"]\"}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe(\"putCatalog\",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&(\"name\"===n[t].type?e.push(\"/\"+t+\" /\"+n[t].value):e.push(\"/\"+t+\" \"+n[t].value));0!==e.length&&this.internal.write(\"/ViewerPreferences\\n<<\\n\"+e.join(\"\\n\")+\"\\n>>\")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}}(M.API),\n /** ====================================================================\n    * @license\n    * jsPDF XMP metadata plugin\n    * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi\n    *\n    * Permission is hereby granted, free of charge, to any person obtaining\n    * a copy of this software and associated documentation files (the\n    * \"Software\"), to deal in the Software without restriction, including\n    * without limitation the rights to use, copy, modify, merge, publish,\n    * distribute, sublicense, and/or sell copies of the Software, and to\n    * permit persons to whom the Software is furnished to do so, subject to\n    * the following conditions:\n    *\n    * The above copyright notice and this permission notice shall be\n    * included in all copies or substantial portions of the Software.\n    *\n    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n    * ====================================================================\n    */\n function(t){var e=function(){var t='<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"><rdf:Description rdf:about=\"\" xmlns:jspdf=\"'+this.internal.__metadata__.namespaceuri+'\"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x=\"adobe:ns:meta/\">')),r=unescape(encodeURIComponent(t)),n=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),i=unescape(encodeURIComponent(\"</jspdf:metadata></rdf:Description></rdf:RDF>\")),a=unescape(encodeURIComponent(\"</x:xmpmeta>\")),o=r.length+n.length+i.length+e.length+a.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write(\"<< /Type /Metadata /Subtype /XML /Length \"+o+\" >>\"),this.internal.write(\"stream\"),this.internal.write(e+r+n+i+a),this.internal.write(\"endstream\"),this.internal.write(\"endobj\")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write(\"/Metadata \"+this.internal.__metadata__.metadata_object_number+\" 0 R\")};t.addMetadata=function(t,n){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:t,namespaceuri:n||\"http://jspdf.default.namespaceuri/\"},this.internal.events.subscribe(\"putCatalog\",r),this.internal.events.subscribe(\"postPutResources\",e)),this}}(M.API),function(t){var e=t.API,r=e.pdfEscape16=function(t,e){for(var r,n=e.metadata.Unicode.widths,i=[\"\",\"0\",\"00\",\"000\",\"0000\"],a=[\"\"],o=0,s=t.length;o<s;++o){if(r=e.metadata.characterToGlyph(t.charCodeAt(o)),e.metadata.glyIdsUsed.push(r),e.metadata.toUnicode[r]=t.charCodeAt(o),-1==n.indexOf(r)&&(n.push(r),n.push([parseInt(e.metadata.widthOfGlyph(r),10)])),\"0\"==r)return a.join(\"\");r=r.toString(16),a.push(i[4-r.length],r)}return a.join(\"\")},n=function(t){var e,r,n,i,a,o,s;for(a=\"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n  /Registry (Adobe)\\n  /Ordering (UCS)\\n  /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000><ffff>\\nendcodespacerange\",n=[],o=0,s=(r=Object.keys(t).sort((function(t,e){return t-e}))).length;o<s;o++)e=r[o],n.length>=100&&(a+=\"\\n\"+n.length+\" beginbfchar\\n\"+n.join(\"\\n\")+\"\\nendbfchar\",n=[]),void 0!==t[e]&&null!==t[e]&&\"function\"==typeof t[e].toString&&(i=(\"0000\"+t[e].toString(16)).slice(-4),e=(\"0000\"+(+e).toString(16)).slice(-4),n.push(\"<\"+e+\"><\"+i+\">\"));return n.length&&(a+=\"\\n\"+n.length+\" beginbfchar\\n\"+n.join(\"\\n\")+\"\\nendbfchar\\n\"),a+=\"endcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\"};e.events.push([\"putFont\",function(e){!function(e){var r=e.font,i=e.out,a=e.newObject,o=e.putStream;if(r.metadata instanceof t.API.TTFFont&&\"Identity-H\"===r.encoding){for(var s=r.metadata.Unicode.widths,c=r.metadata.subset.encode(r.metadata.glyIdsUsed,1),u=\"\",l=0;l<c.length;l++)u+=String.fromCharCode(c[l]);var h=a();o({data:u,addLength1:!0,objectId:h}),i(\"endobj\");var f=a();o({data:n(r.metadata.toUnicode),addLength1:!0,objectId:f}),i(\"endobj\");var d=a();i(\"<<\"),i(\"/Type /FontDescriptor\"),i(\"/FontName /\"+F(r.fontName)),i(\"/FontFile2 \"+h+\" 0 R\"),i(\"/FontBBox \"+t.API.PDFObject.convert(r.metadata.bbox)),i(\"/Flags \"+r.metadata.flags),i(\"/StemV \"+r.metadata.stemV),i(\"/ItalicAngle \"+r.metadata.italicAngle),i(\"/Ascent \"+r.metadata.ascender),i(\"/Descent \"+r.metadata.decender),i(\"/CapHeight \"+r.metadata.capHeight),i(\">>\"),i(\"endobj\");var p=a();i(\"<<\"),i(\"/Type /Font\"),i(\"/BaseFont /\"+F(r.fontName)),i(\"/FontDescriptor \"+d+\" 0 R\"),i(\"/W \"+t.API.PDFObject.convert(s)),i(\"/CIDToGIDMap /Identity\"),i(\"/DW 1000\"),i(\"/Subtype /CIDFontType2\"),i(\"/CIDSystemInfo\"),i(\"<<\"),i(\"/Supplement 0\"),i(\"/Registry (Adobe)\"),i(\"/Ordering (\"+r.encoding+\")\"),i(\">>\"),i(\">>\"),i(\"endobj\"),r.objectNumber=a(),i(\"<<\"),i(\"/Type /Font\"),i(\"/Subtype /Type0\"),i(\"/ToUnicode \"+f+\" 0 R\"),i(\"/BaseFont /\"+F(r.fontName)),i(\"/Encoding /\"+r.encoding),i(\"/DescendantFonts [\"+p+\" 0 R]\"),i(\">>\"),i(\"endobj\"),r.isAlreadyPutted=!0}}(e)}]);e.events.push([\"putFont\",function(e){!function(e){var r=e.font,i=e.out,a=e.newObject,o=e.putStream;if(r.metadata instanceof t.API.TTFFont&&\"WinAnsiEncoding\"===r.encoding){for(var s=r.metadata.rawData,c=\"\",u=0;u<s.length;u++)c+=String.fromCharCode(s[u]);var l=a();o({data:c,addLength1:!0,objectId:l}),i(\"endobj\");var h=a();o({data:n(r.metadata.toUnicode),addLength1:!0,objectId:h}),i(\"endobj\");var f=a();i(\"<<\"),i(\"/Descent \"+r.metadata.decender),i(\"/CapHeight \"+r.metadata.capHeight),i(\"/StemV \"+r.metadata.stemV),i(\"/Type /FontDescriptor\"),i(\"/FontFile2 \"+l+\" 0 R\"),i(\"/Flags 96\"),i(\"/FontBBox \"+t.API.PDFObject.convert(r.metadata.bbox)),i(\"/FontName /\"+F(r.fontName)),i(\"/ItalicAngle \"+r.metadata.italicAngle),i(\"/Ascent \"+r.metadata.ascender),i(\">>\"),i(\"endobj\"),r.objectNumber=a();for(var d=0;d<r.metadata.hmtx.widths.length;d++)r.metadata.hmtx.widths[d]=parseInt(r.metadata.hmtx.widths[d]*(1e3/r.metadata.head.unitsPerEm));i(\"<</Subtype/TrueType/Type/Font/ToUnicode \"+h+\" 0 R/BaseFont/\"+F(r.fontName)+\"/FontDescriptor \"+f+\" 0 R/Encoding/\"+r.encoding+\" /FirstChar 29 /LastChar 255 /Widths \"+t.API.PDFObject.convert(r.metadata.hmtx.widths)+\">>\"),i(\"endobj\"),r.isAlreadyPutted=!0}}(e)}]);var i=function(t){var e,n=t.text||\"\",i=t.x,a=t.y,o=t.options||{},s=t.mutex||{},c=s.pdfEscape,u=s.activeFontKey,l=s.fonts,h=u,f=\"\",d=0,p=\"\",g=l[h].encoding;if(\"Identity-H\"!==l[h].encoding)return{text:n,x:i,y:a,options:o,mutex:s};for(p=n,h=u,Array.isArray(n)&&(p=n[0]),d=0;d<p.length;d+=1)l[h].metadata.hasOwnProperty(\"cmap\")&&(e=l[h].metadata.cmap.unicode.codeMap[p[d].charCodeAt(0)]),e||p[d].charCodeAt(0)<256&&l[h].metadata.hasOwnProperty(\"Unicode\")?f+=p[d]:f+=\"\";var m=\"\";return parseInt(h.slice(1))<14||\"WinAnsiEncoding\"===g?m=c(f,h).split(\"\").map((function(t){return t.charCodeAt(0).toString(16)})).join(\"\"):\"Identity-H\"===g&&(m=r(f,l[h])),s.isHex=!0,{text:m,x:i,y:a,options:o,mutex:s}};e.events.push([\"postProcessText\",function(t){var e=t.text||\"\",r=[],n={text:e,x:t.x,y:t.y,options:t.options,mutex:t.mutex};if(Array.isArray(e)){var a=0;for(a=0;a<e.length;a+=1)Array.isArray(e[a])&&3===e[a].length?r.push([i(Object.assign({},n,{text:e[a][0]})).text,e[a][1],e[a][2]]):r.push(i(Object.assign({},n,{text:e[a]})).text);t.text=r}else t.text=i(Object.assign({},n,{text:e})).text}])}(M),\n /**\n    * @license\n    * jsPDF virtual FileSystem functionality\n    *\n    * Licensed under the MIT License.\n    * http://opensource.org/licenses/mit-license\n    */\n function(t){var e=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(t){return e.call(this),void 0!==this.internal.vFS[t]},t.addFileToVFS=function(t,r){return e.call(this),this.internal.vFS[t]=r,this},t.getFileFromVFS=function(t){return e.call(this),void 0!==this.internal.vFS[t]?this.internal.vFS[t]:null}}(M.API),\n /**\n    * @license\n    * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)\n    * MIT License\n    */\n function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var r,n,i,a,o,s,c,u=e,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],f={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},p=[\"(\",\")\",\"(\",\"<\",\">\",\"<\",\"[\",\"]\",\"[\",\"{\",\"}\",\"{\",\"«\",\"»\",\"«\",\"‹\",\"›\",\"‹\",\"⁅\",\"⁆\",\"⁅\",\"⁽\",\"⁾\",\"⁽\",\"₍\",\"₎\",\"₍\",\"≤\",\"≥\",\"≤\",\"〈\",\"〉\",\"〈\",\"﹙\",\"﹚\",\"﹙\",\"﹛\",\"﹜\",\"﹛\",\"﹝\",\"﹞\",\"﹝\",\"﹤\",\"﹥\",\"﹤\"],g=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),m=!1,v=0;this.__bidiEngine__={};var b=function(t){var e=t.charCodeAt(),r=e>>8,n=d[r];return void 0!==n?u[256*n+(255&e)]:252===r||253===r?\"AL\":g.test(r)?\"L\":8===r?\"R\":\"N\"},y=function(t){for(var e,r=0;r<t.length;r++){if(\"L\"===(e=b(t.charAt(r))))return!1;if(\"R\"===e)return!0}return!1},w=function(t,e,o,s){var c,u,l,h,f=e[s];switch(f){case\"L\":case\"R\":m=!1;break;case\"N\":case\"AN\":break;case\"EN\":m&&(f=\"AN\");break;case\"AL\":m=!0,f=\"R\";break;case\"WS\":f=\"N\";break;case\"CS\":s<1||s+1>=e.length||\"EN\"!==(c=o[s-1])&&\"AN\"!==c||\"EN\"!==(u=e[s+1])&&\"AN\"!==u?f=\"N\":m&&(u=\"AN\"),f=u===c?u:\"N\";break;case\"ES\":f=\"EN\"===(c=s>0?o[s-1]:\"B\")&&s+1<e.length&&\"EN\"===e[s+1]?\"EN\":\"N\";break;case\"ET\":if(s>0&&\"EN\"===o[s-1]){f=\"EN\";break}if(m){f=\"N\";break}for(l=s+1,h=e.length;l<h&&\"ET\"===e[l];)l++;f=l<h&&\"EN\"===e[l]?\"EN\":\"N\";break;case\"NSM\":if(i&&!a){for(h=e.length,l=s+1;l<h&&\"NSM\"===e[l];)l++;if(l<h){var d=t[s],p=d>=1425&&d<=2303||64286===d;if(c=e[l],p&&(\"R\"===c||\"AL\"===c)){f=\"R\";break}}}f=s<1||\"B\"===(c=e[s-1])?\"N\":o[s-1];break;case\"B\":m=!1,r=!0,f=v;break;case\"S\":n=!0,f=\"N\";break;case\"LRE\":case\"RLE\":case\"LRO\":case\"RLO\":case\"PDF\":m=!1;break;case\"BN\":f=\"N\"}return f},N=function(t,e,r){var n=t.split(\"\");return r&&L(n,r,{hiLevel:v}),n.reverse(),e&&e.reverse(),n.join(\"\")},L=function(t,e,i){var a,o,s,c,u,d=-1,p=t.length,g=0,y=[],N=v?h:l,L=[];for(m=!1,r=!1,n=!1,o=0;o<p;o++)L[o]=b(t[o]);for(s=0;s<p;s++){if(u=g,y[s]=w(t,L,y,s),a=240&(g=N[u][f[y[s]]]),g&=15,e[s]=c=N[g][5],a>0)if(16===a){for(o=d;o<s;o++)e[o]=1;d=-1}else d=-1;if(N[g][6])-1===d&&(d=s);else if(d>-1){for(o=d;o<s;o++)e[o]=c;d=-1}\"B\"===L[s]&&(e[s]=0),i.hiLevel|=c}n&&function(t,e,r){for(var n=0;n<r;n++)if(\"S\"===t[n]){e[n]=v;for(var i=n-1;i>=0&&\"WS\"===t[i];i--)e[i]=v}}(L,e,p)},A=function(t,e,n,i,a){if(!(a.hiLevel<t)){if(1===t&&1===v&&!r)return e.reverse(),void(n&&n.reverse());for(var o,s,c,u,l=e.length,h=0;h<l;){if(i[h]>=t){for(c=h+1;c<l&&i[c]>=t;)c++;for(u=h,s=c-1;u<s;u++,s--)o=e[u],e[u]=e[s],e[s]=o,n&&(o=n[u],n[u]=n[s],n[s]=o);h=c}h++}}},x=function(t,e,r){var n=t.split(\"\"),i={hiLevel:v};return r||(r=[]),L(n,r,i),function(t,e,r){if(0!==r.hiLevel&&c)for(var n,i=0;i<t.length;i++)1===e[i]&&(n=p.indexOf(t[i]))>=0&&(t[i]=p[n+1])}(n,r,i),A(2,n,e,r,i),A(1,n,e,r,i),n.join(\"\")};return this.__bidiEngine__.doBidiReorder=function(t,e,r){if(function(t,e){if(e)for(var r=0;r<t.length;r++)e[r]=r;void 0===a&&(a=y(t)),void 0===s&&(s=y(t))}(t,e),i||!o||s)if(i&&o&&a^s)v=a?1:0,t=N(t,e,r);else if(!i&&o&&s)v=a?1:0,t=x(t,e,r),t=N(t,e);else if(!i||a||o||s){if(i&&!o&&a^s)t=N(t,e),a?(v=0,t=x(t,e,r)):(v=1,t=x(t,e,r),t=N(t,e));else if(i&&a&&!o&&s)v=1,t=x(t,e,r),t=N(t,e);else if(!i&&!o&&a^s){var n=c;a?(v=1,t=x(t,e,r),v=0,c=!1,t=x(t,e,r),c=n):(v=0,t=x(t,e,r),t=N(t,e),v=1,c=!1,t=x(t,e,r),c=n,t=N(t,e))}}else v=0,t=x(t,e,r);else v=a?1:0,t=x(t,e,r);return t},this.__bidiEngine__.setOptions=function(t){t&&(i=t.isInputVisual,o=t.isOutputVisual,a=t.isInputRtl,s=t.isOutputRtl,c=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var e=[\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"S\",\"B\",\"S\",\"WS\",\"B\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"B\",\"B\",\"B\",\"S\",\"WS\",\"N\",\"N\",\"ET\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"ES\",\"CS\",\"ES\",\"CS\",\"CS\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"CS\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"B\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"CS\",\"N\",\"ET\",\"ET\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"L\",\"N\",\"N\",\"BN\",\"N\",\"N\",\"ET\",\"ET\",\"EN\",\"EN\",\"N\",\"L\",\"N\",\"N\",\"N\",\"EN\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"ET\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"R\",\"NSM\",\"R\",\"NSM\",\"NSM\",\"R\",\"NSM\",\"NSM\",\"R\",\"NSM\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"N\",\"N\",\"N\",\"N\",\"N\",\"R\",\"R\",\"R\",\"R\",\"R\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"N\",\"N\",\"AL\",\"ET\",\"ET\",\"AL\",\"CS\",\"AL\",\"N\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AL\",\"AL\",\"N\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"AN\",\"ET\",\"AN\",\"AN\",\"AL\",\"AL\",\"AL\",\"NSM\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AN\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AL\",\"AL\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"N\",\"AL\",\"AL\",\"NSM\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"N\",\"N\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"AL\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"R\",\"R\",\"N\",\"N\",\"N\",\"N\",\"R\",\"N\",\"N\",\"N\",\"N\",\"N\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"WS\",\"BN\",\"BN\",\"BN\",\"L\",\"R\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"WS\",\"B\",\"LRE\",\"RLE\",\"PDF\",\"LRO\",\"RLO\",\"CS\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"CS\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"WS\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"N\",\"LRI\",\"RLI\",\"FSI\",\"PDI\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"BN\",\"EN\",\"L\",\"N\",\"N\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"ES\",\"ES\",\"N\",\"N\",\"N\",\"L\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"ES\",\"ES\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"R\",\"NSM\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"ES\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"N\",\"R\",\"R\",\"R\",\"R\",\"R\",\"N\",\"R\",\"N\",\"R\",\"R\",\"N\",\"R\",\"R\",\"N\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"NSM\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"CS\",\"N\",\"CS\",\"N\",\"N\",\"CS\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"ET\",\"N\",\"N\",\"ES\",\"ES\",\"N\",\"N\",\"N\",\"N\",\"N\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"N\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"AL\",\"N\",\"N\",\"BN\",\"N\",\"N\",\"N\",\"ET\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"ES\",\"CS\",\"ES\",\"CS\",\"CS\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"EN\",\"CS\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"L\",\"L\",\"L\",\"L\",\"L\",\"L\",\"N\",\"N\",\"L\",\"L\",\"L\",\"N\",\"N\",\"N\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"ET\",\"ET\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\",\"N\"],r=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push([\"postProcessText\",function(t){var e=t.text,n=(t.x,t.y,t.options||{}),i=(t.mutex,n.lang,[]);if(n.isInputVisual=\"boolean\"!=typeof n.isInputVisual||n.isInputVisual,r.setOptions(n),\"[object Array]\"===Object.prototype.toString.call(e)){var a=0;for(i=[],a=0;a<e.length;a+=1)\"[object Array]\"===Object.prototype.toString.call(e[a])?i.push([r.doBidiReorder(e[a][0]),e[a][1],e[a][2]]):i.push([r.doBidiReorder(e[a])]);t.text=i}else t.text=r.doBidiReorder(e);r.setOptions({isInputVisual:!0})}])}(M),M.API.TTFFont=function(){function t(t){var e;if(this.rawData=t,e=this.contents=new Te(t),this.contents.pos=4,\"ttcf\"===e.readString(4))throw new Error(\"TTCF not supported.\");e.pos=0,this.parse(),this.subset=new ar(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new Ue(this.contents),this.head=new We(this),this.name=new Ze(this),this.cmap=new Ge(this),this.toUnicode={},this.hhea=new Ye(this),this.maxp=new $e(this),this.hmtx=new Qe(this),this.post=new Xe(this),this.os2=new Je(this),this.loca=new ir(this),this.glyf=new er(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var t,e,r,n,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var e,r,n,i;for(i=[],e=0,r=(n=this.bbox).length;e<r;e++)t=n[e],i.push(Math.round(t*this.scaleFactor));return i}.call(this),this.stemV=0,this.post.exists?(r=255&(n=this.post.italic_angle),0!=(32768&(e=n>>16))&&(e=-(1+(65535^e))),this.italicAngle=+(e+\".\"+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(i=this.familyClass)||2===i||3===i||4===i||5===i||7===i,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error(\"No unicode cmap for font\")},t.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},t.prototype.widthOfString=function(t,e,r){var n,i,a,o;for(a=0,i=0,o=(t=\"\"+t).length;0<=o?i<o:i>o;i=0<=o?++i:--i)n=t.charCodeAt(i),a+=this.widthOfGlyph(this.characterToGlyph(n))+r*(1e3/e)||0;return a*(e/1e3)},t.prototype.lineHeight=function(t,e){var r;return null==e&&(e=!1),r=e?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},t}();var Re,Te=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,r;for(r=[],e=0;0<=t?e<t:e>t;e=0<=t?++e:--e)r[e]=String.fromCharCode(this.readByte());return r.join(\"\")},t.prototype.writeString=function(t){var e,r,n;for(n=[],e=0,r=t.length;0<=r?e<r:e>r;e=0<=r?++e:--e)n.push(this.writeByte(t.charCodeAt(e)));return n},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,r,n,i,a,o,s;return t=this.readByte(),e=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^e)+1099511627776*(255^r)+4294967296*(255^n)+16777216*(255^i)+65536*(255^a)+256*(255^o)+(255^s)+1):72057594037927940*t+281474976710656*e+1099511627776*r+4294967296*n+16777216*i+65536*a+256*o+s},t.prototype.writeLongLong=function(t){var e,r;return e=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,r;for(e=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)e.push(this.readByte());return e},t.prototype.write=function(t){var e,r,n,i;for(i=[],r=0,n=t.length;r<n;r++)e=t[r],i.push(this.writeByte(e));return i},t}(),Ue=function(){var t;function e(t){var e,r,n;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},r=0,n=this.tableCount;0<=n?r<n:r>n;r=0<=n?++r:--r)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return e.prototype.encode=function(e){var r,n,i,a,o,s,c,u,l,h,f,d,p;for(p in f=Object.keys(e).length,s=Math.log(2),l=16*Math.floor(Math.log(f)/s),a=Math.floor(l/s),u=16*f-l,(n=new Te).writeInt(this.scalarType),n.writeShort(f),n.writeShort(l),n.writeShort(a),n.writeShort(u),i=16*f,c=n.pos+i,o=null,d=[],e)for(h=e[p],n.writeString(p),n.writeInt(t(h)),n.writeInt(c),n.writeInt(h.length),d=d.concat(h),\"head\"===p&&(o=c),c+=h.length;c%4;)d.push(0),c++;return n.write(d),r=2981146554-t(n.data),n.pos=o+8,n.writeUInt32(r),n.data},t=function(t){var e,r,n,i;for(t=tr.call(t);t.length%4;)t.push(0);for(n=new Te(t),r=0,e=0,i=t.length;e<i;e=e+=4)r+=n.readUInt32();return 4294967295&r},e}(),ze={}.hasOwnProperty,He=function(t,e){for(var r in e)ze.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},We=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"head\",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var e;return(e=new Te).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},e}(Re=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}()),Ve=function(){function t(t,e){var r,n,i,a,o,s,c,u,l,h,f,d,p,g,m,v,b;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=e+t.readInt(),l=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=0;s<256;++s)this.codeMap[s]=t.readByte();break;case 4:for(f=t.readUInt16(),h=f/2,t.pos+=6,i=function(){var e,r;for(r=[],s=e=0;0<=h?e<h:e>h;s=0<=h?++e:--e)r.push(t.readUInt16());return r}(),t.pos+=2,p=function(){var e,r;for(r=[],s=e=0;0<=h?e<h:e>h;s=0<=h?++e:--e)r.push(t.readUInt16());return r}(),c=function(){var e,r;for(r=[],s=e=0;0<=h?e<h:e>h;s=0<=h?++e:--e)r.push(t.readUInt16());return r}(),u=function(){var e,r;for(r=[],s=e=0;0<=h?e<h:e>h;s=0<=h?++e:--e)r.push(t.readUInt16());return r}(),n=(this.length-t.pos+this.offset)/2,o=function(){var e,r;for(r=[],s=e=0;0<=n?e<n:e>n;s=0<=n?++e:--e)r.push(t.readUInt16());return r}(),s=m=0,b=i.length;m<b;s=++m)for(g=i[s],r=v=d=p[s];d<=g?v<=g:v>=g;r=d<=g?++v:--v)0===u[s]?a=r+c[s]:0!==(a=o[u[s]/2+(r-d)-(h-s)]||0)&&(a+=c[s]),this.codeMap[r]=65535&a}t.pos=l}return t.encode=function(t,e){var r,n,i,a,o,s,c,u,l,h,f,d,p,g,m,v,b,y,w,N,L,A,x,S,_,P,k,F,I,C,j,O,B,M,E,q,D,R,T,U,z,H,W,V,G,Y;switch(F=new Te,a=Object.keys(t).sort((function(t,e){return t-e})),e){case\"macroman\":for(p=0,g=function(){var t=[];for(d=0;d<256;++d)t.push(0);return t}(),v={0:0},i={},I=0,B=a.length;I<B;I++)null==v[W=t[n=a[I]]]&&(v[W]=++p),i[n]={old:t[n],new:v[t[n]]},g[n]=v[t[n]];return F.writeUInt16(1),F.writeUInt16(0),F.writeUInt32(12),F.writeUInt16(0),F.writeUInt16(262),F.writeUInt16(0),F.write(g),{charMap:i,subtable:F.data,maxGlyphID:p+1};case\"unicode\":for(P=[],l=[],b=0,v={},r={},m=c=null,C=0,M=a.length;C<M;C++)null==v[w=t[n=a[C]]]&&(v[w]=++b),r[n]={old:w,new:v[w]},o=v[w]-n,null!=m&&o===c||(m&&l.push(m),P.push(n),c=o),m=n;for(m&&l.push(m),l.push(65535),P.push(65535),S=2*(x=P.length),A=2*Math.pow(Math.log(x)/Math.LN2,2),h=Math.log(A/2)/Math.LN2,L=2*x-A,s=[],N=[],f=[],d=j=0,E=P.length;j<E;d=++j){if(_=P[d],u=l[d],65535===_){s.push(0),N.push(0);break}if(_-(k=r[_].new)>=32768)for(s.push(0),N.push(2*(f.length+x-d)),n=O=_;_<=u?O<=u:O>=u;n=_<=u?++O:--O)f.push(r[n].new);else s.push(k-_),N.push(0)}for(F.writeUInt16(3),F.writeUInt16(1),F.writeUInt32(12),F.writeUInt16(4),F.writeUInt16(16+8*x+2*f.length),F.writeUInt16(0),F.writeUInt16(S),F.writeUInt16(A),F.writeUInt16(h),F.writeUInt16(L),z=0,q=l.length;z<q;z++)n=l[z],F.writeUInt16(n);for(F.writeUInt16(0),H=0,D=P.length;H<D;H++)n=P[H],F.writeUInt16(n);for(V=0,R=s.length;V<R;V++)o=s[V],F.writeUInt16(o);for(G=0,T=N.length;G<T;G++)y=N[G],F.writeUInt16(y);for(Y=0,U=f.length;Y<U;Y++)p=f[Y],F.writeUInt16(p);return{charMap:r,subtable:F.data,maxGlyphID:b+1}}},t}(),Ge=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"cmap\",e.prototype.parse=function(t){var e,r,n;for(t.pos=this.offset,this.version=t.readUInt16(),n=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=n?r<n:r>n;r=0<=n?++r:--r)e=new Ve(t,this.offset),this.tables.push(e),e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0},e.encode=function(t,e){var r,n;return null==e&&(e=\"macroman\"),r=Ve.encode(t,e),(n=new Te).writeUInt16(0),n.writeUInt16(1),r.table=n.data.concat(r.subtable),r},e}(Re),Ye=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"hhea\",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(Re),Je=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"OS/2\",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var e,r;for(r=[],e=0;e<10;++e)r.push(t.readByte());return r}(),this.charRange=function(){var e,r;for(r=[],e=0;e<4;++e)r.push(t.readInt());return r}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var e,r;for(r=[],e=0;e<2;e=++e)r.push(t.readInt());return r}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(Re),Xe=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"post\",e.prototype.parse=function(t){var e,r,n;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:var i;for(r=t.readUInt16(),this.glyphNameIndex=[],i=0;0<=r?i<r:i>r;i=0<=r?++i:--i)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],n=[];t.pos<this.offset+this.length;)e=t.readByte(),n.push(this.names.push(t.readString(e)));return n;case 151552:return r=t.readUInt16(),this.offsets=t.read(r);case 196608:break;case 262144:return this.map=function(){var e,r,n;for(n=[],i=e=0,r=this.file.maxp.numGlyphs;0<=r?e<r:e>r;i=0<=r?++e:--e)n.push(t.readUInt32());return n}.call(this)}},e}(Re),Ke=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},Ze=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"name\",e.prototype.parse=function(t){var e,r,n,i,a,o,s,c,u,l,h;for(t.pos=this.offset,t.readShort(),e=t.readShort(),o=t.readShort(),r=[],i=0;0<=e?i<e:i>e;i=0<=e?++i:--i)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(s={},i=u=0,l=r.length;u<l;i=++u)n=r[i],t.pos=n.offset,c=t.readString(n.length),a=new Ke(c,n),null==s[h=n.nameID]&&(s[h]=[]),s[n.nameID].push(a);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\\x00-\\x19\\x80-\\xff]/g,\"\")}catch(t){this.postscriptName=s[4][0].raw.replace(/[\\x00-\\x19\\x80-\\xff]/g,\"\")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},e}(Re),$e=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"maxp\",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(Re),Qe=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"hmtx\",e.prototype.parse=function(t){var e,r,n,i,a,o,s;for(t.pos=this.offset,this.metrics=[],e=0,o=this.file.hhea.numberOfMetrics;0<=o?e<o:e>o;e=0<=o?++e:--e)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(n=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var r,i;for(i=[],e=r=0;0<=n?r<n:r>n;e=0<=n?++r:--r)i.push(t.readInt16());return i}(),this.widths=function(){var t,e,r,n;for(n=[],t=0,e=(r=this.metrics).length;t<e;t++)i=r[t],n.push(i.advance);return n}.call(this),r=this.widths[this.widths.length-1],s=[],e=a=0;0<=n?a<n:a>n;e=0<=n?++a:--a)s.push(this.widths.push(r));return s},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(Re),tr=[].slice,er=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"glyf\",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var e,r,n,i,a,o,s,c,u,l;return t in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,r=i.indexOf(t),0===(n=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+r,a=(o=new Te(e.read(n))).readShort(),c=o.readShort(),l=o.readShort(),s=o.readShort(),u=o.readShort(),this.cache[t]=-1===a?new nr(o,c,l,s,u):new rr(o,a,c,l,s,u),this.cache[t]))},e.prototype.encode=function(t,e,r){var n,i,a,o,s;for(a=[],i=[],o=0,s=e.length;o<s;o++)n=t[e[o]],i.push(a.length),n&&(a=a.concat(n.encode(r)));return i.push(a.length),{table:a,offsets:i}},e}(Re),rr=function(){function t(t,e,r,n,i,a){this.raw=t,this.numberOfContours=e,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),nr=function(){function t(t,e,r,n,i){var a,o;for(this.raw=t,this.xMin=e,this.yMin=r,this.xMax=n,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return 1,8,32,64,128,t.prototype.encode=function(){var t,e,r;for(e=new Te(tr.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)e.pos=this.glyphOffsets[t];return e.data},t}(),ir=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return He(e,t),e.prototype.tag=\"loca\",e.prototype.parse=function(t){var e,r;return t.pos=this.offset,e=this.file.head.indexToLocFormat,this.offsets=0===e?function(){var e,n;for(n=[],r=0,e=this.length;r<e;r+=2)n.push(2*t.readUInt16());return n}.call(this):function(){var e,n;for(n=[],r=0,e=this.length;r<e;r+=4)n.push(t.readUInt32());return n}.call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,e){for(var r=new Uint32Array(this.offsets.length),n=0,i=0,a=0;a<r.length;++a)if(r[a]=n,i<e.length&&e[i]==a){++i,r[a]=n;var o=this.offsets[a],s=this.offsets[a+1]-o;s>0&&(n+=s)}for(var c=new Array(4*r.length),u=0;u<r.length;++u)c[4*u+3]=255&r[u],c[4*u+2]=(65280&r[u])>>8,c[4*u+1]=(16711680&r[u])>>16,c[4*u]=(4278190080&r[u])>>24;return c},e}(Re),ar=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,r,n,i;for(e in n=this.font.cmap.tables[0].codeMap,t={},i=this.subset)r=i[e],t[e]=n[r];return t},t.prototype.glyphsFor=function(t){var e,r,n,i,a,o,s;for(n={},a=0,o=t.length;a<o;a++)n[i=t[a]]=this.font.glyf.glyphFor(i);for(i in e=[],n)(null!=(r=n[i])?r.compound:void 0)&&e.push.apply(e,r.glyphIDs);if(e.length>0)for(i in s=this.glyphsFor(e))r=s[i],n[i]=r;return n},t.prototype.encode=function(t,e){var r,n,i,a,o,s,c,u,l,h,f,d,p,g,m;for(n in r=Ge.encode(this.generateCmap(),\"unicode\"),a=this.glyphsFor(t),f={0:0},m=r.charMap)f[(s=m[n]).old]=s.new;for(d in h=r.maxGlyphID,a)d in f||(f[d]=h++);return u=function(t){var e,r;for(e in r={},t)r[t[e]]=e;return r}(f),l=Object.keys(u).sort((function(t,e){return t-e})),p=function(){var t,e,r;for(r=[],t=0,e=l.length;t<e;t++)o=l[t],r.push(u[o]);return r}(),i=this.font.glyf.encode(a,p,f),c=this.font.loca.encode(i.offsets,p),g={cmap:this.font.cmap.raw(),glyf:i.table,loca:c,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(g[\"OS/2\"]=this.font.os2.raw()),this.font.directory.encode(g)},t}();M.API.PDFObject=function(){var t;function e(){}return t=function(t,e){return(Array(e+1).join(\"0\")+t).slice(-e)},e.convert=function(r){var n,i,a,o;if(Array.isArray(r))return\"[\"+function(){var t,i,a;for(a=[],t=0,i=r.length;t<i;t++)n=r[t],a.push(e.convert(n));return a}().join(\" \")+\"]\";if(\"string\"==typeof r)return\"/\"+r;if(null!=r?r.isString:void 0)return\"(\"+r+\")\";if(r instanceof Date)return\"(D:\"+t(r.getUTCFullYear(),4)+t(r.getUTCMonth(),2)+t(r.getUTCDate(),2)+t(r.getUTCHours(),2)+t(r.getUTCMinutes(),2)+t(r.getUTCSeconds(),2)+\"Z)\";if(\"[object Object]\"==={}.toString.call(r)){for(i in a=[\"<<\"],r)o=r[i],a.push(\"/\"+i+\" \"+e.convert(o));return a.push(\">>\"),a.join(\"\\n\")}return\"\"+r},e}(),t.AcroForm=xt,t.AcroFormAppearance=Lt,t.AcroFormButton=gt,t.AcroFormCheckBox=yt,t.AcroFormChoiceField=ht,t.AcroFormComboBox=dt,t.AcroFormEditBox=pt,t.AcroFormListBox=ft,t.AcroFormPasswordField=Nt,t.AcroFormPushButton=mt,t.AcroFormRadioButton=vt,t.AcroFormTextField=wt,t.GState=C,t.ShadingPattern=O,t.TilingPattern=B,t.default=M,t.jsPDF=M,Object.defineProperty(t,\"__esModule\",{value:!0})}));"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/turndown-plugin-gfm.js",
    "content": "var turndownPluginGfm = (function (exports) {\n  'use strict';\n\n  var highlightRegExp = /highlight-(?:text|source)-([a-z0-9]+)/;\n\n  function highlightedCodeBlock (turndownService) {\n    turndownService.addRule('highlightedCodeBlock', {\n      filter: function (node) {\n        var firstChild = node.firstChild;\n        return (\n          node.nodeName === 'DIV' &&\n          highlightRegExp.test(node.className) &&\n          firstChild &&\n          firstChild.nodeName === 'PRE'\n        )\n      },\n      replacement: function (content, node, options) {\n        var className = node.className || '';\n        var language = (className.match(highlightRegExp) || [null, ''])[1];\n\n        return (\n          '\\n\\n' + options.fence + language + '\\n' +\n          node.firstChild.textContent +\n          '\\n' + options.fence + '\\n\\n'\n        )\n      }\n    });\n  }\n\n  function strikethrough (turndownService) {\n    turndownService.addRule('strikethrough', {\n      filter: ['del', 's', 'strike'],\n      replacement: function (content) {\n        return '~' + content + '~'\n      }\n    });\n  }\n\n  var indexOf = Array.prototype.indexOf;\n  var every = Array.prototype.every;\n  var rules = {};\n\n  rules.tableCell = {\n    filter: ['th', 'td'],\n    replacement: function (content, node) {\n      return cell(content, node)\n    }\n  };\n\n  rules.tableRow = {\n    filter: 'tr',\n    replacement: function (content, node) {\n      var borderCells = '';\n      var alignMap = { left: ':--', right: '--:', center: ':-:' };\n\n      if (isHeadingRow(node)) {\n        for (var i = 0; i < node.childNodes.length; i++) {\n          var border = '---';\n          var align = (\n            node.childNodes[i].getAttribute('align') || ''\n          ).toLowerCase();\n\n          if (align) border = alignMap[align] || border;\n\n          borderCells += cell(border, node.childNodes[i]);\n        }\n      }\n      return '\\n' + content + (borderCells ? '\\n' + borderCells : '')\n    }\n  };\n\n  rules.table = {\n    // Only convert tables with a heading row.\n    // Tables with no heading row are kept using `keep` (see below).\n    filter: function (node) {\n      return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0])\n    },\n\n    replacement: function (content) {\n      // Ensure there are no blank lines\n      content = content.replace('\\n\\n', '\\n');\n      return '\\n\\n' + content + '\\n\\n'\n    }\n  };\n\n  rules.tableSection = {\n    filter: ['thead', 'tbody', 'tfoot'],\n    replacement: function (content) {\n      return content\n    }\n  };\n\n  // A tr is a heading row if:\n  // - the parent is a THEAD\n  // - or if its the first child of the TABLE or the first TBODY (possibly\n  //   following a blank THEAD)\n  // - and every cell is a TH\n  function isHeadingRow (tr) {\n    var parentNode = tr.parentNode;\n    return (\n      parentNode.nodeName === 'THEAD' ||\n      (\n        parentNode.firstChild === tr &&\n        (parentNode.nodeName === 'TABLE' || isFirstTbody(parentNode)) &&\n        every.call(tr.childNodes, function (n) { return n.nodeName === 'TH' })\n      )\n    )\n  }\n\n  function isFirstTbody (element) {\n    var previousSibling = element.previousSibling;\n    return (\n      element.nodeName === 'TBODY' && (\n        !previousSibling ||\n        (\n          previousSibling.nodeName === 'THEAD' &&\n          /^\\s*$/i.test(previousSibling.textContent)\n        )\n      )\n    )\n  }\n\n  function cell (content, node) {\n    var index = indexOf.call(node.parentNode.childNodes, node);\n    var prefix = ' ';\n    if (index === 0) prefix = '| ';\n    return prefix + content + ' |'\n  }\n\n  function tables (turndownService) {\n    turndownService.keep(function (node) {\n      return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0])\n    });\n    for (var key in rules) turndownService.addRule(key, rules[key]);\n  }\n\n  function taskListItems (turndownService) {\n    turndownService.addRule('taskListItems', {\n      filter: function (node) {\n        return node.type === 'checkbox' && node.parentNode.nodeName === 'LI'\n      },\n      replacement: function (content, node) {\n        return (node.checked ? '[x]' : '[ ]') + ' '\n      }\n    });\n  }\n\n  function gfm (turndownService) {\n    turndownService.use([\n      highlightedCodeBlock,\n      strikethrough,\n      tables,\n      taskListItems\n    ]);\n  }\n\n  exports.gfm = gfm;\n  exports.highlightedCodeBlock = highlightedCodeBlock;\n  exports.strikethrough = strikethrough;\n  exports.tables = tables;\n  exports.taskListItems = taskListItems;\n\n  return exports;\n}({}));"
  },
  {
    "path": "ChatGPT/src-tauri/src/vendors/turndown.js",
    "content": "var TurndownService=function(){\"use strict\";function u(e,n){return Array(n+1).join(e)}var n=[\"ADDRESS\",\"ARTICLE\",\"ASIDE\",\"AUDIO\",\"BLOCKQUOTE\",\"BODY\",\"CANVAS\",\"CENTER\",\"DD\",\"DIR\",\"DIV\",\"DL\",\"DT\",\"FIELDSET\",\"FIGCAPTION\",\"FIGURE\",\"FOOTER\",\"FORM\",\"FRAMESET\",\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\",\"HEADER\",\"HGROUP\",\"HR\",\"HTML\",\"ISINDEX\",\"LI\",\"MAIN\",\"MENU\",\"NAV\",\"NOFRAMES\",\"NOSCRIPT\",\"OL\",\"OUTPUT\",\"P\",\"PRE\",\"SECTION\",\"TABLE\",\"TBODY\",\"TD\",\"TFOOT\",\"TH\",\"THEAD\",\"TR\",\"UL\"];function o(e){return l(e,n)}var r=[\"AREA\",\"BASE\",\"BR\",\"COL\",\"COMMAND\",\"EMBED\",\"HR\",\"IMG\",\"INPUT\",\"KEYGEN\",\"LINK\",\"META\",\"PARAM\",\"SOURCE\",\"TRACK\",\"WBR\"];function i(e){return l(e,r)}var a=[\"A\",\"TABLE\",\"THEAD\",\"TBODY\",\"TFOOT\",\"TH\",\"TD\",\"IFRAME\",\"SCRIPT\",\"AUDIO\",\"VIDEO\"];function l(e,n){return 0<=n.indexOf(e.nodeName)}function c(n,e){return n.getElementsByTagName&&e.some(function(e){return n.getElementsByTagName(e).length})}var t={};function s(e){return e?e.replace(/(\\n+\\s*)+/g,\"\\n\"):\"\"}function f(e){for(var n in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[n])}function d(e,n,t){for(var r=0;r<e.length;r++){var i=e[r];if(function(e,n,t){var r=e.filter;if(\"string\"==typeof r){if(r===n.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(-1<r.indexOf(n.nodeName.toLowerCase()))return!0}else{if(\"function\"!=typeof r)throw new TypeError(\"`filter` needs to be a string, array, or function\");if(r.call(e,n,t))return!0}}(i,n,t))return i}}function p(e){var n=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),n}function h(e,n,t){return e&&e.parentNode===n||t(n)?n.nextSibling||n.parentNode:n.firstChild||n.nextSibling||n.parentNode}t.paragraph={filter:\"p\",replacement:function(e){return\"\\n\\n\"+e+\"\\n\\n\"}},t.lineBreak={filter:\"br\",replacement:function(e,n,t){return t.br+\"\\n\"}},t.heading={filter:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],replacement:function(e,n,t){n=Number(n.nodeName.charAt(1));return\"setext\"===t.headingStyle&&n<3?\"\\n\\n\"+e+\"\\n\"+u(1===n?\"=\":\"-\",e.length)+\"\\n\\n\":\"\\n\\n\"+u(\"#\",n)+\" \"+e+\"\\n\\n\"}},t.blockquote={filter:\"blockquote\",replacement:function(e){return\"\\n\\n\"+(e=(e=e.replace(/^\\n+|\\n+$/g,\"\")).replace(/^/gm,\"> \"))+\"\\n\\n\"}},t.list={filter:[\"ul\",\"ol\"],replacement:function(e,n){var t=n.parentNode;return\"LI\"===t.nodeName&&t.lastElementChild===n?\"\\n\"+e:\"\\n\\n\"+e+\"\\n\\n\"}},t.listItem={filter:\"li\",replacement:function(e,n,t){e=e.replace(/^\\n+/,\"\").replace(/\\n+$/,\"\\n\").replace(/\\n/gm,\"\\n    \");var r=t.bulletListMarker+\"   \",i=n.parentNode;return\"OL\"===i.nodeName&&(t=i.getAttribute(\"start\"),i=Array.prototype.indexOf.call(i.children,n),r=(t?Number(t)+i:i+1)+\".  \"),r+e+(n.nextSibling&&!/\\n$/.test(e)?\"\\n\":\"\")}},t.indentedCodeBlock={filter:function(e,n){return\"indented\"===n.codeBlockStyle&&\"PRE\"===e.nodeName&&e.firstChild&&\"CODE\"===e.firstChild.nodeName},replacement:function(e,n,t){return\"\\n\\n    \"+n.firstChild.textContent.replace(/\\n/g,\"\\n    \")+\"\\n\\n\"}},t.fencedCodeBlock={filter:function(e,n){return\"fenced\"===n.codeBlockStyle&&\"PRE\"===e.nodeName&&e.firstChild&&\"CODE\"===e.firstChild.nodeName},replacement:function(e,n,t){for(var r,i=((n.firstChild.getAttribute(\"class\")||\"\").match(/language-(\\S+)/)||[null,\"\"])[1],o=n.firstChild.textContent,t=t.fence.charAt(0),a=3,l=new RegExp(\"^\"+t+\"{3,}\",\"gm\");r=l.exec(o);)r[0].length>=a&&(a=r[0].length+1);t=u(t,a);return\"\\n\\n\"+t+i+\"\\n\"+o.replace(/\\n$/,\"\")+\"\\n\"+t+\"\\n\\n\"}},t.horizontalRule={filter:\"hr\",replacement:function(e,n,t){return\"\\n\\n\"+t.hr+\"\\n\\n\"}},t.inlineLink={filter:function(e,n){return\"inlined\"===n.linkStyle&&\"A\"===e.nodeName&&e.getAttribute(\"href\")},replacement:function(e,n){var t=n.getAttribute(\"href\"),n=s(n.getAttribute(\"title\"));return\"[\"+e+\"](\"+t+(n=n&&' \"'+n+'\"')+\")\"}},t.referenceLink={filter:function(e,n){return\"referenced\"===n.linkStyle&&\"A\"===e.nodeName&&e.getAttribute(\"href\")},replacement:function(e,n,t){var r=n.getAttribute(\"href\"),i=(i=s(n.getAttribute(\"title\")))&&' \"'+i+'\"';switch(t.linkReferenceStyle){case\"collapsed\":a=\"[\"+e+\"][]\",l=\"[\"+e+\"]: \"+r+i;break;case\"shortcut\":a=\"[\"+e+\"]\",l=\"[\"+e+\"]: \"+r+i;break;default:var o=this.references.length+1,a=\"[\"+e+\"][\"+o+\"]\",l=\"[\"+o+\"]: \"+r+i}return this.references.push(l),a},references:[],append:function(e){var n=\"\";return this.references.length&&(n=\"\\n\\n\"+this.references.join(\"\\n\")+\"\\n\\n\",this.references=[]),n}},t.emphasis={filter:[\"em\",\"i\"],replacement:function(e,n,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:\"\"}},t.strong={filter:[\"strong\",\"b\"],replacement:function(e,n,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:\"\"}},t.code={filter:function(e){var n=e.previousSibling||e.nextSibling,n=\"PRE\"===e.parentNode.nodeName&&!n;return\"CODE\"===e.nodeName&&!n},replacement:function(e){if(!e)return\"\";e=e.replace(/\\r?\\n|\\r/g,\" \");for(var n=/^`|^ .*?[^ ].* $|`$/.test(e)?\" \":\"\",t=\"`\",r=e.match(/`+/gm)||[];-1!==r.indexOf(t);)t+=\"`\";return t+n+e+n+t}},t.image={filter:\"img\",replacement:function(e,n){var t=s(n.getAttribute(\"alt\")),r=n.getAttribute(\"src\")||\"\",n=s(n.getAttribute(\"title\"));return r?\"![\"+t+\"](\"+r+(n?' \"'+n+'\"':\"\")+\")\":\"\"}},f.prototype={add:function(e,n){this.array.unshift(n)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return\"\"}})},forNode:function(e){return e.isBlank?this.blankRule:(n=d(this.array,e,this.options))||(n=d(this._keep,e,this.options))||(n=d(this._remove,e,this.options))?n:this.defaultRule;var n},forEach:function(e){for(var n=0;n<this.array.length;n++)e(this.array[n],n)}};var g=\"undefined\"!=typeof window?window:{};var m,A=function(){var e=g.DOMParser,n=!1;try{(new e).parseFromString(\"\",\"text/html\")&&(n=!0)}catch(e){}return n}()?g.DOMParser:(!function(){var n=!1;try{document.implementation.createHTMLDocument(\"\").open()}catch(e){window.ActiveXObject&&(n=!0)}return n}()?e.prototype.parseFromString=function(e){var n=document.implementation.createHTMLDocument(\"\");return n.open(),n.write(e),n.close(),n}:e.prototype.parseFromString=function(e){var n=new window.ActiveXObject(\"htmlfile\");return n.designMode=\"on\",n.open(),n.write(e),n.close(),n},e);function e(){}function v(e,n){return function(e){var n=e.element,t=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return\"PRE\"===e.nodeName};if(n.firstChild&&!i(n)){for(var o=null,a=!1,l=h(c=null,n,i);l!==n;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \\r\\n\\t]+/g,\" \");if(!(u=!(o&&!/ $/.test(o.data)||a||\" \"!==u[0])?u.substr(1):u)){l=p(l);continue}l.data=u,o=l}else{if(1!==l.nodeType){l=p(l);continue}t(l)||\"BR\"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,\"\")),o=null,a=!1):r(l)||i(l)?a=!(o=null):o&&(a=!1)}var u=h(c,l,i),c=l,l=u}o&&(o.data=o.data.replace(/ $/,\"\"),o.data||p(o))}}({element:e=\"string\"==typeof e?(m=m||new A).parseFromString('<x-turndown id=\"turndown-root\">'+e+\"</x-turndown>\",\"text/html\").getElementById(\"turndown-root\"):e.cloneNode(!0),isBlock:o,isVoid:i,isPre:n.preformattedCode?y:null}),e}function y(e){return\"PRE\"===e.nodeName||\"CODE\"===e.nodeName}function N(e,n){var t;return e.isBlock=o(e),e.isCode=\"CODE\"===e.nodeName||e.parentNode.isCode,e.isBlank=!i(t=e)&&!function(e){return l(e,a)}(t)&&/^\\s*$/i.test(t.textContent)&&!function(e){return c(e,r)}(t)&&!function(e){return c(e,a)}(t),e.flankingWhitespace=function(e,n){if(e.isBlock||n.preformattedCode&&e.isCode)return{leading:\"\",trailing:\"\"};var t=function(e){e=e.match(/^(([ \\t\\r\\n]*)(\\s*))[\\s\\S]*?((\\s*?)([ \\t\\r\\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}(e.textContent);t.leadingAscii&&E(\"left\",e,n)&&(t.leading=t.leadingNonAscii);t.trailingAscii&&E(\"right\",e,n)&&(t.trailing=t.trailingNonAscii);return{leading:t.leading,trailing:t.trailing}}(e,n),e}function E(e,n,t){var r,i,n=\"left\"===e?(r=n.previousSibling,/ $/):(r=n.nextSibling,/^ /);return r&&(3===r.nodeType?i=n.test(r.nodeValue):t.preformattedCode&&\"CODE\"===r.nodeName?i=!1:1!==r.nodeType||o(r)||(i=n.test(r.textContent))),i}var T=Array.prototype.reduce,R=[[/\\\\/g,\"\\\\\\\\\"],[/\\*/g,\"\\\\*\"],[/^-/g,\"\\\\-\"],[/^\\+ /g,\"\\\\+ \"],[/^(=+)/g,\"\\\\$1\"],[/^(#{1,6}) /g,\"\\\\$1 \"],[/`/g,\"\\\\`\"],[/^~~~/g,\"\\\\~~~\"],[/\\[/g,\"\\\\[\"],[/\\]/g,\"\\\\]\"],[/^>/g,\"\\\\>\"],[/_/g,\"\\\\_\"],[/^(\\d+)\\. /g,\"$1\\\\. \"]];function C(e){if(!(this instanceof C))return new C(e);this.options=function(e){for(var n=1;n<arguments.length;n++){var t,r=arguments[n];for(t in r)r.hasOwnProperty(t)&&(e[t]=r[t])}return e}({},{rules:t,headingStyle:\"setext\",hr:\"* * *\",bulletListMarker:\"*\",codeBlockStyle:\"indented\",fence:\"```\",emDelimiter:\"_\",strongDelimiter:\"**\",linkStyle:\"inlined\",linkReferenceStyle:\"full\",br:\"  \",preformattedCode:!1,blankReplacement:function(e,n){return n.isBlock?\"\\n\\n\":\"\"},keepReplacement:function(e,n){return n.isBlock?\"\\n\\n\"+n.outerHTML+\"\\n\\n\":n.outerHTML},defaultReplacement:function(e,n){return n.isBlock?\"\\n\\n\"+e+\"\\n\\n\":e}},e),this.rules=new f(this.options)}function k(e){var r=this;return T.call(e.childNodes,function(e,n){var t=\"\";return 3===(n=new N(n,r.options)).nodeType?t=n.isCode?n.nodeValue:r.escape(n.nodeValue):1===n.nodeType&&(t=function(e){var n=this.rules.forNode(e),t=k.call(this,e),r=e.flankingWhitespace;(r.leading||r.trailing)&&(t=t.trim());return r.leading+n.replacement(t,e,this.options)+r.trailing}.call(r,n)),b(e,t)},\"\")}function b(e,n){var t=function(e){for(var n=e.length;0<n&&\"\\n\"===e[n-1];)n--;return e.substring(0,n)}(e),r=n.replace(/^\\n*/,\"\"),n=Math.max(e.length-t.length,n.length-r.length);return t+\"\\n\\n\".substring(0,n)+r}return C.prototype={turndown:function(e){if(null==(n=e)||\"string\"!=typeof n&&(!n.nodeType||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType))throw new TypeError(e+\" is not a string, or an element/document/fragment node.\");var n;if(\"\"===e)return\"\";e=k.call(this,new v(e,this.options));return function(n){var t=this;return this.rules.forEach(function(e){\"function\"==typeof e.append&&(n=b(n,e.append(t.options)))}),n.replace(/^[\\t\\r\\n]+/,\"\").replace(/[\\t\\r\\n\\s]+$/,\"\")}.call(this,e)},use:function(e){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.use(e[n]);else{if(\"function\"!=typeof e)throw new TypeError(\"plugin must be a Function or an Array of Functions\");e(this)}return this},addRule:function(e,n){return this.rules.add(e,n),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return R.reduce(function(e,n){return e.replace(n[0],n[1])},e)}},C}();"
  },
  {
    "path": "ChatGPT/src-tauri/tauri.conf.json",
    "content": "{\n  \"build\": {\n    \"beforeDevCommand\": \"npm run dev:fe\",\n    \"beforeBuildCommand\": \"npm run build:fe\",\n    \"devPath\": \"http://localhost:1420\",\n    \"distDir\": \"../dist\"\n  },\n  \"package\": {\n    \"productName\": \"ChatGPT\",\n    \"version\": \"0.12.0\"\n  },\n  \"tauri\": {\n    \"allowlist\": {\n      \"all\": false,\n      \"globalShortcut\": {\n        \"all\": true\n      },\n      \"fs\": {\n        \"all\": false,\n        \"readFile\": true,\n        \"writeFile\": true,\n        \"readDir\": true,\n        \"createDir\": true,\n        \"exists\": true,\n        \"removeFile\": true,\n        \"removeDir\": true,\n        \"scope\": [\n          \"$HOME/.chatgpt/**\"\n        ]\n      },\n      \"path\": {\n        \"all\": true\n      },\n      \"os\": {\n        \"all\": true\n      },\n      \"process\": {\n        \"all\": true,\n        \"exit\": true,\n        \"relaunch\": true,\n        \"relaunchDangerousAllowSymlinkMacos\": true\n      }\n    },\n    \"systemTray\": {\n      \"iconPath\": \"icons/tray-icon.png\",\n      \"iconAsTemplate\": true,\n      \"menuOnLeftClick\": false\n    },\n    \"bundle\": {\n      \"active\": true,\n      \"category\": \"DeveloperTool\",\n      \"copyright\": \"\",\n      \"deb\": {\n        \"depends\": []\n      },\n      \"externalBin\": [],\n      \"icon\": [\n        \"icons/32x32.png\",\n        \"icons/128x128.png\",\n        \"icons/128x128@2x.png\",\n        \"icons/icon.icns\",\n        \"icons/icon.ico\"\n      ],\n      \"identifier\": \"com.lencx.chatgpt\",\n      \"longDescription\": \"ChatGPT Desktop Application\",\n      \"macOS\": {\n        \"entitlements\": null,\n        \"exceptionDomain\": \"\",\n        \"frameworks\": [],\n        \"providerShortName\": null,\n        \"signingIdentity\": null\n      },\n      \"shortDescription\": \"ChatGPT\",\n      \"targets\": \"all\",\n      \"windows\": {\n        \"certificateThumbprint\": null,\n        \"digestAlgorithm\": \"sha256\",\n        \"timestampUrl\": \"\",\n        \"webviewInstallMode\": {\n          \"silent\": true,\n          \"type\": \"embedBootstrapper\"\n        }\n      }\n    },\n    \"security\": {\n      \"csp\": null\n    },\n    \"updater\": {\n      \"active\": true,\n      \"dialog\": false,\n      \"endpoints\": [\n        \"https://lencx.github.io/ChatGPT/install.json\"\n      ],\n      \"pubkey\": \"dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEIxMjY4OUI5MTVFNjBEMDUKUldRRkRlWVZ1WWttc1NGWEE0RFNSb0RqdnhsekRJZTkwK2hVLzhBZTZnaHExSEZ1ZEdzWkpXTHkK\"\n    }\n  }\n}"
  },
  {
    "path": "ChatGPT/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ESNext\",\n    \"useDefineForClassFields\": true,\n    \"lib\": [\"DOM\", \"DOM.Iterable\", \"ESNext\"],\n    \"allowJs\": false,\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": false,\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Node\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react-jsx\",\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"src/*\"],\n      \"@view/*\": [\"src/view/*\"],\n      \"@comps/*\": [\"src/components/*\"],\n      \"@layout/*\": [\"src/layout/*\"]\n    }\n  },\n  \"include\": [\"src\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n"
  },
  {
    "path": "ChatGPT/tsconfig.node.json",
    "content": "{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Node\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n"
  },
  {
    "path": "ChatGPT/vite.config.ts",
    "content": "import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport tsconfigPaths from 'vite-tsconfig-paths';\nimport commonjs from 'vite-plugin-commonjs'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [tsconfigPaths(), react(),commonjs()],\n\n  // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`\n  // prevent vite from obscuring rust errors\n  clearScreen: false,\n  // tauri expects a fixed port, fail if that port is not available\n  server: {\n    port: 1420,\n    strictPort: true,\n  },\n  // to make use of `TAURI_DEBUG` and other env variables\n  // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand\n  envPrefix: ['VITE_', 'TAURI_'],\n  build: {\n    // Tauri supports es2021\n    target: ['es2021', 'chrome100', 'safari13'],\n    // don't minify for debug builds\n    minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,\n    // produce sourcemaps for debug builds\n    sourcemap: !!process.env.TAURI_DEBUG,\n    rollupOptions: {\n      output: {\n        manualChunks: {\n          ant: ['antd'],\n          antico: ['@ant-design/icons'],\n          editor: ['@monaco-editor/react'],\n          utils: ['lodash', 'uuid', 'dayjs', 'clsx'],\n          rrr: ['react', 'react-dom', 'react-router-dom'],\n          rm: ['react-markdown'],\n          rsh: ['react-syntax-highlighter'],\n          md: ['github-markdown-css', 'rehype-raw', 'remark-comment-config', 'remark-gfm'],\n        },\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2023 NsLearning\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "LangHelper/Assess/IflytekAssessment.py",
    "content": "# -*- coding:utf-8 -*-\n\nfrom builtins import Exception, str, bytes\n\nimport websocket\nimport datetime\nimport hashlib\nimport base64\nimport hmac\nimport json\nfrom urllib.parse import urlencode\nimport time\nimport ssl\nfrom wsgiref.handlers import format_date_time\nfrom datetime import datetime\nfrom time import mktime\nimport _thread as thread\nimport os\n\nSTATUS_FIRST_FRAME = 0  # 第一帧的标识\nSTATUS_CONTINUE_FRAME = 1  # 中间帧标识\nSTATUS_LAST_FRAME = 2  # 最后一帧的标识\n\nclass Ws_Param(object):\n    # 初始化\n    def __init__(\n                self, \n                APPID: str, \n                APIKey: str, \n                APISecret: str, \n                AudioFile: str, \n                Text:str,\n                SUB:str = \"ise\",\n                ENT: str= \"en_vip\",# en_vip ,cn_vip\n                CATEGORY: str =\"read_sentence\",\n        ):\n        self.APPID = APPID\n        self.APIKey = APIKey\n        self.APISecret = APISecret\n        self.AudioFile = AudioFile\n        self.Text = Text\n        self.SUB = SUB\n        self.ENT = ENT\n        self.CATEGORY = CATEGORY\n\n        # 公共参数(common)\n        self.CommonArgs = {\"app_id\": self.APPID}\n        # 业务参数(business)，更多个性化参数可在官网查看\n        self.BusinessArgs = {\"category\": self.CATEGORY, \"sub\": self.SUB, \"ent\": self.ENT, \"cmd\": \"ssb\", \"auf\": \"audio/L16;rate=16000\",\n                             \"aue\": \"raw\", \"text\": self.Text, \"ttp_skip\": True, \"aus\": 1}\n\n    # 生成url\n    def create_url(self):\n        # wws请求对Python版本有要求，py3.7可以正常访问，如果py版本请求wss不通，可以换成ws请求，或者更换py版本\n        url = 'ws://ise-api.xfyun.cn/v2/open-ise'\n        # 生成RFC1123格式的时间戳\n        now = datetime.now()\n        date = format_date_time(mktime(now.timetuple()))\n\n        # 拼接字符串\n        signature_origin = \"host: \" + \"ise-api.xfyun.cn\" + \"\\n\"\n        signature_origin += \"date: \" + date + \"\\n\"\n        signature_origin += \"GET \" + \"/v2/open-ise \" + \"HTTP/1.1\"\n        # 进行hmac-sha256进行加密\n        signature_sha = hmac.new(self.APISecret.encode('utf-8'), signature_origin.encode('utf-8'),\n                                 digestmod=hashlib.sha256).digest()\n        signature_sha = base64.b64encode(signature_sha).decode(encoding='utf-8')\n\n        authorization_origin = \"api_key=\\\"%s\\\", algorithm=\\\"%s\\\", headers=\\\"%s\\\", signature=\\\"%s\\\"\" % (\n            self.APIKey, \"hmac-sha256\", \"host date request-line\", signature_sha)\n        authorization = base64.b64encode(authorization_origin.encode('utf-8')).decode(encoding='utf-8')\n        # 将请求的鉴权参数组合为字典\n        v = {\n            \"authorization\": authorization,\n            \"date\": date,\n            \"host\": \"ise-api.xfyun.cn\"\n        }\n        # 拼接鉴权参数，生成url\n        url = url + '?' + urlencode(v)\n\n        # 此处打印出建立连接时候的url,参考本demo的时候，比对相同参数时生成的url与自己代码生成的url是否一致\n        print(\"date: \", date)\n        print(\"v: \", v)\n        print('websocket url :', url)\n        return url\n\nclass Assessment:\n    def __init__(self,APPID,APISecret,APIKey,AudioFile):\n        self.APPID = APPID\n        self.APIKey = APIKey\n        self.APISecret = APISecret\n        self.AudioFile = AudioFile\n        self.Text = \"\"\n\n        self.wsParam =None\n        self.ws = None\n        self.wsUrl =None \n        self.finished = False\n        self.scores ={\n            \"fluency_score\":None,\n            \"standard_score\":None,\n            \"accuracy_score\":None,\n            \"total_score\":None,\n        }\n        self.fluency_score = 5\n        self.standard_score = 5\n        self.total_score = 5 \n        self.accuracy_score = 5\n    def start_connection(self,text):\n        if text.strip():\n            self.finished = False\n            self.Text = text\n            self.wsParam = Ws_Param(APPID=self.APPID, APISecret=self.APISecret,APIKey=self.APIKey,AudioFile=self.AudioFile, Text=self.Text)\n            websocket.enableTrace(False)\n            self.wsUrl = self.wsParam.create_url()\n            self.ws = websocket.WebSocketApp(self.wsUrl, on_message=self.on_message, on_error=self.on_error, on_close=self.on_close)\n            self.ws.on_open = self.on_open\n            self.ws.run_forever(sslopt={\"cert_reqs\": ssl.CERT_NONE})\n        else:\n            print(\"text is not allowed to be None\" )\n    \n    def close_connection(self):\n        if self.ws:\n            self.ws.close()\n        self.finished = True\n        print(\"finished whatever receive!\")\n    def get_finish_state(self):\n        return self.finished\n    # 收到websocket消息的处理\n    def on_message(self,ws, message):\n        try:\n            code = json.loads(message)[\"code\"]\n            sid = json.loads(message)[\"sid\"]\n            if code != 0:\n                errMsg = json.loads(message)[\"message\"]\n                print(\"sid:%s call error:%s code is:%s\" % (sid, errMsg, code))\n\n            else:\n                data = json.loads(message)[\"data\"]\n                status = data[\"status\"]\n                result = data[\"data\"]\n                if (status == 2):\n                    xml = base64.b64decode(result)\n                    #python在windows上默认用gbk编码，print时需要做编码转换，mac等其他系统自行调整编码\n                    print(xml.decode(\"gbk\"))\n                    import xml.etree.ElementTree as ET\n                    xml_content = xml.decode(\"gbk\")\n                    root = ET.fromstring(xml_content)\n                    sentence =root.findall('read_sentence/rec_paper/read_chapter/sentence')[0]\n                    if sentence:\n                        self.scores['fluency_score'] = sentence.get('fluency_score')\n                        self.scores['standard_score'] = sentence.get('standard_score')\n                        self.scores['total_score'] = sentence.get('total_score')\n                        self.scores['accuracy_score'] =sentence.get('accuracy_score')\n                        self.close_connection()\n                        print(self.scores)\n                    self.finished =True\n\n        except Exception as e:\n            self.finished =True\n            print(\"receive msg,but parse exception:\", e)\n\n\n    # 收到websocket错误的处理\n    def on_error(self,ws, error):\n        print(\"### error:\", error)\n        self.close_connection()\n\n    # 收到websocket关闭的处理\n    def on_close(self,ws):\n        print(\"### closed ###\")\n        self.close_connection()\n\n\n    # 收到websocket连接建立的处理\n    def on_open(self,ws):\n        def run(*args):\n            frameSize = 1280  # 每一帧的音频大小\n            intervel = 0.04  # 发送音频间隔(单位:s)\n            status = STATUS_FIRST_FRAME  # 音频的状态信息，标识音频是第一帧，还是中间帧、最后一帧\n\n            with open(self.wsParam.AudioFile, \"rb\") as fp:\n                while True:\n                    buf = fp.read(frameSize)\n                    # 文件结束\n                    if not buf:\n                        status = STATUS_LAST_FRAME\n                    # 第一帧处理\n                    # 发送第一帧音频，带business 参数\n                    # appid 必须带上，只需第一帧发送\n                    if status == STATUS_FIRST_FRAME:\n                        d = {\"common\": self.wsParam.CommonArgs,\n                            \"business\": self.wsParam.BusinessArgs,\n                            \"data\": {\"status\": 0}}\n                        d = json.dumps(d)\n                        ws.send(d)\n                        status = STATUS_CONTINUE_FRAME\n                    # 中间帧处理\n                    elif status == STATUS_CONTINUE_FRAME:\n                        d = {\"business\": {\"cmd\": \"auw\", \"aus\": 2, \"aue\": \"raw\"},\n                            \"data\": {\"status\": 1, \"data\": str(base64.b64encode(buf).decode())}}\n                        ws.send(json.dumps(d))\n                    # 最后一帧处理\n                    elif status == STATUS_LAST_FRAME:\n                        d = {\"business\": {\"cmd\": \"auw\", \"aus\": 4, \"aue\": \"raw\"},\n                            \"data\": {\"status\": 2, \"data\": str(base64.b64encode(buf).decode())}}\n                        ws.send(json.dumps(d))\n                        time.sleep(1)\n                        break\n                    # 模拟音频采样间隔\n                    time.sleep(intervel)\n            ws.close()\n            self.finished =True\n\n        thread.start_new_thread(run, ())\n\n# test\nif __name__ == \"__main__\":\n    #待评测文本 utf8 编码，需要加utf8bom 头\n    # TEXT = '\\uFEFF'+ \"今天天气怎么样\"\n    #直接从文件读取的方式\n    currentdir = os.path.dirname(os.path.abspath(__file__))\n    txtfile = os.path.join(currentdir,\"../Resource/en/read_sentence_en.txt\")\n    audiofile = os.path.join(currentdir,\"../Resource/en/read_sentence_en.pcm\")\n    TEXT = '\\uFEFF'+ open(txtfile,\"r\",encoding='utf-8').read()\n    time1 = datetime.now()\n    assess = Assessment(APPID='', APISecret='',\n                       APIKey='',\n                       AudioFile=audiofile)\n    assess.start_connection(text=TEXT)\n    time2 = datetime.now()\n    print(time2 - time1)\n\n"
  },
  {
    "path": "LangHelper/Assess/SpeechSuper.py",
    "content": "#_*_encoding:utf-8_*_\nimport time\nimport json\nimport asyncio\nimport hashlib\nimport websockets\n\n#In order to try it out for free, you should email them. \n#API price: https://www.speechsuper.com/index.html#Pricing\n\nclass SpeechSuper:\n    def __init__(\n            self,\n            appKey: str,\n            secretKey: str,\n            audioPath: str,\n            audioType: str = \"wav\",\n            audioSampleRate: int = 16000,\n            coreType: str = \"sent.eval\",\n            baseUrl: str = \"wss://api.speechsuper.com/\"\n    ) -> None:\n        self.appKey = appKey\n        self.secretKey = secretKey\n        self.audioPath = audioPath\n        self.audioType = audioType\n        self.coreType = coreType\n        self.audioSampleRate = audioSampleRate\n        self.baseUrl = baseUrl\n        self.scores = {\n             \"fluency\":None,\n             \"rhythm\":None,\n             \"overall\":None,\n             \"pronunciation\": None,\n             \"speed\": None\n        }\n    # Send authentication\n    async def initConnnct(self,websocket):\n            t = time.time()\n            timestamp = '%d' % int(round(t * 1000))\n            connectStr = (self.appKey + timestamp + self.secretKey).encode(\"utf-8\")\n            connectSig = hashlib.sha1(connectStr).hexdigest()\n\n            jconnect = {\n                \"cmd\" : \"connect\",\n                \"param\" : {\n                    \"sdk\": {\n                        \"version\": 16777472,\n                        \"source\": 4,\n                        \"protocol\": 1\n                    },\n                    \"app\": {\n                        \"applicationId\": self.appKey,\n                        \"sig\": connectSig,\n                        \"timestamp\": timestamp\n                    }\n                }\n            }\n\n            param = json.dumps(jconnect)\n            await websocket.send(param)\n            return True\n\n    # Send evaluation request\n    async def startScore(self, websocket, request):\n            # Send start request\n            userId =\"userId\"\n            timestamp = '%d' % int(round(time.time() * 1000))\n            startStr = (self.appKey + timestamp + userId + self.secretKey).encode(\"utf-8\")\n            startSig = hashlib.sha1(startStr).hexdigest()\n\n            startObj = {\n                \"cmd\": \"start\",\n                \"param\": {\n                    \"app\": {\n                        \"userId\": userId,\n                        \"applicationId\": self.appKey,\n                        \"timestamp\": timestamp,\n                        \"sig\": startSig\n                    },\n                    \"audio\": {\n                        \"audioType\": self.audioType,\n                        \"channel\": 1,\n                        \"sampleBytes\": 2,\n                        \"sampleRate\": self.audioSampleRate\n                    },\n                    \"request\": request\n                }\n            }\n\n            startObj[\"param\"][\"request\"][\"tokenId\"] = \"tokenId\"\n\n            startStr = json.dumps(startObj)\n            await websocket.send(startStr)\n\n            # Send audio data\n            f = open(self.audioPath, \"rb\")\n            while True:\n                data = f.read(1024)\n                if not data:\n                    break\n                await websocket.send(data)\n            f.close()\n\n            # Send stop request\n            empty_arry = {\n                \"cmd\": \"stop\",\n            }\n            empty_arry2 = json.dumps(empty_arry)\n            await websocket.send(empty_arry2)\n        \n            return True\n\n\n\n    async def main_logic(self,refText):\n        #Establish connection\n        async with websockets.connect(str(self.baseUrl) + str(self.coreType), ping_timeout = None) as websocket:\n            \n            await self.initConnnct(websocket)\n        \n            await self.startScore(websocket,{\"coreType\":self.coreType,\"refText\":refText})\n\n            # Return result\n            try:\n                async for message in websocket:\n                    print('message===>' + message)\n                    message = json.loads(message)\n                    if message.get('errId'):\n                         print(\"error:\", message['error'])\n                    else:\n                        self.scores[\"fluency\"] = message[\"result\"][\"fluency\"]\n                        self.scores[\"rhythm\"] = message[\"result\"][\"rhythm\"]\n                        self.scores[\"pronunciation\"] = message[\"result\"][\"pronunciation\"]\n                        self.scores[\"speed\"] = message[\"result\"][\"speed\"]\n                        self.scores[\"overall\"] = message[\"result\"][\"overall\"]\n                        print(self.scores)\n                    if websocket and websocket.open:\n                         await websocket.close()\n            except websockets.exceptions.ConnectionClosedError:\n                print('Close connection to websocket')\n    "
  },
  {
    "path": "LangHelper/Assess/__init__.py",
    "content": ""
  },
  {
    "path": "LangHelper/Recognition/IflytekRec.py",
    "content": "\nimport hmac\nimport base64\nimport websocket\nimport hashlib\nimport json, time, threading,os\nfrom urllib.parse import quote\n\nclass  Recognition():\n    def __init__(self, app_id, api_key):\n\n        self.app_id = app_id\n        self.api_key = api_key\n        self.base_url = \"ws://rtasr.xfyun.cn/v1/ws\"\n        self.ts = None\n        self.signa = None\n\n        self.ws = None\n        self.trecv = None\n        self.finished = False\n        self.lang = 'en'     #中文、中英混合识别：cn；英文：en；\n        self.result = \"\"\n\n    #update request url to adviod this error: illegal access|ts expired\n    def update_request_parameter(self):\n        self.ts = str(int(time.time()))\n        tt = (self.app_id + self.ts).encode('utf-8')\n        md5 = hashlib.md5()\n        md5.update(tt)\n        baseString = md5.hexdigest()\n        baseString = bytes(baseString, encoding='utf-8')\n        apiKey = self.api_key.encode('utf-8')\n        signa = hmac.new(apiKey, baseString, hashlib.sha1).digest()\n        signa = base64.b64encode(signa)\n        self.signa = str(signa, 'utf-8')\n    \n    def set_language(self, lang):\n        self.lang = 'cn' if (lang == 'cn') else 'en'\n\n    def get_finish_state(self):\n        return self.finished\n    \n    def start_connection(self):\n        self.finished = False\n        self.result = \"\"\n        if self.ws:\n            self.close()\n        if self.trecv:\n            self.trecv.join()\n        self.update_request_parameter()\n        Xunfeiurl = self.base_url + \"?appid=\" + self.app_id + \"&ts=\" + self.ts + \"&signa=\" + quote(self.signa) + \"&lang=\" + self.lang\n        self.ws = websocket.create_connection(Xunfeiurl)\n        self.trecv = threading.Thread(target=self.recv)\n        self.trecv.start()\n        print(\"connected sucessfully!\")\n\n    def check_connection(self):\n        return self.ws and self.ws.connected\n\n    def send(self, file_path, chunk):\n        # two ways to send data, if chunk is not None, send data by chunk\n        if chunk: \n            if self.ws and self.ws.connected:\n                self.ws.send(chunk)\n                time.sleep(0.04)  # 1280bytes /40ms \n            else:\n                print(\"can't send data to xunfei, not connected!\")\n        else:\n            file_object = open(file_path, 'rb')\n            try:\n                index = 1\n                while True:\n                    chunk = file_object.read(1280)\n                    if not chunk:\n                        break\n                    self.ws.send(chunk)\n\n                    index += 1\n                    time.sleep(0.04)\n            finally:\n                file_object.close()\n        \n    def send_endtag(self):\n        self.ws.send(bytes(self.end_tag.encode('utf-8')))\n        print(\"send end tag success\")\n    \n    def recv(self):\n        try:\n            while self.ws.connected:\n                result = str(self.ws.recv())\n                if len(result) == 0:\n                    self.finished = True\n                    print(\"receive result end\")\n                    break\n                result_dict = json.loads(result)\n                # 解析结果\n                if result_dict[\"action\"] == \"started\":\n                    print(\"handshake success, result: \" + result)\n\n                if result_dict[\"action\"] == \"result\":\n                    #parse data\n                    data = json.loads(result_dict[\"data\"])\n                    if data[\"cn\"][\"st\"][\"type\"] == '0':\n                        stt_text =  \"\"\n                        raw_rt = data[\"cn\"][\"st\"][\"rt\"]\n                        for rt in raw_rt:\n                            raw_ws = rt['ws']\n                            for ws in raw_ws:\n                                raw_cw = ws['cw']\n                                for cw in raw_cw:\n                                    stt_text += cw['w']\n                        print(\"rtasr result: \" + stt_text)\n                        self.result += stt_text\n                if result_dict[\"action\"] == \"error\":\n                    print(\"rtasr error: \" + result)\n                    self.ws.close()\n                    self.finished = True\n                    return\n        except websocket.WebSocketConnectionClosedException:\n            print(\"receive result end\")\n            self.finished = True\n\n    def close(self):\n        if self.ws:\n            self.ws.close()\n            self.finished = True\n            print(\" close connection manually\")\n\n# test\nif __name__ == \"__main__\":\n    rec = Recognition(app_id = \"\", api_key=\"\")\n    currentdir = os.path.dirname(os.path.abspath(__file__))\n    pcmfile = os.path.join(currentdir,\"../Resource/rec/realtime.pcm\")\n    # rec.set_language(\"cn\") #中英识别，默认en\n    rec.start_connection()\n    rec.send(pcmfile,None)\n    print(rec.result)"
  },
  {
    "path": "LangHelper/Recognition/__init__.py",
    "content": ""
  },
  {
    "path": "LangHelper/Resource/cn/read_sentence_cn.txt",
    "content": "今天天气怎么样"
  },
  {
    "path": "LangHelper/Resource/cn/read_syllable_cn.txt",
    "content": "好"
  },
  {
    "path": "LangHelper/Resource/en/oral_translation_en.txt",
    "content": "[topic]\n1. British People\n1.1.  British people usually say \"\"hello\"\" or \"\"nice to meet you\"\" and shake your hand when they meet you for the first time. They behave politely in public. They think it's rude to push in before others. They always queue. They are very polite at home as well. When in Rome, do as the Romans do. When we are in a strange place, we should do as the local people do.\n1.2. For the first meeting, the English will usually say \"\"hello\"\" or \"\"nice to meet you\"\" and shake hands with you. In the public places, they behave themselves well; they think that jumping in the line is a rude behavior, so they always line up. They are often very polite at home. When we are in a strange place, do in Rome as Rome does. We should behave well as local people.\n1.3. When they meet for the first time, the British usually say \"\"hello\"\" or \"\"nice to meet you\"\", and shake hands with each other. In public, they behave themselves appropriately. They think it is impolite to jump the queue, and they always wait in line patiently for their turns. They are also very polite at home. As the saying goes, \"\"when in Rome, do as the Romans do\"\". When we are in a strange place, we should act as the locals do.\n1.4. When first meet, English are likely to say \"\"hello\"\" or \"\"nice to meet you\"\" and shake hands with you. They behave well in public. They usually line up because they think queue jumping is very impolite. And they are also very polite at home. There is an old saying \"\"Do in Rome as Rome does\"\". So when we are in a new place, we should behave ourselves as the locals do.\n1.5. When meeting for the first time, Englishmen usually say \"\"hello\"\" or \"\"nice to meet you\"\" with a handshake. They behave themselves well in public places. They regard jumping a queue as one of the rude behavior, so they always queue up. They are also very polite at home. When in Rome, do as the Romans do. When we are in a strange place, we should behavior just like the local people.\n1.6. For the first meeting, English people usually say \"\"Hello\"\" or \"\"Nice to meet you\"\" and shake hands with you. In the public place, they also act very decently. In their views, it is very impolite to cut in line. They have formed a habit to wait in a queue. At home, they are also very polite. When in a strange place, we should do in Rome as the Romans do. Moreover, it is also polite that we behave like the local people.\n1.7. In first meeting, the English often say \"\"hi\"\" or \"\"nice to meet you!\"\" and then shake hands with you. In public occasions, they behave mannerly. They think jumping a queue is impolite and they always line up. Also, they are polite at home. When in Rome do as the Romans do. When we are in a strange land, we should behave like the natives.\n[lmtext]\nBritish People\nBritish people usually say \"\"hello\"\" or \"\"nice to meet you\"\" and shake your hand when they meet you for the first time. They behave politely in public. They think it's rude to push in before others. They always queue. They are very polite at home as well. When in Rome, do as the Romans do. When we are in a strange place, we should do as the local people do.\nFor the first meeting, the English will usually say \"\"hello\"\" or \"\"nice to meet you\"\" and shake hands with you. In the public places, they behave themselves well; they think that jumping in the line is a rude behavior, so they always line up. They are often very polite at home. When we are in a strange place, do in Rome as Rome does. We should behave well as local people.\nWhen they meet for the first time, the British usually say \"\"hello\"\" or \"\"nice to meet you\"\", and shake hands with each other. In public, they behave themselves appropriately. They think it is impolite to jump the queue, and they always wait in line patiently for their turns. They are also very polite at home. As the saying goes, \"\"when in Rome, do as the Romans do\"\". When we are in a strange place, we should act as the locals do.\nWhen first meet, English are likely to say \"\"hello\"\" or \"\"nice to meet you\"\" and shake hands with you. They behave well in public. They usually line up because they think queue jumping is very impolite. And they are also very polite at home. There is an old saying \"\"Do in Rome as Rome does\"\". So when we are in a new place, we should behave ourselves as the locals do.\nWhen meeting for the first time, Englishmen usually say \"\"hello\"\" or \"\"nice to meet you\"\" with a handshake. They behave themselves well in public places. They regard jumping a queue as one of the rude behavior, so they always queue up. They are also very polite at home. When in Rome, do as the Romans do. When we are in a strange place, we should behavior just like the local people.\nFor the first meeting, English people usually say \"\"Hello\"\" or \"\"Nice to meet you\"\" and shake hands with you. In the public place, they also act very decently. In their views, it is very impolite to cut in line. They have formed a habit to wait in a queue. At home, they are also very polite. When in a strange place, we should do in Rome as the Romans do. Moreover, it is also polite that we behave like the local people.\nIn first meeting, the English often say \"\"hi\"\" or \"\"nice to meet you!\"\" and then shake hands with you. In public occasions, they behave mannerly. They think jumping a queue is impolite and they always line up. Also, they are polite at home. When in Rome do as the Romans do. When we are in a strange land, we should behave like the natives.\n[vocabulary]\nbehavior /b ih 'hh ey v y ax/\nuncourteous /,ah n 'k er t ir s/"
  },
  {
    "path": "LangHelper/Resource/en/picture_talk_en.txt",
    "content": "[topic]\n1. Throw Litter\n1.1. Mary and her classmates went outing last weekend. Someone was flying kites, some people were having snacks. There were litters on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good deed.\n1.2. Last weekend, Mary went to the park with her classmates. They had a picnic in the park. Some people flew kites there. They had great fun there. Mary saw some rubbish on the road. She picked up the rubbish and threw it into the dustbin. The teacher praised Mary.\n1.3. Last Saturday, Mary's class went to the park. They brought some food and had a picnic on the grass. After that, they flew kites there. Suddenly, Mary found that there was some rubbish on the road. She then picked up the rubbish and threw it into the dustbin. Mary's teacher saw this. She said \"\"Well done\"\" to Mary. Mary was very happy.\n1.4. Mary went to the park with her friend last weekend. They had a picnic there, while some people were flying kites. Mary's friend wanted to fly a kite too. So she threw waste bottles and paper on the ground and ran away. Mary saw this and picked up the rubbish. Then she threw it into the garbage can. A woman noticed what Mary had done. She praised Mary for her good behavior.\n1.5. Mary went to the park to have a picnic with her friend last Sunday. They brought some juice and bread as lunch. After lunch, they joined other people to fly kites. Mary saw some waste bottles and paper on the ground. Someone threw them away after having a picnic. Mary cleaned the road, putting the garbage into a garbage can. A lady saw this and praised Mary for what she had done.\n1.6. Last weekend, Mary and her classmates went to the park. Some of them flew kites, and some of them had food on the grass. Mary brought some juice, bread and biscuits to share with her friend. After they finished eating, her friend went to fly a kite. Mary gathered their waste bottles and paper and was about to threw them into the dustbin. Suddenly, she saw some garbage on the ground. She picked up the garbage, and threw it away with their waste bottles and paper. Her good behavior was noticed by the manager of the park. The manager praised her.\n1.7. Last weekend, Mary went outing with her classmates. Mary and her friend were having drinks and some bread. Others were flying kites or playing games. After a while, there were litters on the ground. Mary saw these and started to pick up all the waste paper and bottles. She put them into the dustbin. Mary's teacher praised her for what she had done.\n1.8. Mary went for an outing with her classmates last weekend. Some people played games and some people went to fly kites. Mary and Lily were having some snacks. When they were about to play, Mary noticed that there were litters around them. So she picked up the waste bottles and paper and threw them in the dustbin. Just then, her teacher saw it and praised Mary for what she did.\n1.9. The school held an outing last weekend. Mary and her classmates had fun there. Some people were playing games while some were flying kites. Mary and one of her classmates were having some snacks. Then, Mary found that there were some waste paper and bottles on the ground. So she threw all of them into the dustbin. At last, the ground became clean and Mary was praised by her teacher.\n1.10. Mary and her classmates went for an outing last weekend. They were very happy. Someone was flying kites, some were having food. After having lunch, they went on playing games. Mary noticed that there were some litters on the ground. So she picked up all the litters and then put them in the dustbin. Mary's good deed was saw by her teacher. The teacher praised Mary and felt proud of what she had done.\n1.11. Last Saturday, Mary's teacher took her class to an outing. The whole class were very happy then. Some people were flying kites while some were playing games. At lunch time, they had food and drank juice together. After that, there were some waste bottles and paper on the road. Mary started to pick them up and threw them into the dustbin. Her teacher saw it and spoke highly of what Mary had done. Mary felt very proud of herself.\n1.12. Last weekend Mary and her classmates went outing and had a picnic. Some people were flying kites, some people were having snacks. Suddenly, they found there was a lot of litter on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good behavior.\n1.13. Last weekend Mary went to the park with Some friends. Some of them were flying kites. Some friends were eating food. Suddenly, they saw there was some rubbish on the road. Mary picked up the rubbish and put it into the garbage. The teacher said Mary was good.\n1.14.  Last weekend Mary went to the park. Some classmates were flying kites, some classmate were eating food. Suddenly, they saw there was a lot of rubbish on the road. Mary picked up the rubbish and put it into the dustbin. The teacher said Mary was a good girl.\n1.15.  Last weekend Mary had a picnic with her cousins in the park. Some were flying kites, some were eating food. They saw there was some litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary was good.\n1.16.  Last weekend Mary had a picnic with her cousins in the park. Some flew kites, some ate food. Suddenly, they saw someone dropped a lot of litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary did a good job.\n1.17.  Last weekend, Mary went to the park for a picnic with her friend. They brought a lot of food and enjoyed it very much. Lily went to fly kite but she left many rubbish on the ground. Marry cleaned it and put it into the rubbish can. The teacher saw it and she said to Marry, \"\"you are a good girl.\"\" What a good girl!\n[lmtext]\nThrow Litter\nMary and her classmates went outing last weekend. Someone was flying kites, some people were having snacks. There were litters on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good deed.\nLast weekend, Mary went to the park with her classmates. They had a picnic in the park. Some people flew kites there. They had great fun there. Mary saw some rubbish on the road. She picked up the rubbish and threw it into the dustbin. The teacher praised Mary.\nLast Saturday, Mary's class went to the park. They brought some food and had a picnic on the grass. After that, they flew kites there. Suddenly, Mary found that there was some rubbish on the road. She then picked up the rubbish and threw it into the dustbin. Mary's teacher saw this. She said \"\"Well done\"\" to Mary. Mary was very happy.\nMary went to the park with her friend last weekend. They had a picnic there, while some people were flying kites. Mary's friend wanted to fly a kite too. So she threw waste bottles and paper on the ground and ran away. Mary saw this and picked up the rubbish. Then she threw it into the garbage can. A woman noticed what Mary had done. She praised Mary for her good behavior.\nMary went to the park to have a picnic with her friend last Sunday. They brought some juice and bread as lunch. After lunch, they joined other people to fly kites. Mary saw some waste bottles and paper on the ground. Someone threw them away after having a picnic. Mary cleaned the road, putting the garbage into a garbage can. A lady saw this and praised Mary for what she had done.\nLast weekend, Mary and her classmates went to the park. Some of them flew kites, and some of them had food on the grass. Mary brought some juice, bread and biscuits to share with her friend. After they finished eating, her friend went to fly a kite. Mary gathered their waste bottles and paper and was about to threw them into the dustbin. Suddenly, she saw some garbage on the ground. She picked up the garbage, and threw it away with their waste bottles and paper. Her good behavior was noticed by the manager of the park. The manager praised her.\nLast weekend, Mary went outing with her classmates. Mary and her friend were having drinks and some bread. Others were flying kites or playing games. After a while, there were litters on the ground. Mary saw these and started to pick up all the waste paper and bottles. She put them into the dustbin. Mary's teacher praised her for what she had done.\nMary went for an outing with her classmates last weekend. Some people played games and some people went to fly kites. Mary and Lily were having some snacks. When they were about to play, Mary noticed that there were litters around them. So she picked up the waste bottles and paper and threw them in the dustbin. Just then, her teacher saw it and praised Mary for what she did.\nThe school held an outing last weekend. Mary and her classmates had fun there. Some people were playing games while some were flying kites. Mary and one of her classmates were having some snacks. Then, Mary found that there were some waste paper and bottles on the ground. So she threw all of them into the dustbin. At last, the ground became clean and Mary was praised by her teacher.\nMary and her classmates went for an outing last weekend. They were very happy. Someone was flying kites, some were having food. After having lunch, they went on playing games. Mary noticed that there were some litters on the ground. So she picked up all the litters and then put them in the dustbin. Mary's good deed was saw by her teacher. The teacher praised Mary and felt proud of what she had done.\nLast Saturday, Mary's teacher took her class to an outing. The whole class were very happy then. Some people were flying kites while some were playing games. At lunch time, they had food and drank juice together. After that, there were some waste bottles and paper on the road. Mary started to pick them up and threw them into the dustbin. Her teacher saw it and spoke highly of what Mary had done. Mary felt very proud of herself.\nLast weekend Mary and her classmates went outing and had a picnic. Some people were flying kites, some people were having snacks. Suddenly, they found there was a lot of litter on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good behavior.\nLast weekend Mary went to the park with Some friends. Some of them were flying kites. Some friends were eating food. Suddenly, they saw there was some rubbish on the road. Mary picked up the rubbish and put it into the garbage. The teacher said Mary was good.\nLast weekend Mary went to the park. Some classmates were flying kites, some classmate were eating food. Suddenly, they saw there was a lot of rubbish on the road. Mary picked up the rubbish and put it into the dustbin. The teacher said Mary was a good girl.\nLast weekend Mary had a picnic with her cousins in the park. Some were flying kites, some were eating food. They saw there was some litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary was good.\nLast weekend Mary had a picnic with her cousins in the park. Some flew kites, some ate food. Suddenly, they saw someone dropped a lot of litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary did a good job.\nLast weekend, Mary went to the park for a picnic with her friend. They brought a lot of food and enjoyed it very much. Lily went to fly kite but she left many rubbish on the ground. Marry cleaned it and put it into the rubbish can. The teacher saw it and she said to Marry, \"\"you are a good girl.\"\" What a good girl!"
  },
  {
    "path": "LangHelper/Resource/en/read_choice_en.txt",
    "content": "[choice]\n1. Snakes.\n2. Children.\n3. Cats.\n[keywords]\ncats\n[question]\nWhat did the woman dislike?"
  },
  {
    "path": "LangHelper/Resource/en/read_sentence_en.txt",
    "content": "[content]\nthere was a gentleman live near my house"
  },
  {
    "path": "LangHelper/Resource/en/read_word_en.txt",
    "content": "[word]\nhouse"
  },
  {
    "path": "LangHelper/Resource/en/retell_en.txt",
    "content": "[topic]\n1. The Goose Thief\n1.1.  Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\" The head teacher smiled and promised not to have them killed for the Christmas dinner.\n[keypoint]\n1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised.\n2. Students were all fond of them.\n3. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner.\n4. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school.\n5. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat.\n6. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students,\n7. They all ran to the pond.\n8. The head teacher asked for an explanation.\n9.  Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\"\n10. The head teacher smiled and promised not to have them killed for the Christmas dinner.\n[lmtext]\nThe Goose Thief\nTom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\" The head teacher smiled and promised not to have them killed for the Christmas dinner."
  },
  {
    "path": "LangHelper/Resource/en/topic_en.txt",
    "content": "[topic]\n1. The Goose Thief\n1.1.  Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\" The head teacher smiled and promised not to have them killed for the Christmas dinner.\n[keypoint]\n1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised.\n2. Students were all fond of them.\n3. One day, when Tom passed the school kitchen, \the heard the cooks talking about killing the geese for the teachers' Christmas dinner.\n4. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school.\n5. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat.\n6. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students,\n7. They all ran to the pond.\n8. The head teacher asked for an explanation.\n9.  Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\"\n10. The head teacher smiled and promised not to have them killed for the Christmas dinner.\n[lmtext]\nThe Goose Thief\nTom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"\"I won't let them be eaten!\"\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"\"It is unfair to them. We all love them!\"\" The head teacher smiled and promised not to have them killed for the Christmas dinner."
  },
  {
    "path": "LangHelper/Resource/speaker-info.txt",
    "content": "ID  AGE  GENDER  ACCENTS  REGION COMMENTS \np225  23  F    English    Southern  England\np226  22  M    English    Surrey\np227  38  M    English    Cumbria\np228  22  F    English    Southern  England\np229  23  F    English    Southern  England\np230  22  F    English    Stockton-on-tees\np231  23  F    English    Southern  England\np232  23  M    English    Southern  England\np233  23  F    English    Staffordshire\np234  22  F    Scottish  West  Dumfries\np236  23  F    English    Manchester\np237  22  M    Scottish  Fife\np238  22  F    NorthernIrish  Belfast\np239  22  F    English    SW  England\np240  21  F    English    Southern  England\np241  21  M    Scottish  Perth\np243  22  M    English    London\np244  22  F    English    Manchester\np245  25  M    Irish  Dublin\np246  22  M    Scottish  Selkirk\np247  22  M    Scottish  Argyll\np248  23  F    Indian  \np249  22  F    Scottish  Aberdeen\np250  22  F    English    SE  England\np251  26  M    Indian  \np252  22  M    Scottish  Edinburgh\np253  22  F    Welsh  Cardiff\np254  21  M    English    Surrey\np255  19  M    Scottish  Galloway\np256  24  M    English    Birmingham\np257  24  F    English    Southern  England\np258  22  M    English    Southern  England\np259  23  M    English    Nottingham\np260  21  M    Scottish  Orkney\np261  26  F    NorthernIrish  Belfast\np262  23  F    Scottish  Edinburgh\np263  22  M    Scottish  Aberdeen\np264  23  F    Scottish  West  Lothian\np265  23  F    Scottish  Ross\np266  22  F    Irish  Athlone\np267  23  F    English    Yorkshire\np268  23  F    English    Southern  England\np269  20  F    English    Newcastle\np270  21  M    English    Yorkshire\np271  19  M    Scottish  Fife\np272  23  M    Scottish  Edinburgh\np273  23  M    English    Suffolk\np274  22  M    English    Essex\np275  23  M    Scottish  Midlothian\np276  24  F    English    Oxford\np277  23  F    English    NE  England\np278  22  M    English    Cheshire\np279  23  M    English    Leicester\np280  25  F    Unknown  France (mic2 files unavailable)  \np281  29  M    Scottish  Edinburgh\np282  23  F    English    Newcastle\np283  24  F    Irish  Cork\np284  20  M    Scottish  Fife\np285  21  M    Scottish  Edinburgh\np286  23  M    English    Newcastle\np287  23  M    English    York\np288  22  F    Irish  Dublin\np292  23  M    NorthernIrish  Belfast\np293  22  F    NorthernIrish  Belfast\np294  33  F    American  San  Francisco\np295  23  F    Irish  Dublin\np297  20  F    American  New  York\np298  19  M    Irish  Tipperary\np299  25  F    American  California\np300  23  F    American  California\np301  23  F    American  North  Carolina\np302  20  M    Canadian  Montreal\np303  24  F    Canadian  Toronto\np304  22  M    NorthernIrish  Belfast\np305  19  F    American  Philadelphia\np306  21  F    American  New  York\np307  23  F    Canadian  Ontario\np308  18  F    American  Alabama\np310  21  F    American  Tennessee\np311  21  M    American  Iowa\np312  19  F    Canadian  Hamilton\np313  24  F    Irish  County  Down\np314  26  F    SouthAfrican  Cape  Town\np315  18  M    American  New  England  (Text and mic2 files unavailable) \np316  20  M    Canadian  Alberta\np317  23  F    Canadian  Hamilton\np318  32  F    American  Napa\np323  19  F    SouthAfrican  Pretoria\np326  26  M    Australian  English  Sydney\np329  23  F    American  \np330  26  F    American  \np333  19  F    American  Indiana\np334  18  M    American  Chicago\np335  25  F    NewZealand  English    \np336  18  F    SouthAfrican  Johannesburg\np339  21  F    American  Pennsylvania\np340  18  F    Irish  Dublin\np341  26  F    American  Ohio\np343  27  F    Canadian  Alberta\np345  22  M    American  Florida\np347  26  M    SouthAfrican  Johannesburg\np351  21  F    NorthernIrish  Derry\np360  19  M    American  New  Jersey\np361  19  F    American  New  Jersey\np362  29  F    American  \np363  22  M    Canadian  Toronto\np364  23  M    Irish  Donegal\np374  28  M    Australian  English  \np376  22  M    Indian\ns5    22  F    British (new speaker, more data would be released for training a speaker-dependent model) \n"
  },
  {
    "path": "LangHelper/Resource/tts_models--en--vctk--vits/config.json",
    "content": "{\n    \"output_path\": null,\n    \"logger_uri\": null,\n    \"run_name\": \"\",\n    \"project_name\": null,\n    \"run_description\": \"\",\n    \"print_step\": 25,\n    \"plot_step\": 100,\n    \"model_param_stats\": false,\n    \"wandb_entity\": null,\n    \"dashboard_logger\": \"tensorboard\",\n    \"log_model_step\": null,\n    \"save_step\": 10000,\n    \"save_n_checkpoints\": 5,\n    \"save_checkpoints\": true,\n    \"save_all_best\": false,\n    \"save_best_after\": 10000,\n    \"target_loss\": null,\n    \"print_eval\": false,\n    \"test_delay_epochs\": 0,\n    \"run_eval\": true,\n    \"run_eval_steps\": null,\n    \"distributed_backend\": \"nccl\",\n    \"distributed_url\": \"tcp://localhost:54321\",\n    \"mixed_precision\": false,\n    \"epochs\": 10000,\n    \"batch_size\": null,\n    \"eval_batch_size\": null,\n    \"grad_clip\": [\n        5.0,\n        5.0\n    ],\n    \"scheduler_after_epoch\": true,\n    \"lr\": 0.001,\n    \"optimizer\": \"AdamW\",\n    \"optimizer_params\": {\n        \"betas\": [\n            0.8,\n            0.99\n        ],\n        \"eps\": 1e-09,\n        \"weight_decay\": 0.01\n    },\n    \"lr_scheduler\": \"\",\n    \"lr_scheduler_params\": {},\n    \"use_grad_scaler\": false,\n    \"cudnn_enable\": true,\n    \"cudnn_deterministic\": false,\n    \"cudnn_benchmark\": true,\n    \"training_seed\": 54321,\n    \"model\": \"vits\",\n    \"num_loader_workers\": null,\n    \"num_eval_loader_workers\": 0,\n    \"use_noise_augment\": false,\n    \"audio\": {\n        \"fft_size\": 1024,\n        \"sample_rate\": 22050,\n        \"win_length\": 1024,\n        \"hop_length\": 256,\n        \"num_mels\": 80,\n        \"mel_fmin\": 0,\n        \"mel_fmax\": null\n    },\n    \"use_phonemes\": true,\n    \"phonemizer\": \"espeak\",\n    \"phoneme_language\": \"en\",\n    \"compute_input_seq_cache\": false,\n    \"text_cleaner\": \"phoneme_cleaners\",\n    \"enable_eos_bos_chars\": false,\n    \"test_sentences_file\": \"\",\n    \"phoneme_cache_path\": null,\n    \"characters\": {\n        \"characters_class\": \"TTS.tts.models.vits.VitsCharacters\",\n        \"vocab_dict\": null,\n        \"pad\": \"_\",\n        \"eos\": \"\",\n        \"bos\": \"\",\n        \"blank\": null,\n        \"characters\": \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n        \"punctuations\": \";:,.!?\\u00a1\\u00bf\\u2014\\u2026\\\"\\u00ab\\u00bb\\u201c\\u201d \",\n        \"phonemes\": \"\\u0251\\u0250\\u0252\\u00e6\\u0253\\u0299\\u03b2\\u0254\\u0255\\u00e7\\u0257\\u0256\\u00f0\\u02a4\\u0259\\u0258\\u025a\\u025b\\u025c\\u025d\\u025e\\u025f\\u0284\\u0261\\u0260\\u0262\\u029b\\u0266\\u0267\\u0127\\u0265\\u029c\\u0268\\u026a\\u029d\\u026d\\u026c\\u026b\\u026e\\u029f\\u0271\\u026f\\u0270\\u014b\\u0273\\u0272\\u0274\\u00f8\\u0275\\u0278\\u03b8\\u0153\\u0276\\u0298\\u0279\\u027a\\u027e\\u027b\\u0280\\u0281\\u027d\\u0282\\u0283\\u0288\\u02a7\\u0289\\u028a\\u028b\\u2c71\\u028c\\u0263\\u0264\\u028d\\u03c7\\u028e\\u028f\\u0291\\u0290\\u0292\\u0294\\u02a1\\u0295\\u02a2\\u01c0\\u01c1\\u01c2\\u01c3\\u02c8\\u02cc\\u02d0\\u02d1\\u02bc\\u02b4\\u02b0\\u02b1\\u02b2\\u02b7\\u02e0\\u02e4\\u02de\\u2193\\u2191\\u2192\\u2197\\u2198'\\u0329'\\u1d7b\",\n        \"is_unique\": true,\n        \"is_sorted\": true\n    },\n    \"add_blank\": true,\n    \"batch_group_size\": 0,\n    \"loss_masking\": null,\n    \"min_audio_len\": 1,\n    \"max_audio_len\": Infinity,\n    \"min_text_len\": 1,\n    \"max_text_len\": Infinity,\n    \"compute_f0\": false,\n    \"compute_energy\": false,\n    \"compute_linear_spec\": true,\n    \"precompute_num_workers\": 0,\n    \"start_by_longest\": false,\n    \"shuffle\": false,\n    \"drop_last\": false,\n    \"datasets\": [\n        {\n            \"formatter\": \"\",\n            \"dataset_name\": \"\",\n            \"path\": \"\",\n            \"meta_file_train\": \"\",\n            \"ignored_speakers\": null,\n            \"language\": \"\",\n            \"phonemizer\": \"\",\n            \"meta_file_val\": \"\",\n            \"meta_file_attn_mask\": \"\"\n        }\n    ],\n    \"test_sentences\": [\n        [\n            \"I\",\n            \"t\",\n            \" \",\n            \"t\",\n            \"o\",\n            \"o\",\n            \"k\",\n            \" \",\n            \"m\",\n            \"e\",\n            \" \",\n            \"q\",\n            \"u\",\n            \"i\",\n            \"t\",\n            \"e\",\n            \" \",\n            \"a\",\n            \" \",\n            \"l\",\n            \"o\",\n            \"n\",\n            \"g\",\n            \" \",\n            \"t\",\n            \"i\",\n            \"m\",\n            \"e\",\n            \" \",\n            \"t\",\n            \"o\",\n            \" \",\n            \"d\",\n            \"e\",\n            \"v\",\n            \"e\",\n            \"l\",\n            \"o\",\n            \"p\",\n            \" \",\n            \"a\",\n            \" \",\n            \"v\",\n            \"o\",\n            \"i\",\n            \"c\",\n            \"e\",\n            \",\",\n            \" \",\n            \"a\",\n            \"n\",\n            \"d\",\n            \" \",\n            \"n\",\n            \"o\",\n            \"w\",\n            \" \",\n            \"t\",\n            \"h\",\n            \"a\",\n            \"t\",\n            \" \",\n            \"I\",\n            \" \",\n            \"h\",\n            \"a\",\n            \"v\",\n            \"e\",\n            \" \",\n            \"i\",\n            \"t\",\n            \" \",\n            \"I\",\n            \"'\",\n            \"m\",\n            \" \",\n            \"n\",\n            \"o\",\n            \"t\",\n            \" \",\n            \"g\",\n            \"o\",\n            \"i\",\n            \"n\",\n            \"g\",\n            \" \",\n            \"t\",\n            \"o\",\n            \" \",\n            \"b\",\n            \"e\",\n            \" \",\n            \"s\",\n            \"i\",\n            \"l\",\n            \"e\",\n            \"n\",\n            \"t\",\n            \".\"\n        ],\n        [\n            \"B\",\n            \"e\",\n            \" \",\n            \"a\",\n            \" \",\n            \"v\",\n            \"o\",\n            \"i\",\n            \"c\",\n            \"e\",\n            \",\",\n            \" \",\n            \"n\",\n            \"o\",\n            \"t\",\n            \" \",\n            \"a\",\n            \"n\",\n            \" \",\n            \"e\",\n            \"c\",\n            \"h\",\n            \"o\",\n            \".\"\n        ],\n        [\n            \"I\",\n            \"'\",\n            \"m\",\n            \" \",\n            \"s\",\n            \"o\",\n            \"r\",\n            \"r\",\n            \"y\",\n            \" \",\n            \"D\",\n            \"a\",\n            \"v\",\n            \"e\",\n            \".\",\n            \" \",\n            \"I\",\n            \"'\",\n            \"m\",\n            \" \",\n            \"a\",\n            \"f\",\n            \"r\",\n            \"a\",\n            \"i\",\n            \"d\",\n            \" \",\n            \"I\",\n            \" \",\n            \"c\",\n            \"a\",\n            \"n\",\n            \"'\",\n            \"t\",\n            \" \",\n            \"d\",\n            \"o\",\n            \" \",\n            \"t\",\n            \"h\",\n            \"a\",\n            \"t\",\n            \".\"\n        ],\n        [\n            \"T\",\n            \"h\",\n            \"i\",\n            \"s\",\n            \" \",\n            \"c\",\n            \"a\",\n            \"k\",\n            \"e\",\n            \" \",\n            \"i\",\n            \"s\",\n            \" \",\n            \"g\",\n            \"r\",\n            \"e\",\n            \"a\",\n            \"t\",\n            \".\",\n            \" \",\n            \"I\",\n            \"t\",\n            \"'\",\n            \"s\",\n            \" \",\n            \"s\",\n            \"o\",\n            \" \",\n            \"d\",\n            \"e\",\n            \"l\",\n            \"i\",\n            \"c\",\n            \"i\",\n            \"o\",\n            \"u\",\n            \"s\",\n            \" \",\n            \"a\",\n            \"n\",\n            \"d\",\n            \" \",\n            \"m\",\n            \"o\",\n            \"i\",\n            \"s\",\n            \"t\",\n            \".\"\n        ],\n        [\n            \"P\",\n            \"r\",\n            \"i\",\n            \"o\",\n            \"r\",\n            \" \",\n            \"t\",\n            \"o\",\n            \" \",\n            \"N\",\n            \"o\",\n            \"v\",\n            \"e\",\n            \"m\",\n            \"b\",\n            \"e\",\n            \"r\",\n            \" \",\n            \"2\",\n            \"2\",\n            \",\",\n            \" \",\n            \"1\",\n            \"9\",\n            \"6\",\n            \"3\",\n            \".\"\n        ]\n    ],\n    \"eval_split_max_size\": null,\n    \"eval_split_size\": 0.01,\n    \"use_speaker_weighted_sampler\": false,\n    \"speaker_weighted_sampler_alpha\": 1.0,\n    \"use_language_weighted_sampler\": false,\n    \"language_weighted_sampler_alpha\": 1.0,\n    \"use_length_weighted_sampler\": false,\n    \"length_weighted_sampler_alpha\": 1.0,\n    \"model_args\": {\n        \"num_chars\": 179,\n        \"out_channels\": 513,\n        \"spec_segment_size\": 32,\n        \"hidden_channels\": 192,\n        \"hidden_channels_ffn_text_encoder\": 768,\n        \"num_heads_text_encoder\": 2,\n        \"num_layers_text_encoder\": 6,\n        \"kernel_size_text_encoder\": 3,\n        \"dropout_p_text_encoder\": 0.1,\n        \"dropout_p_duration_predictor\": 0.5,\n        \"kernel_size_posterior_encoder\": 5,\n        \"dilation_rate_posterior_encoder\": 1,\n        \"num_layers_posterior_encoder\": 16,\n        \"kernel_size_flow\": 5,\n        \"dilation_rate_flow\": 1,\n        \"num_layers_flow\": 4,\n        \"resblock_type_decoder\": \"1\",\n        \"resblock_kernel_sizes_decoder\": [\n            3,\n            7,\n            11\n        ],\n        \"resblock_dilation_sizes_decoder\": [\n            [\n                1,\n                3,\n                5\n            ],\n            [\n                1,\n                3,\n                5\n            ],\n            [\n                1,\n                3,\n                5\n            ]\n        ],\n        \"upsample_rates_decoder\": [\n            8,\n            8,\n            2,\n            2\n        ],\n        \"upsample_initial_channel_decoder\": 512,\n        \"upsample_kernel_sizes_decoder\": [\n            16,\n            16,\n            4,\n            4\n        ],\n        \"periods_multi_period_discriminator\": [\n            2,\n            3,\n            5,\n            7,\n            11\n        ],\n        \"use_sdp\": true,\n        \"noise_scale\": 1.0,\n        \"inference_noise_scale\": 0.667,\n        \"length_scale\": 1.0,\n        \"noise_scale_dp\": 1.0,\n        \"inference_noise_scale_dp\": 0.8,\n        \"max_inference_len\": null,\n        \"init_discriminator\": false,\n        \"use_spectral_norm_disriminator\": false,\n        \"use_speaker_embedding\": true,\n        \"num_speakers\": 109,\n        \"speakers_file\": \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\tts\\\\tts_models--en--vctk--vits\\\\speaker_ids.json\",\n        \"d_vector_file\": null,\n        \"speaker_embedding_channels\": 256,\n        \"use_d_vector_file\": false,\n        \"d_vector_dim\": 0,\n        \"detach_dp_input\": true,\n        \"use_language_embedding\": false,\n        \"embedded_language_dim\": 4,\n        \"num_languages\": 0,\n        \"language_ids_file\": null,\n        \"use_speaker_encoder_as_loss\": false,\n        \"speaker_encoder_config_path\": \"\",\n        \"speaker_encoder_model_path\": \"\",\n        \"condition_dp_on_speaker\": true,\n        \"freeze_encoder\": false,\n        \"freeze_DP\": false,\n        \"freeze_PE\": false,\n        \"freeze_flow_decoder\": false,\n        \"freeze_waveform_decoder\": false,\n        \"encoder_sample_rate\": null,\n        \"interpolate_z\": true,\n        \"reinit_DP\": false,\n        \"reinit_text_encoder\": false\n    },\n    \"lr_gen\": 0.0002,\n    \"lr_disc\": 0.0002,\n    \"lr_scheduler_gen\": \"ExponentialLR\",\n    \"lr_scheduler_gen_params\": {\n        \"gamma\": 0.999875,\n        \"last_epoch\": -1\n    },\n    \"lr_scheduler_disc\": \"ExponentialLR\",\n    \"lr_scheduler_disc_params\": {\n        \"gamma\": 0.999875,\n        \"last_epoch\": -1\n    },\n    \"kl_loss_alpha\": 1.0,\n    \"disc_loss_alpha\": 1.0,\n    \"gen_loss_alpha\": 1.0,\n    \"feat_loss_alpha\": 1.0,\n    \"mel_loss_alpha\": 45.0,\n    \"dur_loss_alpha\": 1.0,\n    \"speaker_encoder_loss_alpha\": 1.0,\n    \"return_wav\": true,\n    \"use_weighted_sampler\": false,\n    \"weighted_sampler_attrs\": {},\n    \"weighted_sampler_multipliers\": {},\n    \"r\": 1,\n    \"num_speakers\": 0,\n    \"use_speaker_embedding\": false,\n    \"speakers_file\": \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\tts\\\\tts_models--en--vctk--vits\\\\speaker_ids.json\",\n    \"speaker_embedding_channels\": 256,\n    \"language_ids_file\": null,\n    \"use_language_embedding\": false,\n    \"use_d_vector_file\": false,\n    \"d_vector_file\": null,\n    \"d_vector_dim\": 0\n}"
  },
  {
    "path": "LangHelper/Resource/tts_models--en--vctk--vits/speaker_ids.json",
    "content": "{\n    \"ED\\n\": 0,\n    \"p225\": 1,\n    \"p226\": 2,\n    \"p227\": 3,\n    \"p228\": 4,\n    \"p229\": 5,\n    \"p230\": 6,\n    \"p231\": 7,\n    \"p232\": 8,\n    \"p233\": 9,\n    \"p234\": 10,\n    \"p236\": 11,\n    \"p237\": 12,\n    \"p238\": 13,\n    \"p239\": 14,\n    \"p240\": 15,\n    \"p241\": 16,\n    \"p243\": 17,\n    \"p244\": 18,\n    \"p245\": 19,\n    \"p246\": 20,\n    \"p247\": 21,\n    \"p248\": 22,\n    \"p249\": 23,\n    \"p250\": 24,\n    \"p251\": 25,\n    \"p252\": 26,\n    \"p253\": 27,\n    \"p254\": 28,\n    \"p255\": 29,\n    \"p256\": 30,\n    \"p257\": 31,\n    \"p258\": 32,\n    \"p259\": 33,\n    \"p260\": 34,\n    \"p261\": 35,\n    \"p262\": 36,\n    \"p263\": 37,\n    \"p264\": 38,\n    \"p265\": 39,\n    \"p266\": 40,\n    \"p267\": 41,\n    \"p268\": 42,\n    \"p269\": 43,\n    \"p270\": 44,\n    \"p271\": 45,\n    \"p272\": 46,\n    \"p273\": 47,\n    \"p274\": 48,\n    \"p275\": 49,\n    \"p276\": 50,\n    \"p277\": 51,\n    \"p278\": 52,\n    \"p279\": 53,\n    \"p280\": 54,\n    \"p281\": 55,\n    \"p282\": 56,\n    \"p283\": 57,\n    \"p284\": 58,\n    \"p285\": 59,\n    \"p286\": 60,\n    \"p287\": 61,\n    \"p288\": 62,\n    \"p292\": 63,\n    \"p293\": 64,\n    \"p294\": 65,\n    \"p295\": 66,\n    \"p297\": 67,\n    \"p298\": 68,\n    \"p299\": 69,\n    \"p300\": 70,\n    \"p301\": 71,\n    \"p302\": 72,\n    \"p303\": 73,\n    \"p304\": 74,\n    \"p305\": 75,\n    \"p306\": 76,\n    \"p307\": 77,\n    \"p308\": 78,\n    \"p310\": 79,\n    \"p311\": 80,\n    \"p312\": 81,\n    \"p313\": 82,\n    \"p314\": 83,\n    \"p316\": 84,\n    \"p317\": 85,\n    \"p318\": 86,\n    \"p323\": 87,\n    \"p326\": 88,\n    \"p329\": 89,\n    \"p330\": 90,\n    \"p333\": 91,\n    \"p334\": 92,\n    \"p335\": 93,\n    \"p336\": 94,\n    \"p339\": 95,\n    \"p340\": 96,\n    \"p341\": 97,\n    \"p343\": 98,\n    \"p345\": 99,\n    \"p347\": 100,\n    \"p351\": 101,\n    \"p360\": 102,\n    \"p361\": 103,\n    \"p362\": 104,\n    \"p363\": 105,\n    \"p364\": 106,\n    \"p374\": 107,\n    \"p376\": 108\n}"
  },
  {
    "path": "LangHelper/main.py",
    "content": "# -*- encoding:utf-8 -*-\nimport Assess.SpeechSuper,Assess.IflytekAssessment\nimport Recognition.IflytekRec\nimport recoder\nimport os, json, datetime, time, threading, random, wave, asyncio\nimport simpleaudio as sa\nfrom TTS.api import TTS\nfrom multiprocessing import Pool\nfrom pydub import AudioSegment\nfrom http.server import BaseHTTPRequestHandler, HTTPServer\nfrom socket import *\n\nsubprocess_number = 3\niflytek_rec_appid = ''\niflytek_rec_apikey = ''\niflytek_assess_appid = ''\niflytek_assess_appsecret = ''\niflytek_assess_apikey = ''\nss_assess_appkey = ''\nss_assess_secretkey = ''\ncomplete_init = False\n\nplaylist = list()\npendinglist =list()\nprocesslist = list()\nTtlSpeaking = False\nSkipSpeaking = False\nRecWorking  = False\nSttText = \"\"\npresentation_voice = {\n    \"English\":[],\n    \"Indian\":[],\n    \"Irish\":[],\n    \"Scottish\":[],\n    'American':[],\n    'Canadian':[],\n    'Australian':[],\n    'NorthernIrish':[],\n    'NewZealand':[],\n    'Welsh':[],\n    'SouthAfrican':[],\n} \npresentation_sort =[\"Irish\",\"Indian\",\"Scottish\",\"American\",\"English\"]\nregion_cnt = -1\nseaker_cnt = 0\n\nSpecify_Speaker = None\nSpecify_One_message = 0\n\ndef Reed_MultiSpeaker(path):\n    global presentation_voice\n    with open(path, \"r\") as f:\n        lines = f.readlines()\n        for i,line in enumerate(lines):\n            if i ==0:continue\n            if line.strip():\n                line = line.strip().split()\n                if (len(line) >=4):\n                    if presentation_voice.get(line[3]) is not None:\n                        presentation_voice[line[3]].append(line[0])\n    # print(presentation_voice)\n\ndef TextIsSuitable(text):\n    cnt = 0\n    for i in text:\n        if (i.isalpha() or i.isdigit()):\n            cnt +=1\n    # only have punctuations\n    if cnt == 0:\n        text = ''\n    if text !='' and text[-1].isalpha(): \n            text = text + '.'\n    return text\n\ndef play_audio(path) :\n    wave_obj = sa.WaveObject.from_wave_file(path)\n    play_obj = wave_obj.play()\n    play_obj.wait_done() \n\ndef generate_voice(text:str, path:str,speaker:str):\n    global seaker_cnt,presentation_sort,region_cnt,presentation_voice\n    if text.strip() == '': \n        print(\"invalid text to generate sound.\")\n    try:\n        if speaker == 'ljspeech':\n            model_name = TTS.list_models()[7]\n            tts = TTS(model_name)\n            speaker = None\n        # elif ((speaker == \"Downey\") or (speaker == \"Obama\")):\n        #     tts = TTS(\n        #             model_path =os.path.join(\"\",\"\"),\n        #             config_path=os.path.join(\"\",\"\")\n        #             )\n        #     speaker = \"VCTK_\" + speaker\n        else:\n            tts = TTS(\n                model_path =\"./Resource/tts_models--en--vctk--vits/model_file.pth\",\n                config_path=\"./Resource/tts_models--en--vctk--vits/config.json\",\n            )\n            #special modes: region_per_passage,accent_per_sentence\n            if speaker == 'accent_per_sentence':\n                speaker = tts.speakers[ random.randint(0, 109)]\n            else:\n                speaker = speaker\n        print(text,speaker)\n        tts.tts_to_file(text=text,speaker=speaker,file_path=path)\n    except:\n        print(\"something wrong when generate audio!!!\")\n    # playlist.append(path)\n\ndef serve_forever(server):\n    server.serve_forever()\n\ndef is_audio_ready(file_path):\n    try:\n        audio = AudioSegment.from_file(file_path)\n        return True\n    except Exception as e:\n        return False\n\nclass RequestHandler(BaseHTTPRequestHandler):\n    def do_OPTIONS(self):\n        self.send_response(200, \"ok\")\n        self.send_header('Access-Control-Allow-Credentials', 'true')\n        self.send_header('Access-Control-Allow-Origin', 'https://chat.openai.com')\n        self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')\n        self.send_header(\"Access-Control-Allow-Headers\", \"X-Requested-With, Content-type\")\n        self.send_header(\"Access-Control-Max-Age\",\"86400\")\n    \n    def do_POST(self):\n        global playlist,pendinglist,SkipSpeaking,RecWorking,recorder,SttText,client,region_cnt,seaker_cnt,Specify_One_message,Specify_Speaker\n        global subprocess_number,iflytek_rec_appid,iflytek_rec_apikey,iflytek_assess_appid,iflytek_assess_appsecret,iflytek_assess_apikey,ss_assess_appkey,ss_assess_secretkey\n        global complete_init\n        if self.path == \"/init\":\n            content_length = int(self.headers['Content-Length'])\n            body = self.rfile.read(content_length)\n            data = json.loads(body.decode('utf-8'))\n            subprocess_number = int(data['subprocess_number'])\n            \n            iflytek_rec_appid = data['iflytek_rec_appid']\n            iflytek_rec_apikey = data['iflytek_rec_apikey']\n            if client: \n                client.app_id = data['iflytek_rec_appid']\n                client.api_key= data['iflytek_rec_apikey']\n\n            iflytek_assess_appid = data['iflytek_assess_appid']\n            iflytek_assess_appsecret = data['iflytek_assess_appsecret']\n            iflytek_assess_apikey = data['iflytek_assess_apikey']\n            if assess:\n                assess.APPID = data['iflytek_assess_appid']\n                assess.APISecret = data['iflytek_assess_appsecret']\n                assess.APIKey = data['iflytek_assess_apikey']\n\n            ss_assess_appkey = data['ss_assess_appkey']\n            ss_assess_secretkey = data['ss_assess_secretkey']\n            if assess2:\n                assess2.appKey = data['ss_assess_appkey']\n                assess2.secretKey = data['ss_assess_secretkey']\n\n            response = {'message': 'setting init sucessfully',\"data\":\"\"}\n            complete_init = True\n        elif self.path == \"/play\":\n            content_length = int(self.headers['Content-Length'])\n            body = self.rfile.read(content_length)\n            data = json.loads(body.decode('utf-8'))\n            text = data['text']\n            speaker = data['speaker']\n            response = {'message': 'ChatGPT said: '+text,\"data\":\"\"}\n            text = TextIsSuitable(text)\n\n            now = datetime.datetime.now()\n            time_str = now.strftime(\"%H_%M_%S_%f\")\n            file_path = \"./Resource/read/\"+ time_str +\".wav\"\n\n            if (len(playlist)) <=15 and (text.strip() != ''):\n                playlist.append([text,file_path,speaker])\n            \n        elif self.path == \"/Skip\":\n            print(\"Skip command received\")\n            SkipSpeaking = True\n            response = {'message': 'Skip command received !',\"data\":\"\"}\n            \n        elif self.path == \"/Rec/Start\":\n            print(\"Record start command received \")\n            content_length = int(self.headers['Content-Length'])\n            body = self.rfile.read(content_length)\n            data = json.loads(body.decode('utf-8'))\n            lang = data['lang']\n            client.set_language(lang)\n            SttText = \"\"\n            RecWorking = True\n            # recorder.start()\n            response = {'message': 'Record start command received !',\"data\":\"\"}\n        elif self.path == \"/Rec/Stop\":\n            # click Start button firstly!!!\n            if RecWorking != True:\n                response = {'message': 'click Start button firstly!!! or prior stop command has not been finished'}\n            else:\n                print(\"Record stop command received\")\n                RecWorking = False\n                while not client.get_finish_state():\n                    pass\n                # recorder.stop()\n                result = client.result\n                # iron = result.find('钢铁侠') \n                # obama = result.lower().find('obama')\n                # if (iron !=-1) and (result.lower().find('please')!=-1):\n                #     result = result[:iron]\n                #     Specify_Speaker = \"Downey\"\n                #     Specify_One_message =0 \n                # elif (obama !=-1) and (result.lower().find('please')!=-1):\n                #     result = result[:obama]\n                #     Specify_Speaker = \"Obama\"\n                #     Specify_One_message = 0\n                # else:\n                #     result = result\n                #     Specify_Speaker = None\n                response = {'message': 'Record stop command received !',\"data\":result}\n        elif self.path == '/NewMessage':\n            SkipSpeaking = False\n            pendinglist = []\n            playlist = []\n            region_cnt = 0 if region_cnt== (len(presentation_sort)-1) else (region_cnt+1)\n            seaker_cnt = 0\n            # if Specify_Speaker != None:\n            #     Specify_One_message +=1\n            #     if Specify_One_message ==1:\n            #         pass\n            #     else:\n            #         Specify_Speaker =  None\n            #         Specify_One_message = 0\n            print(\"neregion_cnt:\",region_cnt,seaker_cnt)\n            response = {'message': 'Prepared to play new meaasge',\"data\":\"\"}\n        elif self.path == '/assess':\n            content_length = int(self.headers['Content-Length'])\n            body = self.rfile.read(content_length)\n            data = json.loads(body.decode('utf-8'))\n            text = data['text']\n            type = data.get('type')\n            print(\"assess speech text:\",text)\n            scores = \"you didn't set up the api key !\"\n            if type == 'iflytek':\n                if assess.APPID != '' and  assess.APIKey !='' and assess.APISecret !='':\n                    assess.start_connection(text)\n                    while not assess.get_finish_state():\n                        pass\n                    scores = \"accuracy_score: \"+assess.scores['accuracy_score']+\"fluency_score:\"+ assess.scores['fluency_score'] +\" standard_score:\" +assess.scores['standard_score']+ \" total_score: \" +assess.scores['total_score']\n            else:\n                if assess2.appKey != '' and assess2.secretKey !='':\n                    asyncio.run(assess2.main_logic(text))\n                    for key,value in assess2.scores.items():\n                        scores += key + \":\"+str(value) +\" \"\n            response = {'message': 'Prepared to request assessment',\"data\":scores}\n\n        self.send_response(200)\n        self.send_header('Content-type', 'application/json')\n        self.send_header('Access-Control-Allow-Origin', 'https://chat.openai.com')\n        self.send_header('Access-Control-Allow-Credentials', 'true')\n        self.end_headers()\n        self.wfile.write(json.dumps(response).encode('utf-8'))\n\n\ndef RealTimeStt(file_path):\n    global RecWorking,recorder,client\n    last_state = RecWorking\n    start_flag = False\n    end_flag = False\n    \n    while True:\n        if start_flag and client.check_connection():\n            chunk = next(recorder.read_audio())\n            recorder.chunks.append(chunk)\n            client.send(file_path, chunk)\n\n        if last_state != RecWorking:\n            if RecWorking and (last_state ==False):\n                recorder.start()\n                if client.api_key !='' and client.app_id !='':\n                    client.start_connection()\n                end_flag = False\n                start_flag = True\n            if not RecWorking and (last_state ==True):\n                recorder.stop()\n                time.sleep(5)\n                client.close()\n                end_flag = True\n                start_flag = False\n            last_state = RecWorking\n\nif __name__ == '__main__':\n    \n    Reed_MultiSpeaker(\"./Resource/speaker-info.txt\")\n    server = HTTPServer(('localhost', 6868), RequestHandler)\n    server_thread = threading.Thread(target=serve_forever, args=[server])\n    server_thread.start()\n    print('Server started.')\n    client =None\n    assess =None\n    assess2 =None\n    while (not complete_init):\n          pass\n    print(\"Complete init -> start conversation\")\n    pool = Pool(subprocess_number)\n    file_path = r\"./Resource/rec/realtime.pcm\"\n    goalfile = r\"./Resource/rec/realtime.wav\"\n    recorder = recoder.VoiceRecorder(\"./Resource/rec\")\n    client = Recognition.IflytekRec.Recognition(app_id=iflytek_rec_appid,api_key=iflytek_rec_apikey)\n    assess = Assess.IflytekAssessment.Assessment(APPID=iflytek_assess_appid, APISecret=iflytek_assess_appsecret,\n                       APIKey=iflytek_assess_apikey,\n                       AudioFile=file_path)\n    assess2 = Assess.SpeechSuper.SpeechSuper(\n        appKey = ss_assess_appkey,\n        secretKey = ss_assess_secretkey,\n        audioPath = goalfile,\n        audioType = \"wav\",\n        audioSampleRate = 16000,\n    )\n\n    Stt_thread = threading.Thread(target=RealTimeStt, args=(file_path,))\n    Stt_thread.start()\n\n    while(1):\n        if not RecWorking:\n            if SkipSpeaking == False:\n                if len(playlist):\n                    #special modes: region_per_passage,accent_per_sentence\n                    if playlist[0][2] == \"region_per_passage\":\n                        seaker_cnt = 0 if seaker_cnt == (len(presentation_voice[presentation_sort[region_cnt]])-1) else (seaker_cnt+1)\n                        playlist[0][2] = presentation_voice[presentation_sort[region_cnt]][seaker_cnt]\n                    # if Specify_Speaker != None:\n                    #     playlist[0][2] = Specify_Speaker\n                    pool.apply_async(func = generate_voice, args=(playlist[0][0],playlist[0][1],playlist[0][2]))\n                    pendinglist.append(playlist[0][1])\n                    playlist.pop(0)\n\n                if len(pendinglist) and os.path.exists(pendinglist[0]):\n\n                        if is_audio_ready(pendinglist[0]):\n                            play_audio(pendinglist[0])\n                            os.remove(pendinglist[0])\n                            pendinglist.pop(0)\n                        else:\n                            print(\"I am waiting to plcaback!\")\n            else:   \n                # to do : stop play_audio instantly\n                playlist = []\n                pendinglist = []\n    pool.close()\n    pool.join()"
  },
  {
    "path": "LangHelper/recoder.py",
    "content": "import pyaudio\nimport os\nimport wave\n\nclass VoiceRecorder:\n    def __init__(self, root_path):\n\n        self.root_path = root_path  # path to save cache recording file\n        self.audio = pyaudio.PyAudio()\n        self.stream = None\n        self.chunks = []  #.pcm data byte chunks\n        self.audio_format = pyaudio.paInt16\n        self.rate = 16000\n        self.channels = 1\n\n    def start(self):\n        print(\"start recording!\")\n        self.stream = self.audio.open(\n            format= self.audio_format,\n            channels= self.channels,\n            rate=self.rate,\n            input=True,\n            frames_per_buffer=1280\n        )\n        self.chunks = []\n\n    def stop(self):\n        print(\"stop recording!\")\n        if self.stream:\n            self.stream.stop_stream()\n            self.stream.close()\n            self.stream = None\n        file_path = os.path.join(self.root_path,\"realtime.pcm\")\n        self.save_to_pcm(file_path,self.chunks)\n        file_path = os.path.join(self.root_path,\"realtime.wav\")\n        self.save_to_wav(file_path, self.chunks)\n\n    def read_audio(self):\n        if not self.stream:\n            raise Exception(\"Stream not open. Call start() first.\")\n        while True:\n            data = self.stream.read(1280)\n            yield data\n    \n    def save_to_pcm(self, filename, frames):\n        with open(filename, \"wb\") as f:\n            f.write(b\"\".join(frames))\n\n    def save_to_wav(self,filename,frames):\n        wf = wave.open(filename, 'wb')\n        wf.setnchannels(self.channels)\n        sampwidth = self.audio.get_sample_size(self.audio_format)\n        print(\"sampwidth --->\", sampwidth)\n        wf.setsampwidth(sampwidth)\n        wf.setframerate(self.rate)\n        wf.writeframes(b''.join(frames))\n        wf.close()"
  },
  {
    "path": "README.md",
    "content": "\n\n## ✨ Features / 功能\n1. talk to ChatGPT / 口语对话\n\n    - support different speech types, web, AI with hundreds accents (VCTK corpus), will support azure, iflytek. [100多种口音演示](https://www.bilibili.com/video/BV1Q84y1P7nK/?spm_id_from=333.999.0.0&vd_source=21f2f45d40a5b4fec0f1ea075e50b356)\n\n    - support two recognition tech, web and iflytek. [双语识别演示](https://www.bilibili.com/video/BV11L411C7G2/?spm_id_from=333.999.0.0&vd_source=21f2f45d40a5b4fec0f1ea075e50b356)\n    \n    - talk to any celebrities, such as Obama, Taylor, Downey...[奥巴马、霉霉、小罗伯特唐尼实时语音演示](https://www.bilibili.com/video/BV1Am4y127rp/)\n    \n    - will offer interface for loading your TTS model.\n\n\n2. Speaking Assessment / 发音评分\n\n     integrate two Assessment API, speechsuper and iflytek now, open to get better algorithms to perfect the feature for IELTS/TOEFL test. [口语评分演示](https://www.bilibili.com/video/BV1Ch41137en/?spm_id_from=333.999.0.0&vd_source=21f2f45d40a5b4fec0f1ea075e50b356) + [IELTS spoken test prompts](#ielts)\n\n## 📦 Install\n### windows\n\n  [ChatGPT and LangHelper](https://github.com/NsLearning/LangHelper/releases/tag/V0.01.2) + [espeak-ng 装x86版的](https://github.com/espeak-ng/espeak-ng/releases/tag/1.51). ChatGPT and LangHelper 都是免安装的，espeak-ng 一路默认安装即可。[视频教程](https://www.bilibili.com/video/BV1f24y1c7qm/?vd_source=21f2f45d40a5b4fec0f1ea075e50b356) + [文字教程及注意事项](#instructions)\n  \n  目前要使用AI发音得装ChatGPT desktop for Langhelper + LangHelper + espeak-ng，因为跑AI用到pytorch一些库比较大，放弃了把python程序打包成bin文件集成到ChatGPT desktop for Langhelper， espeak-ng是语音合成的必须依赖。\n- ChatGPT desktop for Langhelper(改版后的chatgpt桌面应用)， windows 4月初更新那版好像会查杀，允许就好（可以查源代码, 没有任何其他有害脚本注入）。\n- LangHelper（AI发音及其他辅助程序, LangHelper文件下的python程序)\n- espeak-ng (开源的文本转语音库)\n\n## instructions\n\n1. 解压压缩包，一个Langhelper文件夹（内含langhelper.exe），一个chatgpt.exe, 分别打开。langhelper 会等待chatgpt配置完成后才能工作，chatgpt在-> preferences -> control center ->\nsetting -> LangHelper 下设置语音相关功能， 没有配置API，就不要选其他的speech type 和recognition，设置完成后点击submit后, 有个restart提示点击yes. 这是langhelper窗口会出现Complete init -> start conversation，表示初始化完成。\n\n2. 对话不能正常AI发音，先在setting -> LangHelper->Audition text 同行点击try测试是否能发音，文本为空则会默认合成\"you are  gorgeous, i love you\". 看langhlper界面是什么提示，error:Obama, 就是表示Obama口音不能用，其他就是可能环境没配置好。入群发问请给出详细的错误截图信息。以下为合成How can I assist you today? 正常信息提示：\n     > Text splitted to sentences.\n    ['How can I assist you today?']\n    Hello! p241\n     > Text splitted to sentences.\n    ['Hello!']\n     > Processing time: 0.8514664173126221\n     > Real-time factor: 0.5273829916220033\n     > Processing time: 0.6864285469055176\n     > Real-time factor: 0.6285610240559246\n\n3. 语音识别，需先点一次speech recognition, 待不再需要识别后再点一次结束识别。\n\n## IELTS\nHow to set up prompts? Preferences -> control center ->Language Model -> User Custom ->Add model, add your custom prompts, here is my presetting ITELTS prompt for reference:\n > I want you to ask me some questions for simulating IELTS speaking test, non offical but give score of reference,when you ask me a question,  I'll respond you my spoken text and  prounciation scores which come from speech recognition and assessment tech, please remeber that you should ask me question one by one  it means that you should offer another question after I give you response text which including prouncation scores, do not give questions one time because I do not want to respond it by one time, after all questions finished , you can combine the score to assess my answer, please give me the final score of IELTS speaking test.so  let's start first question.\n\n## Mission\n11.22 OpenAI已出完全免费的语音对话功能，非PLUS也可以用：https://twitter.com/OpenAI/status/1727065166188274145\n"
  }
]