diff options
Diffstat (limited to 'ShowOrderDetails.html')
-rw-r--r-- | ShowOrderDetails.html | 1634 |
1 files changed, 1524 insertions, 110 deletions
diff --git a/ShowOrderDetails.html b/ShowOrderDetails.html index f80e866..3f886f1 100644 --- a/ShowOrderDetails.html +++ b/ShowOrderDetails.html @@ -2,72 +2,13 @@ <!doctype html> <html> <head> - <meta charSet="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><noscript><meta http-equiv="refresh" content="1" /></noscript><title>Status of your order for {{ order_summary }}</title> + <meta charSet="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><noscript><meta http-equiv="refresh" content="1" /></noscript><title>Status of your order for {{ order_summary }}</title><script> + var contractTermsStr = '{{{contract_terms_json}}}'; + </script> <style>/*! Pure v2.0.3 Copyright 2013 Yahoo! Licensed under the BSD License. - https://github.com/pure-ss/pure/blob/master/LICENSE.md -*/ -/*! - normalize.cs v | MIT License | git.io/normalize - Copyright (c) Nicolas Gallagher and Jonathan Neal -*/ -/*! normalize.ss v8.0.1 | MIT License | github.com/necolas/normalize.cs */ - -.talerbar { - text-align: center; -} -.tt { - font-family: "Lucida Console", Monaco, monospace; -} -.content { - overflow-x: auto; - padding-left: 15%; - padding-right: 15%; -} -.qr { - margin: auto; - text-align: center; -} -.qrtext { - width: max-content; - margin: auto; - transition: font-size 0.2s; - font-family: "Lucida Console", Monaco, monospace; - font-size: 0.5em; -} -.qrtext:hover { - font-size: 1em; -} -.talerbar { - margin: 0; - bottom: 0; - background-color: #033; - color: white; - width: 100%; - padding: 1em; - overflow: auto; -} -body { - overflow-y: scroll; -} -@media (min-width: 500px) { - .content { - padding-bottom: 2em; - margin-right: 1em; - overflow-y: auto; - } -} -#main a:link, -#main a:visited, -#main a:hover, -#main a:active { - color: black; -}/*! - Pure v2.0.3 - Copyright 2013 Yahoo! - Licensed under the BSD License. https://github.com/pure-cs s/pure/blob/master/LICENSE.md */ /*! @@ -1037,12 +978,80 @@ a.pure-button-selected { .pure-table-horizontal tbody > tr:last-child > td { border-bottom-width: 0; } -</style> +/*! + Pure v2.0.3 + Copyright 2013 Yahoo! + Licensed under the BSD License. + https://github.com/pure-ss/pure/blob/master/LICENSE.md +*/ +/*! + normalize.cs v | MIT License | git.io/normalize + Copyright (c) Nicolas Gallagher and Jonathan Neal +*/ +/*! normalize.ss v8.0.1 | MIT License | github.com/necolas/normalize.cs */ + +.talerbar { + text-align: center; +} +.tt { + font-family: "Lucida Console", Monaco, monospace; +} +.content { + overflow-x: auto; + padding-left: 15%; + padding-right: 15%; +} +.qr { + margin: auto; + text-align: center; +} +.qrtext { + width: max-content; + margin: auto; + transition: font-size 0.2s; + font-family: "Lucida Console", Monaco, monospace; + font-size: 0.5em; +} +.qrtext:hover { + font-size: 1em; +} +.talerbar { + margin: 0; + bottom: 0; + background-color: #033; + color: white; + width: 100%; + padding: 1em; + overflow: auto; +} +body { + overflow-y: scroll; +} +@media (min-width: 500px) { + .content { + padding-bottom: 2em; + overflow-y: auto; + } +} +#main a:link, +#main a:visited, +#main a:hover, +#main a:active { + color: black; +}.q1ma0zxq{margin:auto;text-align:center;width:340px;} +.fef0x5t{text-align:center;background-color:#033;color:white;padding:1em;overflow:auto;}.fef0x5t > p > a:link,.fef0x5t > p > a:visited,.fef0x5t > p > a:hover,.fef0x5t > p > a:active{color:white;} +.p1b3vqup{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;min-height:100vh;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.p1b3vqup a:link,.p1b3vqup a:visited,.p1b3vqup a:hover,.p1b3vqup a:active{color:black;}.p1b3vqup section{text-align:center;width:600px;margin-bottom:auto;}.p1b3vqup section:not(:first-of-type){margin-top:2em;}.p1b3vqup > header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;text-align:center;}.p1b3vqup > footer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:space-around;-webkit-justify-content:space-around;-ms-flex-pack:space-around;justify-content:space-around;width:100%;margin-bottom:0px;} +.c1gnd3xp{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;} +.wpwjmk{display:inline-block;zoom:1;line-height:normal;white-space:nowrap;vertical-align:middle;text-align:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box;text-transform:var(--wpwjmk-0);font-family:inherit;font-size:100%;padding:0.5em 1em;color:#444;color:rgba(0,0,0,0.8);border:1px solid #999;border:none rgba(0,0,0,0);background-color:'#e6e6e6';-webkit-text-decoration:none;text-decoration:none;border-radius:2px;background-color:#e6e6e6;border-radius:4px;text-shadow:0 1px 1px rgba(0,0,0,0.2);box-shadow:0 0 0 1px rgba(0,0,0,0.15) inset, 0 0 6px rgba(0,0,0,0.2) inset;border-color:#000;}.wpwjmk:focus{outline:0;}.wpwjmk:disabled{border:none;background-image:none;-webkit-filter:alpha(opacity=40);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none;pointer-events:none;}.wpwjmk:hover{-webkit-filter:alpha(opacity=90);filter:alpha(opacity=90);background-image:linear-gradient( transparent, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.1) );} +.i1pkgksb{border-radius:0.25em;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:1em;border:solid 1px #b8daff;background-color:#cce5ff;color:#004085;} +.t2c81u8{text-align:left;}.t2c81u8 dt{font-weight:bold;margin-top:1em;}.t2c81u8 dd{margin-inline-start:0px;} +.t1mav7fx{text-align:left;}.t1mav7fx dt{font-weight:bold;display:inline-block;width:30%;}.t1mav7fx dd{margin-inline-start:0px;display:inline-block;width:70%;} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3NlYmFzam0vV29yay90YWxlci9tZXJjaGFudC1iYWNrb2ZmaWNlL3BhY2thZ2VzL2JhY2tlbmQvc3JjL3N0eWxlZC9pbmRleC50c3giXSwibmFtZXMiOlsiLnExbWEwenhxIiwiLmZlZjB4NXQiLCIucDFiM3ZxdXAiLCIuYzFnbmQzeHAiLCIud3B3am1rIiwiLmkxcGtna3NiIiwiLnQyYzgxdTgiLCIudDFtYXY3ZngiXSwibWFwcGluZ3MiOiJBQW9CYUE7QUFLQUM7QUFjQUM7QUF1Q0FDO0FBSUFDO0FBdURBQztBQVVBQztBQVVBQyIsImZpbGUiOiIvaG9tZS9zZWJhc2ptL1dvcmsvdGFsZXIvbWVyY2hhbnQtYmFja29mZmljZS9wYWNrYWdlcy9iYWNrZW5kL3NyYy9zdHlsZWQvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLypcbiBUaGlzIGZpbGUgaXMgcGFydCBvZiBHTlUgVGFsZXJcbiAoQykgMjAyMSBUYWxlciBTeXN0ZW1zIFMuQS5cblxuIEdOVSBUYWxlciBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5IGl0IHVuZGVyIHRoZVxuIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmVcbiBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAzLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLlxuXG4gR05VIFRhbGVyIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsIGJ1dCBXSVRIT1VUIEFOWVxuIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SXG4gQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuXG5cbiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhbG9uZyB3aXRoXG4gR05VIFRhbGVyOyBzZWUgdGhlIGZpbGUgQ09QWUlORy4gIElmIG5vdCwgc2VlIDxodHRwOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPlxuICovXG4vKipcbipcbiogQGF1dGhvciBTZWJhc3RpYW4gSmF2aWVyIE1hcmNoYW5vIChzZWJhc2ptKVxuKi9cbmltcG9ydCB7IHN0eWxlZCB9IGZyb20gJ0BsaW5hcmlhL3JlYWN0JztcbmV4cG9ydCBjb25zdCBRUlBsYWNlaG9sZGVyID0gc3R5bGVkLmRpdiBgXG4gIG1hcmdpbjogYXV0bztcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICB3aWR0aDogMzQwcHg7IFxuYDtcbmV4cG9ydCBjb25zdCBGb290ZXJCYXIgPSBzdHlsZWQuZm9vdGVyIGBcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjMDMzO1xuICBjb2xvcjogd2hpdGU7XG4gIHBhZGRpbmc6IDFlbTtcbiAgb3ZlcmZsb3c6IGF1dG87XG5cbiAgJiA+IHAgPiBhOmxpbmssXG4gICYgPiBwID4gYTp2aXNpdGVkLFxuICAmID4gcCA+IGE6aG92ZXIsXG4gICYgPiBwID4gYTphY3RpdmUge1xuICAgIGNvbG9yOiB3aGl0ZTtcbiAgfVxuYDtcbmV4cG9ydCBjb25zdCBQYWdlID0gc3R5bGVkLmRpdiBgXG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgbWluLWhlaWdodDogMTAwdmg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIFxuICBhOmxpbmssXG4gIGE6dmlzaXRlZCxcbiAgYTpob3ZlcixcbiAgYTphY3RpdmUge1xuICAgIGNvbG9yOiBibGFjaztcbiAgfVxuICBcbiAgc2VjdGlvbiB7XG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgIHdpZHRoOiA2MDBweDtcbiAgICAvKiBtYXJnaW46IGF1dG87ICovXG4gICAgLyogbWFyZ2luLXRvcDogMHB4OyAqL1xuICAgIG1hcmdpbi1ib3R0b206IGF1dG87XG4gICAgLyogb3ZlcmZsb3c6IGF1dG87ICovXG4gIH1cbiAgc2VjdGlvbjpub3QoOmZpcnN0LW9mLXR5cGUpIHtcbiAgICBtYXJnaW4tdG9wOiAyZW07XG4gIH1cbiAgJiA+IGhlYWRlciB7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICBmbGV4LWRpcmVjdGlvbjogcm93O1xuICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIH1cbiAgJiA+IGZvb3RlciB7XG4gICAgZGlzcGxheTogZmxleDsgICAgXG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWFyb3VuZDtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBtYXJnaW4tYm90dG9tOiAwcHg7XG4gIH1cbmA7XG5leHBvcnQgY29uc3QgQ2VudGVyID0gc3R5bGVkLmRpdiBgXG4gIGRpc3BsYXk6IGZsZXg7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuYDtcbmV4cG9ydCBjb25zdCBXYWxsZXRMaW5rID0gc3R5bGVkLmEgYFxuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIHpvb206IDE7XG4gIGxpbmUtaGVpZ2h0OiBub3JtYWw7XG4gIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgY3Vyc29yOiBwb2ludGVyO1xuICB1c2VyLXNlbGVjdDogbm9uZTtcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgdGV4dC10cmFuc2Zvcm06ICR7KHsgdXBwZXJDYXNlZCB9KSA9PiB1cHBlckNhc2VkID8gJ3VwcGVyY2FzZScgOiAnbm9uZSd9O1xuXG4gIGZvbnQtZmFtaWx5OiBpbmhlcml0O1xuICBmb250LXNpemU6IDEwMCU7XG4gIHBhZGRpbmc6IDAuNWVtIDFlbTtcbiAgY29sb3I6ICM0NDQ7IC8qIHJnYmEgbm90IHN1cHBvcnRlZCAoSUUgOCkgKi9cbiAgY29sb3I6IHJnYmEoMCwgMCwgMCwgMC44KTsgLyogcmdiYSBzdXBwb3J0ZWQgKi9cbiAgYm9yZGVyOiAxcHggc29saWQgIzk5OTsgLypJRSA2LzcvOCovXG4gIGJvcmRlcjogbm9uZSByZ2JhKDAsIDAsIDAsIDApOyAvKklFOSArIGV2ZXJ5dGhpbmcgZWxzZSovXG4gIGJhY2tncm91bmQtY29sb3I6ICcjZTZlNmU2JztcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICBib3JkZXItcmFkaXVzOiAycHg7XG5cbiAgOmZvY3VzIHtcbiAgICBvdXRsaW5lOiAwO1xuICB9XG5cbiAgJjpkaXNhYmxlZCB7XG4gICAgYm9yZGVyOiBub25lO1xuICAgIGJhY2tncm91bmQtaW1hZ2U6IG5vbmU7XG4gICAgLyogY3NzbGludCBpZ25vcmU6c3RhcnQgKi9cbiAgICBmaWx0ZXI6IGFscGhhKG9wYWNpdHk9NDApO1xuICAgIC8qIGNzc2xpbnQgaWdub3JlOmVuZCAqL1xuICAgIG9wYWNpdHk6IDAuNDtcbiAgICBjdXJzb3I6IG5vdC1hbGxvd2VkO1xuICAgIGJveC1zaGFkb3c6IG5vbmU7XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gIH1cblxuICA6aG92ZXIge1xuICAgIGZpbHRlcjogYWxwaGEob3BhY2l0eT05MCk7XG4gICAgYmFja2dyb3VuZC1pbWFnZTogbGluZWFyLWdyYWRpZW50KFxuICAgICAgdHJhbnNwYXJlbnQsXG4gICAgICByZ2JhKDAsIDAsIDAsIDAuMDUpIDQwJSxcbiAgICAgIHJnYmEoMCwgMCwgMCwgMC4xKVxuICAgICk7XG4gIH1cblxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZTZlNmU2O1xuICBib3JkZXItcmFkaXVzOiA0cHg7XG4gIHRleHQtc2hhZG93OiAwIDFweCAxcHggcmdiYSgwLCAwLCAwLCAwLjIpO1xuICBib3gtc2hhZG93OiAwIDAgMCAxcHggcmdiYSgwLCAwLCAwLCAwLjE1KSBpbnNldCxcbiAgICAwIDAgNnB4IHJnYmEoMCwgMCwgMCwgMC4yKSBpbnNldDtcbiAgYm9yZGVyLWNvbG9yOiAjMDAwO1xuYDtcbmV4cG9ydCBjb25zdCBJbmZvQm94ID0gc3R5bGVkLmRpdiBgXG4gIGJvcmRlci1yYWRpdXM6IDAuMjVlbTtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgLyogbWFyZ2luOiAwLjVlbTsgKi9cbiAgcGFkZGluZzogMWVtO1xuICAvKiB3aWR0aDogMTAwJTsgKi9cbiAgYm9yZGVyOnNvbGlkIDFweCAjYjhkYWZmO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiNjY2U1ZmY7XG4gIGNvbG9yOiMwMDQwODU7XG5gO1xuZXhwb3J0IGNvbnN0IFRhYmxlRXhwYW5kZWQgPSBzdHlsZWQuZGwgYFxuICB0ZXh0LWFsaWduOiBsZWZ0O1xuICBkdCB7XG4gICAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gICAgbWFyZ2luLXRvcDogMWVtO1xuICB9XG4gIGRkIHtcbiAgICBtYXJnaW4taW5saW5lLXN0YXJ0OiAwcHg7XG4gIH1cbmA7XG5leHBvcnQgY29uc3QgVGFibGVTaW1wbGUgPSBzdHlsZWQuZGwgYFxuICB0ZXh0LWFsaWduOiBsZWZ0O1xuICBkdCB7XG4gICAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgIHdpZHRoOjMwJTtcbiAgfVxuICBkZCB7XG4gICAgbWFyZ2luLWlubGluZS1zdGFydDogMHB4O1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICB3aWR0aDo3MCU7XG4gIH1cbmA7XG4iXX0=*/</style> </head> <script id="built_time_data"> </script> <body> - <h1>Order details</h1><div>This is the default status page for your order for <b>{{ order_summary }}</b>.</div><h2>Refund status</h2><div>The merchant has granted you refunds on the purchase of <b>{{ refund_amount }}</b>.</div><h2>Full contract details</h2><pre><table><tr><td>amount</td><td>{{ contract_terms.amount }}</td></tr><tr><td>summary</td><td>{{ contract_terms.summary }}</td></tr><tr><td>pay deadline</td><td>{{ contract_terms.pay_deadline.t_ms }}</td></tr><tr><td>merchant name</td><td>{{ contract_terms.merchant.name }}</td></tr></table><div>{{{contract_terms!stringify }}}</div></pre> + <div class="p1b3vqup"><header><h1>Details of order {{ contract_terms.order_id }}</h1></header><section>{{#refund_amount}}<section><div class="i1pkgksb"><b>Refunded:</b> The merchant refunded you <b>{{ refund_amount }}</b>.</div></section>{{/refund_amount}}<section><dl class="t2c81u8"><dt>Order summary:</dt><dd>{{ contract_terms.summary }}</dd><dt>Amount paid:</dt><dd>{{ contract_terms.amount }}</dd><dt>Order date:</dt><dd>{{ contract_terms.timestamp_str }} </dd><dt>Merchant name:</dt><dd>{{ contract_terms.merchant.name }}</dd></dl></section>{{#contract_terms.hasProducts}}<section><h2>Products purchased</h2><dl class="t1mav7fx">{{#contract_terms.products}}<p>{{description}}</p><dl><dt>Quantity:</dt><dd>{{quantity}}</dd><dt>Price:</dt><dd>{{price}}</dd>{{#hasTaxes}}{{#taxes}}<dt>{{name}}</dt><dd>{{tax}}</dd>{{/taxes}}{{/hasTaxes}}{{#delivery_date}}<dt>Delivered on:</dt><dd>{{ delivery_date_str }} </dd>{{/delivery_date}}{{#unit}}<dt>Product unit:</dt><dd>{{.}}</dd>{{/unit}}{{#product_id}}<dt>Product ID:</dt><dd>{{.}}</dd>{{/product_id}}</dl>{{/contract_terms.products}}</dl></section>{{/contract_terms.hasProducts}}{{#contract_terms.has_delivery_info}}<section><h2>Delivery information</h2><dl class="t2c81u8">{{#contract_terms.delivery_date}}<dt>Delivery date:</dt><dd>{{ contract_terms.delivery_date_str }} </dd>{{/contract_terms.delivery_date}}{{#contract_terms.delivery_location}}<dt>Delivery address:</dt>{{#contract_terms.delivery_location.building_name}}<dd>{{ contract_terms.delivery_location.building_name }} {{ contract_terms.delivery_location.building_number }}</dd>{{/contract_terms.delivery_location.building_name}}{{#contract_terms.delivery_location.country}}<dd>{{ contract_terms.delivery_location.country }} {{ contract_terms.delivery_location.country_subdivision }}</dd>{{/contract_terms.delivery_location.country}}{{#contract_terms.delivery_location.district}}<dd>{{ contract_terms.delivery_location.district }}</dd>{{/contract_terms.delivery_location.district}}{{#contract_terms.delivery_location.post_code}}<dd>{{ contract_terms.delivery_location.post_code }}</dd>{{/contract_terms.delivery_location.post_code}}{{#contract_terms.delivery_location.street}}<dd>{{ contract_terms.delivery_location.street }}</dd>{{/contract_terms.delivery_location.street}}{{#contract_terms.delivery_location.town}}<dd>{{ contract_terms.delivery_location.town }}</dd>{{/contract_terms.delivery_location.town}}{{#contract_terms.delivery_location.town_location}}<dd>{{ contract_terms.delivery_location.town_location }}</dd>{{/contract_terms.delivery_location.town_location}}{{/contract_terms.delivery_location}}</dl></section>{{/contract_terms.has_delivery_info}}<section><h2>Full payment information</h2><dl class="t2c81u8"><dt>Amount paid:</dt><dd>{{ contract_terms.amount }}</dd><dt>Wire transfer method:</dt><dd>{{ contract_terms.wire_method }}</dd><dt>Payment deadline:</dt><dd>{{ contract_terms.pay_deadline_str }} </dd><dt>Exchange transfer deadline:</dt><dd>{{ contract_terms.wire_transfer_deadline_str }} </dd><dt>Maximum deposit fee:</dt><dd>{{ contract_terms.max_fee }}</dd><dt>Maximum wire fee:</dt><dd>{{ contract_terms.max_wire_fee }}</dd><dt>Wire fee amortization:</dt><dd>{{ contract_terms.wire_fee_amortization }} transactions</dd></dl></section><section><h2>Refund information</h2><dl class="t2c81u8"><dt>Refund deadline:</dt><dd>{{ contract_terms.refund_deadline_str }} </dd>{{#contract_terms.auto_refund}}<dt>Attempt autorefund for:</dt><dd>{{ contract_terms.auto_refund_str }} </dd>{{/contract_terms.auto_refund}}</dl></section><section><h2>Additional order details</h2><dl class="t2c81u8"><dt>Public reorder URL:</dt><dd> -- not defined yet -- </dd>{{#contract_terms.fulfillment_url}}<dt>Fulfillment URL:</dt><dd>{{ contract_terms.fulfillment_url }}</dd>{{/contract_terms.fulfillment_url}}</dl></section><section><h2>Full merchant information</h2><dl class="t2c81u8"><dt>Merchant name:</dt><dd>{{ contract_terms.merchant.name }}</dd><dt>Merchant address:</dt>{{#contract_terms.merchant.address.building_name}}<dd>{{ contract_terms.merchant.address.building_name }} {{ contract_terms.merchant.address.building_number }}</dd>{{/contract_terms.merchant.address.building_name}}{{#contract_terms.merchant.address.country}}<dd>{{ contract_terms.merchant.address.country }} {{ contract_terms.merchant.address.country_subdivision }}</dd>{{/contract_terms.merchant.address.country}}{{#contract_terms.merchant.address.district}}<dd>{{ contract_terms.merchant.address.district }}</dd>{{/contract_terms.merchant.address.district}}{{#contract_terms.merchant.address.post_code}}<dd>{{ contract_terms.merchant.address.post_code }}</dd>{{/contract_terms.merchant.address.post_code}}{{#contract_terms.merchant.address.street}}<dd>{{ contract_terms.merchant.address.street }}</dd>{{/contract_terms.merchant.address.street}}{{#contract_terms.merchant.address.town}}<dd>{{ contract_terms.merchant.address.town }}</dd>{{/contract_terms.merchant.address.town}}{{#contract_terms.merchant.address.town_location}}<dd>{{ contract_terms.merchant.address.town_location }}</dd>{{/contract_terms.merchant.address.town_location}}<dt>Merchant's jurisdiction:</dt>{{#contract_terms.merchant.jurisdiction.building_name}}<dd>{{ contract_terms.merchant.jurisdiction.building_name }} {{ contract_terms.merchant.jurisdiction.building_number }}</dd>{{/contract_terms.merchant.jurisdiction.building_name}}{{#contract_terms.merchant.jurisdiction.country}}<dd>{{ contract_terms.merchant.jurisdiction.country }} {{ contract_terms.merchant.jurisdiction.country_subdivision }}</dd>{{/contract_terms.merchant.jurisdiction.country}}{{#contract_terms.merchant.jurisdiction.district}}<dd>{{ contract_terms.merchant.jurisdiction.district }}</dd>{{/contract_terms.merchant.jurisdiction.district}}{{#contract_terms.merchant.jurisdiction.post_code}}<dd>{{ contract_terms.merchant.jurisdiction.post_code }}</dd>{{/contract_terms.merchant.jurisdiction.post_code}}{{#contract_terms.merchant.jurisdiction.street}}<dd>{{ contract_terms.merchant.jurisdiction.street }}</dd>{{/contract_terms.merchant.jurisdiction.street}}{{#contract_terms.merchant.jurisdiction.town}}<dd>{{ contract_terms.merchant.jurisdiction.town }}</dd>{{/contract_terms.merchant.jurisdiction.town}}{{#contract_terms.merchant.jurisdiction.town_location}}<dd>{{ contract_terms.merchant.jurisdiction.town_location }}</dd>{{/contract_terms.merchant.jurisdiction.town_location}}<dt>Merchant URI:</dt><dd>{{ contract_terms.merchant_base_url }}</dd><dt>Merchant's public key:</dt><dd>{{ contract_terms.merchant_pub }}</dd></dl></section>{{#contract_terms.hasAuditors}}<section><h2>Auditors accepted by the merchant</h2><dl class="t2c81u8">{{#contract_terms.auditors}}<p>{{name}}</p><dt>Auditor's public key:</dt><dd>{{auditor_pub}}</dd><dt>Auditor's URL:</dt><dd>{{url}}</dd>{{/contract_terms.auditors}}</dl></section>{{/contract_terms.hasAuditors}}{{#contract_terms.hasExchanges}}<section><h2>Exchanges accepted by the merchant</h2><dl class="t2c81u8">{{#contract_terms.exchanges}}<dt>Exchange's URL:</dt><dd>{{url}}</dd><dt>Public key:</dt><dd>{{master_pub}}</dd>{{/contract_terms.exchanges}}</dl></section>{{/contract_terms.hasExchanges}}</section><footer class="fef0x5t"><p><a href="https://taler.net/">Learn more about GNU Taler on our website.</a><p>Copyright © 2014—2021 Taler Systems SA</p></p></footer></div> <script>var page = (function (exports) { 'use strict'; @@ -1119,6 +1128,114 @@ a.pure-button-selected { } /** + * @name addDays + * @category Day Helpers + * @summary Add the specified number of days to the given date. + * + * @description + * Add the specified number of days to the given date. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} - the new date with the days added + * @throws {TypeError} - 2 arguments required + * + * @example + * // Add 10 days to 1 September 2014: + * const result = addDays(new Date(2014, 8, 1), 10) + * //=> Thu Sep 11 2014 00:00:00 + */ + + function addDays(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var amount = toInteger(dirtyAmount); + + if (isNaN(amount)) { + return new Date(NaN); + } + + if (!amount) { + // If 0 days, no-op to avoid changing times in the hour before end of DST + return date; + } + + date.setDate(date.getDate() + amount); + return date; + } + + /** + * @name addMonths + * @category Month Helpers + * @summary Add the specified number of months to the given date. + * + * @description + * Add the specified number of months to the given date. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the months added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 5 months to 1 September 2014: + * const result = addMonths(new Date(2014, 8, 1), 5) + * //=> Sun Feb 01 2015 00:00:00 + */ + + function addMonths(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var amount = toInteger(dirtyAmount); + + if (isNaN(amount)) { + return new Date(NaN); + } + + if (!amount) { + // If 0 months, no-op to avoid changing times in the hour before end of DST + return date; + } + + var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for + // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and + // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we + // want except that dates will wrap around the end of a month, meaning that + // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So + // we'll default to the end of the desired month by adding 1 to the desired + // month and using a date of 0 to back up one day to the end of the desired + // month. + + var endOfDesiredMonth = new Date(date.getTime()); + endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); + var daysInMonth = endOfDesiredMonth.getDate(); + + if (dayOfMonth >= daysInMonth) { + // If we're already at the end of the month, then this is the correct date + // and we're done. + return endOfDesiredMonth; + } else { + // Otherwise, we now know that setting the original day-of-month value won't + // cause an overflow, so set the desired day-of-month. Note that we can't + // just set the date of `endOfDesiredMonth` because that object may have had + // its time changed in the unusual case where where a DST transition was on + // the last day of the month and its local time was in the hour skipped or + // repeated next to a DST transition. So we use `date` instead which is + // guaranteed to still have the original time. + date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); + return date; + } + } + + /** * @name addMilliseconds * @category Millisecond Helpers * @summary Add the specified number of milliseconds to the given date. @@ -1166,6 +1283,136 @@ a.pure-button-selected { } /** + * @name startOfDay + * @category Day Helpers + * @summary Return the start of a day for the given date. + * + * @description + * Return the start of a day for the given date. + * The result will be in the local timezone. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a day + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a day for 2 September 2014 11:55:00: + * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 00:00:00 + */ + + function startOfDay(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setHours(0, 0, 0, 0); + return date; + } + + var MILLISECONDS_IN_DAY$1 = 86400000; + /** + * @name differenceInCalendarDays + * @category Day Helpers + * @summary Get the number of calendar days between the given dates. + * + * @description + * Get the number of calendar days between the given dates. This means that the times are removed + * from the dates and then the difference in days is calculated. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar days + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * var result = differenceInCalendarDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 366 + * // How many calendar days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * var result = differenceInCalendarDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 1 + */ + + function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var startOfDayLeft = startOfDay(dirtyDateLeft); + var startOfDayRight = startOfDay(dirtyDateRight); + var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft); + var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer + // because the number of milliseconds in a day is not constant + // (e.g. it's different in the day of the daylight saving time clock shift) + + return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY$1); + } + + /** + * @name compareAsc + * @category Common Helpers + * @summary Compare the two dates and return -1, 0 or 1. + * + * @description + * Compare the two dates and return 1 if the first date is after the second, + * -1 if the first date is before the second or 0 if dates are equal. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the first date to compare + * @param {Date|Number} dateRight - the second date to compare + * @returns {Number} the result of the comparison + * @throws {TypeError} 2 arguments required + * + * @example + * // Compare 11 February 1987 and 10 July 1989: + * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) + * //=> -1 + * + * @example + * // Sort the array of dates: + * const result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareAsc) + * //=> [ + * // Wed Feb 11 1987 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Sun Jul 02 1995 00:00:00 + * // ] + */ + + function compareAsc(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var diff = dateLeft.getTime() - dateRight.getTime(); + + if (diff < 0) { + return -1; + } else if (diff > 0) { + return 1; // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff; + } + } + + /** * @name isValid * @category Common Helpers * @summary Is the given date valid? @@ -1229,6 +1476,487 @@ a.pure-button-selected { return !isNaN(date); } + /** + * @name differenceInCalendarMonths + * @category Month Helpers + * @summary Get the number of calendar months between the given dates. + * + * @description + * Get the number of calendar months between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar months + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar months are between 31 January 2014 and 1 September 2014? + * var result = differenceInCalendarMonths( + * new Date(2014, 8, 1), + * new Date(2014, 0, 31) + * ) + * //=> 8 + */ + + function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); + var monthDiff = dateLeft.getMonth() - dateRight.getMonth(); + return yearDiff * 12 + monthDiff; + } + + /** + * @name differenceInCalendarYears + * @category Year Helpers + * @summary Get the number of calendar years between the given dates. + * + * @description + * Get the number of calendar years between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar years are between 31 December 2013 and 11 February 2015? + * var result = differenceInCalendarYears( + * new Date(2015, 1, 11), + * new Date(2013, 11, 31) + * ) + * //=> 2 + */ + + function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + return dateLeft.getFullYear() - dateRight.getFullYear(); + } + + // for accurate equality comparisons of UTC timestamps that end up + // having the same representation in local time, e.g. one hour before + // DST ends vs. the instant that DST ends. + + function compareLocalAsc(dateLeft, dateRight) { + var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds(); + + if (diff < 0) { + return -1; + } else if (diff > 0) { + return 1; // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff; + } + } + /** + * @name differenceInDays + * @category Day Helpers + * @summary Get the number of full days between the given dates. + * + * @description + * Get the number of full day periods between two dates. Fractional days are + * truncated towards zero. + * + * One "full day" is the distance between a local time in one day to the same + * local time on the next or previous day. A full day can sometimes be less than + * or more than 24 hours if a daylight savings change happens between two dates. + * + * To ignore DST and only measure exact 24-hour periods, use this instead: + * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`. + * + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full days according to the local timezone + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * var result = differenceInDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 365 + * // How many full days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * var result = differenceInDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 0 + * // How many full days are between + * // 1 March 2020 0:00 and 1 June 2020 0:00 ? + * // Note: because local time is used, the + * // result will always be 92 days, even in + * // time zones where DST starts and the + * // period has only 92*24-1 hours. + * var result = differenceInDays( + * new Date(2020, 5, 1), + * new Date(2020, 2, 1) + * ) + //=> 92 + */ + + + function differenceInDays(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var sign = compareLocalAsc(dateLeft, dateRight); + var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight)); + dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full + // If so, result must be decreased by 1 in absolute value + + var isLastDayNotFull = compareLocalAsc(dateLeft, dateRight) === -sign; + var result = sign * (difference - isLastDayNotFull); // Prevent negative zero + + return result === 0 ? 0 : result; + } + + /** + * @name differenceInMilliseconds + * @category Millisecond Helpers + * @summary Get the number of milliseconds between the given dates. + * + * @description + * Get the number of milliseconds between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of milliseconds + * @throws {TypeError} 2 arguments required + * + * @example + * // How many milliseconds are between + * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? + * var result = differenceInMilliseconds( + * new Date(2014, 6, 2, 12, 30, 21, 700), + * new Date(2014, 6, 2, 12, 30, 20, 600) + * ) + * //=> 1100 + */ + + function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + return dateLeft.getTime() - dateRight.getTime(); + } + + var MILLISECONDS_IN_HOUR = 3600000; + /** + * @name differenceInHours + * @category Hour Helpers + * @summary Get the number of hours between the given dates. + * + * @description + * Get the number of hours between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of hours + * @throws {TypeError} 2 arguments required + * + * @example + * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? + * var result = differenceInHours( + * new Date(2014, 6, 2, 19, 0), + * new Date(2014, 6, 2, 6, 50) + * ) + * //=> 12 + */ + + function differenceInHours(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR; + return diff > 0 ? Math.floor(diff) : Math.ceil(diff); + } + + var MILLISECONDS_IN_MINUTE = 60000; + /** + * @name differenceInMinutes + * @category Minute Helpers + * @summary Get the number of minutes between the given dates. + * + * @description + * Get the signed number of full (rounded towards 0) minutes between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of minutes + * @throws {TypeError} 2 arguments required + * + * @example + * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? + * var result = differenceInMinutes( + * new Date(2014, 6, 2, 12, 20, 0), + * new Date(2014, 6, 2, 12, 7, 59) + * ) + * //=> 12 + * + * @example + * // How many minutes are from 10:01:59 to 10:00:00 + * var result = differenceInMinutes( + * new Date(2000, 0, 1, 10, 0, 0), + * new Date(2000, 0, 1, 10, 1, 59) + * ) + * //=> -1 + */ + + function differenceInMinutes(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE; + return diff > 0 ? Math.floor(diff) : Math.ceil(diff); + } + + /** + * @name endOfDay + * @category Day Helpers + * @summary Return the end of a day for the given date. + * + * @description + * Return the end of a day for the given date. + * The result will be in the local timezone. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a day + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a day for 2 September 2014 11:55:00: + * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 23:59:59.999 + */ + + function endOfDay(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setHours(23, 59, 59, 999); + return date; + } + + /** + * @name endOfMonth + * @category Month Helpers + * @summary Return the end of a month for the given date. + * + * @description + * Return the end of a month for the given date. + * The result will be in the local timezone. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a month + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a month for 2 September 2014 11:55:00: + * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 23:59:59.999 + */ + + function endOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var month = date.getMonth(); + date.setFullYear(date.getFullYear(), month + 1, 0); + date.setHours(23, 59, 59, 999); + return date; + } + + /** + * @name isLastDayOfMonth + * @category Month Helpers + * @summary Is the given date the last day of a month? + * + * @description + * Is the given date the last day of a month? + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is the last day of a month + * @throws {TypeError} 1 argument required + * + * @example + * // Is 28 February 2014 the last day of a month? + * var result = isLastDayOfMonth(new Date(2014, 1, 28)) + * //=> true + */ + + function isLastDayOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + return endOfDay(date).getTime() === endOfMonth(date).getTime(); + } + + /** + * @name differenceInMonths + * @category Month Helpers + * @summary Get the number of full months between the given dates. + * + * @description + * Get the number of full months between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full months + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full months are between 31 January 2014 and 1 September 2014? + * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) + * //=> 7 + */ + + function differenceInMonths(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var sign = compareAsc(dateLeft, dateRight); + var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight)); + var result; // Check for the difference of less than month + + if (difference < 1) { + result = 0; + } else { + if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) { + // This will check if the date is end of Feb and assign a higher end of month date + // to compare it with Jan + dateLeft.setDate(30); + } + + dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full + // If so, result must be decreased by 1 in absolute value + + var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; // Check for cases of one full calendar month + + if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) { + isLastMonthNotFull = false; + } + + result = sign * (difference - isLastMonthNotFull); + } // Prevent negative zero + + + return result === 0 ? 0 : result; + } + + /** + * @name differenceInSeconds + * @category Second Helpers + * @summary Get the number of seconds between the given dates. + * + * @description + * Get the number of seconds between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of seconds + * @throws {TypeError} 2 arguments required + * + * @example + * // How many seconds are between + * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? + * var result = differenceInSeconds( + * new Date(2014, 6, 2, 12, 30, 20, 0), + * new Date(2014, 6, 2, 12, 30, 7, 999) + * ) + * //=> 12 + */ + + function differenceInSeconds(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000; + return diff > 0 ? Math.floor(diff) : Math.ceil(diff); + } + + /** + * @name differenceInYears + * @category Year Helpers + * @summary Get the number of full years between the given dates. + * + * @description + * Get the number of full years between the given dates. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full years are between 31 December 2013 and 11 February 2015? + * var result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) + * //=> 1 + */ + + function differenceInYears(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var sign = compareAsc(dateLeft, dateRight); + var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); // Set both dates to a valid leap year for accurate comparison when dealing + // with leap days + + dateLeft.setFullYear('1584'); + dateRight.setFullYear('1584'); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full + // If so, result must be decreased by 1 in absolute value + + var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign; + var result = sign * (difference - isLastYearNotFull); // Prevent negative zero + + return result === 0 ? 0 : result; + } + var formatDistanceLocale = { lessThanXSeconds: { one: 'less than a second', @@ -3429,9 +4157,472 @@ a.pure-button-selected { return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); } - var n$1,u$1,i$1,t,r$1={},f$1=[],e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c$1(n,l){for(var u in l)n[u]=l[u];return n}function s$1(n){var l=n.parentNode;l&&l.removeChild(n);}function a$1(n,l,u){var i,t,o,r=arguments,f={};for(o in l)"key"==o?i=l[o]:"ref"==o?t=l[o]:f[o]=l[o];if(arguments.length>3)for(u=[u],o=3;o<arguments.length;o++)u.push(r[o]);if(null!=u&&(f.children=u),"function"==typeof n&&null!=n.defaultProps)for(o in n.defaultProps)void 0===f[o]&&(f[o]=n.defaultProps[o]);return v$1(n,f,i,t,null)}function v$1(l,u,i,t,o){var r={type:l,props:u,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++n$1.__v:o};return null!=n$1.vnode&&n$1.vnode(r),r}function y(n){return n.children}function p$1(n,l){this.props=n,this.context=l;}function d$1(n,l){if(null==l)return n.__?d$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?d$1(n):null}function _$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return _$1(n)}}function k(l){(!l.__d&&(l.__d=!0)&&u$1.push(l)&&!b.__r++||t!==n$1.debounceRendering)&&((t=n$1.debounceRendering)||i$1)(b);}function b(){for(var n;b.__r=u$1.length;)n=u$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),u$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=c$1({},t)).__v=t.__v+1,I(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?d$1(t):o,t.__h),T(u,t),t.__e!=o&&_$1(t)));});}function m$1(n,l,u,i,t,o,e,c,s,a){var h,p,_,k,b,m,w,A=i&&i.__k||f$1,P=A.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(y,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(_=A[h])||_&&k.key==_.key&&k.type===_.type)A[h]=void 0;else for(p=0;p<P;p++){if((_=A[p])&&k.key==_.key&&k.type===_.type){A[p]=void 0;break}_=null;}I(n,k,_=_||r$1,t,o,e,c,s,a),b=k.__e,(p=k.ref)&&_.ref!=p&&(w||(w=[]),_.ref&&w.push(_.ref,null,k),w.push(p,k.__c||b,k)),null!=b?(null==m&&(m=b),"function"==typeof k.type&&null!=k.__k&&k.__k===_.__k?k.__d=s=g$1(k,s,n):s=x$1(n,k,_,A,b,s),a||"option"!==u.type?"function"==typeof u.type&&(u.__d=s):n.value=""):s&&_.__e==s&&s.parentNode!=n&&(s=d$1(_));}for(u.__e=m,h=P;h--;)null!=A[h]&&("function"==typeof u.type&&null!=A[h].__e&&A[h].__e==u.__d&&(u.__d=d$1(i,h+1)),L(A[h],A[h]));if(w)for(h=0;h<w.length;h++)z(w[h],w[++h],w[++h]);}function g$1(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,l="function"==typeof t.type?g$1(t,l,u):x$1(u,t,t,n.__k,t.__e,l));return l}function x$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function A(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||C(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||C(n,o,l[o],u[o],i);}function P(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||e.test(l)?u:u+"px";}function C(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||P(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||P(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?H:$,o):n.removeEventListener(l,o?H:$,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function $(l){this.l[l.type+!1](n$1.event?n$1.event(l):l);}function H(l){this.l[l.type+!0](n$1.event?n$1.event(l):l);}function I(l,u,i,t,o,r,f,e,s){var a,v,h,d,_,k,b,g,w,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(s=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=n$1.__b)&&a(u);try{n:if("function"==typeof P){if(g=u.props,w=(a=P.contextType)&&t[a.__c],x=a?w?w.props.value:a.__:t,i.__c?b=(v=u.__c=i.__c).__=v.__E:("prototype"in P&&P.prototype.render?u.__c=v=new P(g,x):(u.__c=v=new p$1(g,x),v.constructor=P,v.render=M),w&&w.sub(v),v.props=g,v.state||(v.state={}),v.context=x,v.__n=t,h=v.__d=!0,v.__h=[]),null==v.__s&&(v.__s=v.state),null!=P.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=c$1({},v.__s)),c$1(v.__s,P.getDerivedStateFromProps(g,v.__s))),d=v.props,_=v.state,h)null==P.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else {if(null==P.getDerivedStateFromProps&&g!==d&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(g,x),!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(g,v.__s,x)||u.__v===i.__v){v.props=g,v.state=v.__s,u.__v!==i.__v&&(v.__d=!1),v.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),v.__h.length&&f.push(v);break n}null!=v.componentWillUpdate&&v.componentWillUpdate(g,v.__s,x),null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(d,_,k);});}v.context=x,v.props=g,v.state=v.__s,(a=n$1.__r)&&a(u),v.__d=!1,v.__v=u,v.__P=l,a=v.render(v.props,v.state,v.context),v.state=v.__s,null!=v.getChildContext&&(t=c$1(c$1({},t),v.getChildContext())),h||null==v.getSnapshotBeforeUpdate||(k=v.getSnapshotBeforeUpdate(d,_)),A=null!=a&&a.type===y&&null==a.key?a.props.children:a,m$1(l,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,s),v.base=u.__e,u.__h=null,v.__h.length&&f.push(v),b&&(v.__E=v.__=null),v.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=j(i.__e,u,i,t,o,r,f,s);(a=n$1.diffed)&&a(u);}catch(l){u.__v=null,(s||null!=r)&&(u.__e=e,u.__h=!!s,r[r.indexOf(e)]=null),n$1.__e(l,u,i);}}function T(l,u){n$1.__c&&n$1.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n$1.__e(l,u.__v);}});}function j(n,l,u,i,t,o,e,c){var a,v,h,y,p=u.props,d=l.props,_=l.type,k=0;if("svg"===_&&(t=!0),null!=o)for(;k<o.length;k++)if((a=o[k])&&(a===n||(_?a.localName==_:3==a.nodeType))){n=a,o[k]=null;break}if(null==n){if(null===_)return document.createTextNode(d);n=t?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),o=null,c=!1;}if(null===_)p===d||c&&n.data===d||(n.data=d);else {if(o=o&&f$1.slice.call(n.childNodes),v=(p=u.props||r$1).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!c){if(null!=o)for(p={},y=0;y<n.attributes.length;y++)p[n.attributes[y].name]=n.attributes[y].value;(h||v)&&(h&&(v&&h.__html==v.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""));}if(A(n,d,p,t,c),h)l.__k=[];else if(k=l.props.children,m$1(n,Array.isArray(k)?k:[k],l,u,i,t&&"foreignObject"!==_,o,e,n.firstChild,c),null!=o)for(k=o.length;k--;)null!=o[k]&&s$1(o[k]);c||("value"in d&&void 0!==(k=d.value)&&(k!==n.value||"progress"===_&&!k)&&C(n,"value",k,p.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==n.checked&&C(n,"checked",k,p.checked,!1));}return n}function z(l,u,i){try{"function"==typeof l?l(u):l.current=u;}catch(l){n$1.__e(l,i);}}function L(l,u,i){var t,o,r;if(n$1.unmount&&n$1.unmount(l),(t=l.ref)&&(t.current&&t.current!==l.__e||z(t,null,u)),i||"function"==typeof l.type||(i=null!=(o=l.__e)),l.__e=l.__d=void 0,null!=(t=l.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(l){n$1.__e(l,u);}t.base=t.__P=null;}if(t=l.__k)for(r=0;r<t.length;r++)t[r]&&L(t[r],u,i);null!=o&&s$1(o);}function M(n,l,u){return this.constructor(n,u)}function N(l,u,i){var t,o,e;n$1.__&&n$1.__(l,u),o=(t="function"==typeof i)?null:i&&i.__k||u.__k,e=[],I(u,l=(!t&&i||u).__k=a$1(y,null,[l]),o||r$1,r$1,void 0!==u.ownerSVGElement,!t&&i?[i]:o?null:u.firstChild?f$1.slice.call(u.childNodes):null,e,!t&&i?i:o?o.__e:u.firstChild,t),T(e,l);}n$1={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n},__v:0},p$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c$1({},this.state),"function"==typeof n&&(n=n(c$1({},u),this.props)),n&&c$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),k(this));},p$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),k(this));},p$1.prototype.render=y,u$1=[],i$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b.__r=0; + var defaultFormat = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']; + /** + * @name formatDuration + * @category Common Helpers + * @summary Formats a duration in human-readable format + * + * @description + * Return human-readable duration string i.e. "9 months 2 days" + * + * @param {Duration} duration - the duration to format + * @param {Object} [options] - an object with options. - var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,n=/[&<>"]/;function o(e){var t=String(e);return n.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t}var a=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},i=function(e,t,r){return String(e).length>(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},l={};function s(e){var t="";for(var n in e){var o=e[n];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),t+=": ",t+=o,"number"==typeof o&&!1===r.test(n)&&(t+="px"),t+=";");}return t||void 0}function f(e,t){for(var r in t)e[r]=t[r];return e}function u(e,t){return Array.isArray(t)?t.reduce(u,e):null!=t&&!1!==t&&e.push(t),e}var c={shallow:!0},p=[],_=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,v=/[\s\n\\/='"\0<>]/,d=function(){};m.render=m;var g=function(e,t){return m(e,t,c)},h=[];function m(t,r,n){r=r||{},n=n||{};var o=n$1.__s;n$1.__s=!0;var a=x(t,r,n);return n$1.__c&&n$1.__c(t,h),h.length=0,n$1.__s=o,a}function x(r,n,l,c,g,h){if(null==r||"boolean"==typeof r)return "";if("object"!=typeof r)return o(r);var m=l.pretty,y$1=m&&"string"==typeof m?m:"\t";if(Array.isArray(r)){for(var b="",S=0;S<r.length;S++)m&&S>0&&(b+="\n"),b+=x(r[S],n,l,c,g,h);return b}var w,k=r.type,O=r.props,C=!1;if("function"==typeof k){if(C=!0,!l.shallow||!c&&!1!==l.renderRootComponent){if(k===y){var A=[];return u(A,r.props.children),x(A,n,l,!1!==l.shallowHighOrder,g,h)}var H,j=r.__c={__v:r,context:n,props:r.props,setState:d,forceUpdate:d,__h:[]};if(n$1.__b&&n$1.__b(r),n$1.__r&&n$1.__r(r),k.prototype&&"function"==typeof k.prototype.render){var F=k.contextType,M=F&&n[F.__c],T=null!=F?M?M.props.value:F.__:n;(j=r.__c=new k(O,T)).__v=r,j._dirty=j.__d=!0,j.props=O,null==j.state&&(j.state={}),null==j._nextState&&null==j.__s&&(j._nextState=j.__s=j.state),j.context=T,k.getDerivedStateFromProps?j.state=f(f({},j.state),k.getDerivedStateFromProps(j.props,j.state)):j.componentWillMount&&(j.componentWillMount(),j.state=j._nextState!==j.state?j._nextState:j.__s!==j.state?j.__s:j.state),H=j.render(j.props,j.state,j.context);}else {var $=k.contextType,L=$&&n[$.__c];H=k.call(r.__c,O,null!=$?L?L.props.value:$.__:n);}return j.getChildContext&&(n=f(f({},n),j.getChildContext())),n$1.diffed&&n$1.diffed(r),x(H,n,l,!1!==l.shallowHighOrder,g,h)}k=(w=k).displayName||w!==Function&&w.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=p.length;n--;)if(p[n]===e){r=n;break}r<0&&(r=p.push(e)-1),t="UnnamedComponent"+r;}return t}(w);}var E,D,N="<"+k;if(O){var P=Object.keys(O);l&&!0===l.sortAttributes&&P.sort();for(var R=0;R<P.length;R++){var U=P[R],W=O[U];if("children"!==U){if(!v.test(U)&&(l&&l.allAttributes||"key"!==U&&"ref"!==U&&"__self"!==U&&"__source"!==U&&"defaultValue"!==U)){if("className"===U){if(O.class)continue;U="class";}else g&&U.match(/^xlink:?./)&&(U=U.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===U){if(O.for)continue;U="for";}"style"===U&&W&&"object"==typeof W&&(W=s(W)),"a"===U[0]&&"r"===U[1]&&"boolean"==typeof W&&(W=String(W));var q=l.attributeHook&&l.attributeHook(U,W,n,l,C);if(q||""===q)N+=q;else if("dangerouslySetInnerHTML"===U)D=W&&W.__html;else if("textarea"===k&&"value"===U)E=W;else if((W||0===W||""===W)&&"function"!=typeof W){if(!(!0!==W&&""!==W||(W=U,l&&l.xml))){N+=" "+U;continue}if("value"===U){if("select"===k){h=W;continue}"option"===k&&h==W&&(N+=" selected");}N+=" "+U+'="'+o(W)+'"';}}}else E=W;}}if(m){var z=N.replace(/\n\s*/," ");z===N||~z.indexOf("\n")?m&&~N.indexOf("\n")&&(N+="\n"):N=z;}if(N+=">",v.test(k))throw new Error(k+" is not a valid HTML tag name in "+N);var I,V=_.test(k)||l.voidElements&&l.voidElements.test(k),Z=[];if(D)m&&i(D)&&(D="\n"+y$1+a(D,y$1)),N+=D;else if(null!=E&&u(I=[],E).length){for(var B=m&&~N.indexOf("\n"),G=!1,J=0;J<I.length;J++){var K=I[J];if(null!=K&&!1!==K){var Q=x(K,n,l,!0,"svg"===k||"foreignObject"!==k&&g,h);if(m&&!B&&i(Q)&&(B=!0),Q)if(m){var X=Q.length>0&&"<"!=Q[0];G&&X?Z[Z.length-1]+=Q:Z.push(Q),G=X;}else Z.push(Q);}}if(m&&B)for(var Y=Z.length;Y--;)Z[Y]="\n"+y$1+a(Z[Y],y$1);}if(Z.length||D)N+=Z.join("");else if(l&&l.xml)return N.substring(0,N.length-1)+" />";return !V||I||D?(m&&~N.indexOf("\n")&&(N+="\n"),N+="</"+k+">"):N=N.replace(/>$/," />"),N}m.shallowRender=g; + * @param {string[]} [options.format=['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']] - the array of units to format + * @param {boolean} [options.zero=false] - should be zeros be included in the output? + * @param {string} [options.delimiter=' '] - delimiter string + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {string} the formatted date string + * @throws {TypeError} 1 argument required + * + * @example + * // Format full duration + * formatDuration({ + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds + * + * @example + * // Format partial duration + * formatDuration({ months: 9, days: 2 }) + * //=> '9 months 2 days' + * + * @example + * // Customize the format + * formatDuration( + * { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }, + * { format: ['months', 'weeks'] } + * ) === '9 months 1 week' + * + * @example + * // Customize the zeros presence + * formatDuration({ years: 0, months: 9 }) + * //=> '9 months' + * formatDuration({ years: 0, months: 9 }, { zero: true }) + * //=> '0 years 9 months' + * + * @example + * // Customize the delimiter + * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' }) + * //=> '2 years, 9 months, 3 weeks' + */ + + function formatDuration(duration, options) { + if (arguments.length < 1) { + throw new TypeError("1 argument required, but only ".concat(arguments.length, " present")); + } + + var format = (options === null || options === void 0 ? void 0 : options.format) || defaultFormat; + var locale = (options === null || options === void 0 ? void 0 : options.locale) || defaultLocale; + var zero = (options === null || options === void 0 ? void 0 : options.zero) || false; + var delimiter = (options === null || options === void 0 ? void 0 : options.delimiter) || ' '; + var result = format.reduce(function (acc, unit) { + var token = "x".concat(unit.replace(/(^.)/, function (m) { + return m.toUpperCase(); + })); + var addChunk = typeof duration[unit] === 'number' && (zero || duration[unit]); + return addChunk ? acc.concat(locale.formatDistance(token, duration[unit])) : acc; + }, []).join(delimiter); + return result; + } + + /** + * @name subDays + * @category Day Helpers + * @summary Subtract the specified number of days from the given date. + * + * @description + * Subtract the specified number of days from the given date. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the days subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 10 days from 1 September 2014: + * const result = subDays(new Date(2014, 8, 1), 10) + * //=> Fri Aug 22 2014 00:00:00 + */ + + function subDays(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + return addDays(dirtyDate, -amount); + } + + /** + * @name subMonths + * @category Month Helpers + * @summary Subtract the specified number of months from the given date. + * + * @description + * Subtract the specified number of months from the given date. + * + * ### v2.0.0 breaking changes: + * + * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the months subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 5 months from 1 February 2015: + * const result = subMonths(new Date(2015, 1, 1), 5) + * //=> Mon Sep 01 2014 00:00:00 + */ + + function subMonths(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + return addMonths(dirtyDate, -amount); + } + + /** + * @name sub + * @category Common Helpers + * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @description + * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be subtracted + * + * | Key | Description | + * |---------|------------------------------------| + * | years | Amount of years to be subtracted | + * | months | Amount of months to be subtracted | + * | weeks | Amount of weeks to be subtracted | + * | days | Amount of days to be subtracted | + * | hours | Amount of hours to be subtracted | + * | minutes | Amount of minutes to be subtracted | + * | seconds | Amount of seconds to be subtracted | + * + * All values default to 0 + * + * @returns {Date} the new date with the seconds subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract the following duration from 15 June 2017 15:29:20 + * const result = sub(new Date(2017, 5, 15, 15, 29, 20), { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> Mon Sep 1 2014 10:19:50 + */ + + function sub(dirtyDate, duration) { + requiredArgs(2, arguments); + if (!duration || typeof duration !== 'object') return new Date(NaN); + var years = 'years' in duration ? toInteger(duration.years) : 0; + var months = 'months' in duration ? toInteger(duration.months) : 0; + var weeks = 'weeks' in duration ? toInteger(duration.weeks) : 0; + var days = 'days' in duration ? toInteger(duration.days) : 0; + var hours = 'hours' in duration ? toInteger(duration.hours) : 0; + var minutes = 'minutes' in duration ? toInteger(duration.minutes) : 0; + var seconds = 'seconds' in duration ? toInteger(duration.seconds) : 0; // Subtract years and months + + var dateWithoutMonths = subMonths(toDate(dirtyDate), months + years * 12); // Subtract weeks and days + + var dateWithoutDays = subDays(dateWithoutMonths, days + weeks * 7); // Subtract hours, minutes and seconds + + var minutestoSub = minutes + hours * 60; + var secondstoSub = seconds + minutestoSub * 60; + var mstoSub = secondstoSub * 1000; + var finalDate = new Date(dateWithoutDays.getTime() - mstoSub); + return finalDate; + } + + /** + * @name intervalToDuration + * @category Common Helpers + * @summary Convert interval to duration + * + * @description + * Convert a interval object to a duration object. + * + * @param {Interval} interval - the interval to convert to duration + * + * @returns {Duration} The duration Object + * @throws {TypeError} Requires 2 arguments + * @throws {RangeError} `start` must not be Invalid Date + * @throws {RangeError} `end` must not be Invalid Date + * + * @example + * // Get the duration between January 15, 1929 and April 4, 1968. + * intervalToDuration({ + * start: new Date(1929, 0, 15, 12, 0, 0), + * end: new Date(1968, 3, 4, 19, 5, 0) + * }) + * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } + */ + + function intervalToDuration(_ref) { + var start = _ref.start, + end = _ref.end; + requiredArgs(1, arguments); + var dateLeft = toDate(start); + var dateRight = toDate(end); + + if (!isValid(dateLeft)) { + throw new RangeError('Start Date is invalid'); + } + + if (!isValid(dateRight)) { + throw new RangeError('End Date is invalid'); + } + + var duration = { + years: 0, + months: 0, + days: 0, + hours: 0, + minutes: 0, + seconds: 0 + }; + var sign = compareAsc(dateLeft, dateRight); + duration.years = Math.abs(differenceInYears(dateLeft, dateRight)); + var remainingMonths = sub(dateLeft, { + years: sign * duration.years + }); + duration.months = Math.abs(differenceInMonths(remainingMonths, dateRight)); + var remainingDays = sub(remainingMonths, { + months: sign * duration.months + }); + duration.days = Math.abs(differenceInDays(remainingDays, dateRight)); + var remainingHours = sub(remainingDays, { + days: sign * duration.days + }); + duration.hours = Math.abs(differenceInHours(remainingHours, dateRight)); + var remainingMinutes = sub(remainingHours, { + hours: sign * duration.hours + }); + duration.minutes = Math.abs(differenceInMinutes(remainingMinutes, dateRight)); + var remainingSeconds = sub(remainingMinutes, { + minutes: sign * duration.minutes + }); + duration.seconds = Math.abs(differenceInSeconds(remainingSeconds, dateRight)); + return duration; + } + + var n$1,u$1,i$2,t,r$2={},f$2=[],e$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c$2(n,l){for(var u in l)n[u]=l[u];return n}function s$1(n){var l=n.parentNode;l&&l.removeChild(n);}function a$2(n,l,u){var i,t,o,r=arguments,f={};for(o in l)"key"==o?i=l[o]:"ref"==o?t=l[o]:f[o]=l[o];if(arguments.length>3)for(u=[u],o=3;o<arguments.length;o++)u.push(r[o]);if(null!=u&&(f.children=u),"function"==typeof n&&null!=n.defaultProps)for(o in n.defaultProps)void 0===f[o]&&(f[o]=n.defaultProps[o]);return v$2(n,f,i,t,null)}function v$2(l,u,i,t,o){var r={type:l,props:u,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++n$1.__v:o};return null!=n$1.vnode&&n$1.vnode(r),r}function y(n){return n.children}function p$1(n,l){this.props=n,this.context=l;}function d$1(n,l){if(null==l)return n.__?d$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?d$1(n):null}function _$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return _$1(n)}}function k(l){(!l.__d&&(l.__d=!0)&&u$1.push(l)&&!b$1.__r++||t!==n$1.debounceRendering)&&((t=n$1.debounceRendering)||i$2)(b$1);}function b$1(){for(var n;b$1.__r=u$1.length;)n=u$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),u$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=c$2({},t)).__v=t.__v+1,I(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?d$1(t):o,t.__h),T(u,t),t.__e!=o&&_$1(t)));});}function m$1(n,l,u,i,t,o,e,c,s,a){var h,p,_,k,b,m,w,A=i&&i.__k||f$2,P=A.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$2(null,k,null,null,k):Array.isArray(k)?v$2(y,{children:k},null,null,null):k.__b>0?v$2(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(_=A[h])||_&&k.key==_.key&&k.type===_.type)A[h]=void 0;else for(p=0;p<P;p++){if((_=A[p])&&k.key==_.key&&k.type===_.type){A[p]=void 0;break}_=null;}I(n,k,_=_||r$2,t,o,e,c,s,a),b=k.__e,(p=k.ref)&&_.ref!=p&&(w||(w=[]),_.ref&&w.push(_.ref,null,k),w.push(p,k.__c||b,k)),null!=b?(null==m&&(m=b),"function"==typeof k.type&&null!=k.__k&&k.__k===_.__k?k.__d=s=g$2(k,s,n):s=x$3(n,k,_,A,b,s),a||"option"!==u.type?"function"==typeof u.type&&(u.__d=s):n.value=""):s&&_.__e==s&&s.parentNode!=n&&(s=d$1(_));}for(u.__e=m,h=P;h--;)null!=A[h]&&("function"==typeof u.type&&null!=A[h].__e&&A[h].__e==u.__d&&(u.__d=d$1(i,h+1)),L$1(A[h],A[h]));if(w)for(h=0;h<w.length;h++)z(w[h],w[++h],w[++h]);}function g$2(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,l="function"==typeof t.type?g$2(t,l,u):x$3(u,t,t,n.__k,t.__e,l));return l}function w$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){w$1(n,l);}):l.push(n)),l}function x$3(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function A$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||C$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||C$1(n,o,l[o],u[o],i);}function P$1(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||e$1.test(l)?u:u+"px";}function C$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||P$1(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||P$1(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?H$1:$$1,o):n.removeEventListener(l,o?H$1:$$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function $$1(l){this.l[l.type+!1](n$1.event?n$1.event(l):l);}function H$1(l){this.l[l.type+!0](n$1.event?n$1.event(l):l);}function I(l,u,i,t,o,r,f,e,s){var a,v,h,d,_,k,b,g,w,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(s=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=n$1.__b)&&a(u);try{n:if("function"==typeof P){if(g=u.props,w=(a=P.contextType)&&t[a.__c],x=a?w?w.props.value:a.__:t,i.__c?b=(v=u.__c=i.__c).__=v.__E:("prototype"in P&&P.prototype.render?u.__c=v=new P(g,x):(u.__c=v=new p$1(g,x),v.constructor=P,v.render=M$1),w&&w.sub(v),v.props=g,v.state||(v.state={}),v.context=x,v.__n=t,h=v.__d=!0,v.__h=[]),null==v.__s&&(v.__s=v.state),null!=P.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=c$2({},v.__s)),c$2(v.__s,P.getDerivedStateFromProps(g,v.__s))),d=v.props,_=v.state,h)null==P.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else {if(null==P.getDerivedStateFromProps&&g!==d&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(g,x),!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(g,v.__s,x)||u.__v===i.__v){v.props=g,v.state=v.__s,u.__v!==i.__v&&(v.__d=!1),v.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),v.__h.length&&f.push(v);break n}null!=v.componentWillUpdate&&v.componentWillUpdate(g,v.__s,x),null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(d,_,k);});}v.context=x,v.props=g,v.state=v.__s,(a=n$1.__r)&&a(u),v.__d=!1,v.__v=u,v.__P=l,a=v.render(v.props,v.state,v.context),v.state=v.__s,null!=v.getChildContext&&(t=c$2(c$2({},t),v.getChildContext())),h||null==v.getSnapshotBeforeUpdate||(k=v.getSnapshotBeforeUpdate(d,_)),A=null!=a&&a.type===y&&null==a.key?a.props.children:a,m$1(l,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,s),v.base=u.__e,u.__h=null,v.__h.length&&f.push(v),b&&(v.__E=v.__=null),v.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=j$1(i.__e,u,i,t,o,r,f,s);(a=n$1.diffed)&&a(u);}catch(l){u.__v=null,(s||null!=r)&&(u.__e=e,u.__h=!!s,r[r.indexOf(e)]=null),n$1.__e(l,u,i);}}function T(l,u){n$1.__c&&n$1.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n$1.__e(l,u.__v);}});}function j$1(n,l,u,i,t,o,e,c){var a,v,h,y,p=u.props,d=l.props,_=l.type,k=0;if("svg"===_&&(t=!0),null!=o)for(;k<o.length;k++)if((a=o[k])&&(a===n||(_?a.localName==_:3==a.nodeType))){n=a,o[k]=null;break}if(null==n){if(null===_)return document.createTextNode(d);n=t?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),o=null,c=!1;}if(null===_)p===d||c&&n.data===d||(n.data=d);else {if(o=o&&f$2.slice.call(n.childNodes),v=(p=u.props||r$2).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!c){if(null!=o)for(p={},y=0;y<n.attributes.length;y++)p[n.attributes[y].name]=n.attributes[y].value;(h||v)&&(h&&(v&&h.__html==v.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""));}if(A$1(n,d,p,t,c),h)l.__k=[];else if(k=l.props.children,m$1(n,Array.isArray(k)?k:[k],l,u,i,t&&"foreignObject"!==_,o,e,n.firstChild,c),null!=o)for(k=o.length;k--;)null!=o[k]&&s$1(o[k]);c||("value"in d&&void 0!==(k=d.value)&&(k!==n.value||"progress"===_&&!k)&&C$1(n,"value",k,p.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==n.checked&&C$1(n,"checked",k,p.checked,!1));}return n}function z(l,u,i){try{"function"==typeof l?l(u):l.current=u;}catch(l){n$1.__e(l,i);}}function L$1(l,u,i){var t,o,r;if(n$1.unmount&&n$1.unmount(l),(t=l.ref)&&(t.current&&t.current!==l.__e||z(t,null,u)),i||"function"==typeof l.type||(i=null!=(o=l.__e)),l.__e=l.__d=void 0,null!=(t=l.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(l){n$1.__e(l,u);}t.base=t.__P=null;}if(t=l.__k)for(r=0;r<t.length;r++)t[r]&&L$1(t[r],u,i);null!=o&&s$1(o);}function M$1(n,l,u){return this.constructor(n,u)}function N(l,u,i){var t,o,e;n$1.__&&n$1.__(l,u),o=(t="function"==typeof i)?null:i&&i.__k||u.__k,e=[],I(u,l=(!t&&i||u).__k=a$2(y,null,[l]),o||r$2,r$2,void 0!==u.ownerSVGElement,!t&&i?[i]:o?null:u.firstChild?f$2.slice.call(u.childNodes):null,e,!t&&i?i:o?o.__e:u.firstChild,t),T(e,l);}n$1={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n},__v:0},p$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c$2({},this.state),"function"==typeof n&&(n=n(c$2({},u),this.props)),n&&c$2(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),k(this));},p$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),k(this));},p$1.prototype.render=y,u$1=[],i$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b$1.__r=0; + + var r$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,n=/[&<>"]/;function o(e){var t=String(e);return n.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t}var a$1=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},i$1=function(e,t,r){return String(e).length>(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},l={};function s(e){var t="";for(var n in e){var o=e[n];null!=o&&""!==o&&(t&&(t+=" "),t+="-"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),t+=": ",t+=o,"number"==typeof o&&!1===r$1.test(n)&&(t+="px"),t+=";");}return t||void 0}function f$1(e,t){for(var r in t)e[r]=t[r];return e}function u(e,t){return Array.isArray(t)?t.reduce(u,e):null!=t&&!1!==t&&e.push(t),e}var c$1={shallow:!0},p=[],_=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,v$1=/[\s\n\\/='"\0<>]/,d=function(){};m.render=m;var g$1=function(e,t){return m(e,t,c$1)},h=[];function m(t,r,n){r=r||{},n=n||{};var o=n$1.__s;n$1.__s=!0;var a=x$2(t,r,n);return n$1.__c&&n$1.__c(t,h),h.length=0,n$1.__s=o,a}function x$2(r,n,l,c,g,h){if(null==r||"boolean"==typeof r)return "";if("object"!=typeof r)return o(r);var m=l.pretty,y$1=m&&"string"==typeof m?m:"\t";if(Array.isArray(r)){for(var b="",S=0;S<r.length;S++)m&&S>0&&(b+="\n"),b+=x$2(r[S],n,l,c,g,h);return b}var w,k=r.type,O=r.props,C=!1;if("function"==typeof k){if(C=!0,!l.shallow||!c&&!1!==l.renderRootComponent){if(k===y){var A=[];return u(A,r.props.children),x$2(A,n,l,!1!==l.shallowHighOrder,g,h)}var H,j=r.__c={__v:r,context:n,props:r.props,setState:d,forceUpdate:d,__h:[]};if(n$1.__b&&n$1.__b(r),n$1.__r&&n$1.__r(r),k.prototype&&"function"==typeof k.prototype.render){var F=k.contextType,M=F&&n[F.__c],T=null!=F?M?M.props.value:F.__:n;(j=r.__c=new k(O,T)).__v=r,j._dirty=j.__d=!0,j.props=O,null==j.state&&(j.state={}),null==j._nextState&&null==j.__s&&(j._nextState=j.__s=j.state),j.context=T,k.getDerivedStateFromProps?j.state=f$1(f$1({},j.state),k.getDerivedStateFromProps(j.props,j.state)):j.componentWillMount&&(j.componentWillMount(),j.state=j._nextState!==j.state?j._nextState:j.__s!==j.state?j.__s:j.state),H=j.render(j.props,j.state,j.context);}else {var $=k.contextType,L=$&&n[$.__c];H=k.call(r.__c,O,null!=$?L?L.props.value:$.__:n);}return j.getChildContext&&(n=f$1(f$1({},n),j.getChildContext())),n$1.diffed&&n$1.diffed(r),x$2(H,n,l,!1!==l.shallowHighOrder,g,h)}k=(w=k).displayName||w!==Function&&w.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=p.length;n--;)if(p[n]===e){r=n;break}r<0&&(r=p.push(e)-1),t="UnnamedComponent"+r;}return t}(w);}var E,D,N="<"+k;if(O){var P=Object.keys(O);l&&!0===l.sortAttributes&&P.sort();for(var R=0;R<P.length;R++){var U=P[R],W=O[U];if("children"!==U){if(!v$1.test(U)&&(l&&l.allAttributes||"key"!==U&&"ref"!==U&&"__self"!==U&&"__source"!==U&&"defaultValue"!==U)){if("className"===U){if(O.class)continue;U="class";}else g&&U.match(/^xlink:?./)&&(U=U.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===U){if(O.for)continue;U="for";}"style"===U&&W&&"object"==typeof W&&(W=s(W)),"a"===U[0]&&"r"===U[1]&&"boolean"==typeof W&&(W=String(W));var q=l.attributeHook&&l.attributeHook(U,W,n,l,C);if(q||""===q)N+=q;else if("dangerouslySetInnerHTML"===U)D=W&&W.__html;else if("textarea"===k&&"value"===U)E=W;else if((W||0===W||""===W)&&"function"!=typeof W){if(!(!0!==W&&""!==W||(W=U,l&&l.xml))){N+=" "+U;continue}if("value"===U){if("select"===k){h=W;continue}"option"===k&&h==W&&(N+=" selected");}N+=" "+U+'="'+o(W)+'"';}}}else E=W;}}if(m){var z=N.replace(/\n\s*/," ");z===N||~z.indexOf("\n")?m&&~N.indexOf("\n")&&(N+="\n"):N=z;}if(N+=">",v$1.test(k))throw new Error(k+" is not a valid HTML tag name in "+N);var I,V=_.test(k)||l.voidElements&&l.voidElements.test(k),Z=[];if(D)m&&i$1(D)&&(D="\n"+y$1+a$1(D,y$1)),N+=D;else if(null!=E&&u(I=[],E).length){for(var B=m&&~N.indexOf("\n"),G=!1,J=0;J<I.length;J++){var K=I[J];if(null!=K&&!1!==K){var Q=x$2(K,n,l,!0,"svg"===k||"foreignObject"!==k&&g,h);if(m&&!B&&i$1(Q)&&(B=!0),Q)if(m){var X=Q.length>0&&"<"!=Q[0];G&&X?Z[Z.length-1]+=Q:Z.push(Q),G=X;}else Z.push(Q);}}if(m&&B)for(var Y=Z.length;Y--;)Z[Y]="\n"+y$1+a$1(Z[Y],y$1);}if(Z.length||D)N+=Z.join("");else if(l&&l.xml)return N.substring(0,N.length-1)+" />";return !V||I||D?(m&&~N.indexOf("\n")&&(N+="\n"),N+="</"+k+">"):N=N.replace(/>$/," />"),N}m.shallowRender=g$1; + + var r,i=[],c=n$1.__b,f=n$1.__r,e=n$1.diffed,a=n$1.__c,v=n$1.unmount;function x$1(){i.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g),t.__H.__h.forEach(j),t.__H.__h=[];}catch(u){t.__H.__h=[],n$1.__e(u,t.__v);}}),i=[];}n$1.__b=function(n){c&&c(n);},n$1.__r=function(n){f&&f(n);var r=(n.__c).__H;r&&(r.__h.forEach(g),r.__h.forEach(j),r.__h=[]);},n$1.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===n$1.requestAnimationFrame||((r=n$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1));},n$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g),t.__h=t.__h.filter(function(n){return !n.__||j(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n$1.__e(r,t.__v);}}),a&&a(t,u);},n$1.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g);}catch(t){n$1.__e(t,u.__v);}};var b="function"==typeof requestAnimationFrame;function g(n){"function"==typeof n.__c&&n.__c();}function j(n){n.__c=n.__();} + + function C(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}(E.prototype=new p$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=n$1.__b;n$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t,e){var r=C({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A=n$1.__e;n$1.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A(n,t,e);};var O=n$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function F(){this.u=null,this.o=null;}n$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new p$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a$2(y,null,n.fallback);return u&&(u.__h=null),[a$2(y,null,t.__e?null:n.children),u]};var M=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(F.prototype=new p$1).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M(t,n,r)):u();};e?e(o):o();}},F.prototype.render=function(n){this.u=null,this.o=new Map;var t=w$1(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F.prototype.componentDidUpdate=F.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};p$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p$1.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=n$1.event;function Z(){}function Y(){return this.cancelBubble}function $(){return this.defaultPrevented}n$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$,n.nativeEvent=n};var G={configurable:!0,get:function(){return this.class}},J=n$1.vnode;n$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w$1(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w$1(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n$1.__r;n$1.__r=function(n){K&&K(n);};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()}; + + function memoize(fn) { + var cache = {}; + return function (arg) { + if (cache[arg] === undefined) cache[arg] = fn(arg); + return cache[arg]; + }; + } + + var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 + + var index = memoize(function (prop) { + return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 + /* o */ + && prop.charCodeAt(1) === 110 + /* n */ + && prop.charCodeAt(2) < 91; + } + /* Z+1 */ + ); + + const cx = function cx() { + return Array.prototype.slice.call(arguments).filter(Boolean).join(' '); + }; + + var cx$1 = cx; + + /** + * This file contains an runtime version of `styled` component. Responsibilities of the component are: + * - returns ReactElement based on HTML tag used with `styled` or custom React Component + * - injects classNames for the returned component + * - injects CSS variables used to define dynamic styles based on props + */ + + // Workaround for rest operator + const restOp = (obj, keysToExclude) => Object.keys(obj).filter(prop => keysToExclude.indexOf(prop) === -1).reduce((acc, curr) => { + acc[curr] = obj[curr]; + return acc; + }, {}); // rest operator workaround + + + const warnIfInvalid = (value, componentName) => { + }; + + function styled(tag) { + return options => { + + const render = (props, ref) => { + const { + as: component = tag, + class: className + } = props; + const rest = restOp(props, ['as', 'class']); + let filteredProps; // Check if it's an HTML tag and not a custom element + + if (typeof component === 'string' && component.indexOf('-') === -1) { + filteredProps = {}; // eslint-disable-next-line guard-for-in + + for (const key in rest) { + if (key === 'as' || index(key)) { + // Don't pass through invalid attributes to HTML elements + filteredProps[key] = rest[key]; + } + } + } else { + filteredProps = rest; + } + + filteredProps.ref = ref; + filteredProps.className = cx$1(filteredProps.className || className, options.class); + const { + vars + } = options; + + if (vars) { + const style = {}; // eslint-disable-next-line guard-for-in + + for (const name in vars) { + const variable = vars[name]; + const result = variable[0]; + const unit = variable[1] || ''; + const value = typeof result === 'function' ? result(props) : result; + warnIfInvalid(value, options.name); + style[`--${name}`] = `${value}${unit}`; + } + + const ownStyle = filteredProps.style || {}; + const keys = Object.keys(ownStyle); + + if (keys.length > 0) { + keys.forEach(key => { + style[key] = ownStyle[key]; + }); + } + + filteredProps.style = style; + } + + if (tag.__linaria && tag !== component) { + // If the underlying tag is a styled component, forward the `as` prop + // Otherwise the styles from the underlying component will be ignored + filteredProps.as = component; + return /*#__PURE__*/a$2(tag, filteredProps); + } + + return /*#__PURE__*/a$2(component, filteredProps); + }; + + const Result = x ? /*#__PURE__*/x(render) : // React.forwardRef won't available on older React versions and in Preact + // Fallback to a innerRef prop in that case + props => { + const rest = restOp(props, ['innerRef']); + return render(rest, props.innerRef); + }; + Result.displayName = options.name; // These properties will be read by the babel plugin for interpolation + + Result.__linaria = { + className: options.class, + extends: tag + }; + return Result; + }; + } + + var styled$1 = styled; + + /* + This file is part of GNU Taler + (C) 2021 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + const FooterBar = /*#__PURE__*/styled$1("footer")({ + name: "FooterBar", + class: "fef0x5t" + }); + const Page = /*#__PURE__*/styled$1("div")({ + name: "Page", + class: "p1b3vqup" + }); + const InfoBox = /*#__PURE__*/styled$1("div")({ + name: "InfoBox", + class: "i1pkgksb" + }); + const TableExpanded = /*#__PURE__*/styled$1("dl")({ + name: "TableExpanded", + class: "t2c81u8" + }); + const TableSimple = /*#__PURE__*/styled$1("dl")({ + name: "TableSimple", + class: "t1mav7fx" + }); + + /* + This file is part of GNU Taler + (C) 2021 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + function Footer() { + return a$2(FooterBar, null, + a$2("p", null, + a$2("a", { href: "https://taler.net/" }, "Learn more about GNU Taler on our website."), + a$2("p", null, "Copyright \u00A9 2014\u20142021 Taler Systems SA"))); + } /* This file is part of GNU Taler @@ -3449,67 +4640,290 @@ a.pure-button-selected { GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ function Head({ order_summary }) { - return a$1(y, null, - a$1("meta", { charSet: "UTF-8" }), - a$1("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), - a$1("noscript", null, - a$1("meta", { "http-equiv": "refresh", content: "1" })), - a$1("title", null, + return a$2(y, null, + a$2("meta", { charSet: "UTF-8" }), + a$2("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), + a$2("noscript", null, + a$2("meta", { "http-equiv": "refresh", content: "1" })), + a$2("title", null, "Status of your order for ", - order_summary ? order_summary : `{{ order_summary }}`)); - } - function ShowOrderDetails({ order_summary, refund_amount, contract_terms }) { - var _a; - const pay_deadline = (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline.t_ms) === 'never' || (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline.t_ms) === undefined ? undefined : - format(new Date(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline.t_ms), 'dd/MM/yyyy HH:mm:ss'); - return a$1(y, null, - a$1("h1", null, "Order details"), - a$1("div", null, - "This is the default status page for your order for ", - a$1("b", null, order_summary ? order_summary : `{{ order_summary }}`), - "."), - a$1("h2", null, "Refund status"), - a$1("div", null, - "The merchant has granted you refunds on the purchase of ", - a$1("b", null, refund_amount ? refund_amount : `{{ refund_amount }}`), - "."), - a$1("h2", null, "Full contract details"), - a$1("pre", null, - a$1("table", null, - a$1("tr", null, - a$1("td", null, "amount"), - a$1("td", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.amount) || `{{ contract_terms.amount }}`)), - a$1("tr", null, - a$1("td", null, "summary"), - a$1("td", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.summary) || `{{ contract_terms.summary }}`)), - a$1("tr", null, - a$1("td", null, "pay deadline"), - a$1("td", null, pay_deadline || `{{ contract_terms.pay_deadline.t_ms }}`)), - a$1("tr", null, - a$1("td", null, "merchant name"), - a$1("td", null, ((_a = contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant) === null || _a === void 0 ? void 0 : _a.name) || `{{ contract_terms.merchant.name }}`))), - a$1("div", null, `{{{contract_terms!stringify }}}`))); + order_summary ? order_summary : `{{ order_summary }}`), + a$2("script", null, ` + var contractTermsStr = '{{{contract_terms_json}}}'; + `)); + } + function Location({ templateName, location, btr }) { + //FIXME: mustache strings show be constructed in a way that ends in the final output of the html but is not present in the + // javascript code, otherwise when mustache render engine run over the html it will also replace string in the javascript code + // that is made to run when the browser has javascript enable leading into undefined behavior. + // that's why in the next fields we are using concatenations to build the mustache placeholder. + return a$2(y, null, + btr && `{{` + `#${templateName}.building_name}}`, + a$2("dd", null, + (location === null || location === void 0 ? void 0 : location.building_name) || (btr && `{{ ${templateName}.building_name }}`), + " ", + (location === null || location === void 0 ? void 0 : location.building_number) || (btr && `{{ ${templateName}.building_number }}`)), + btr && `{{` + `/${templateName}.building_name}}`, + btr && `{{` + `#${templateName}.country}}`, + a$2("dd", null, + (location === null || location === void 0 ? void 0 : location.country) || (btr && `{{ ${templateName}.country }}`), + " ", + (location === null || location === void 0 ? void 0 : location.country_subdivision) || (btr && `{{ ${templateName}.country_subdivision }}`)), + btr && `{{` + `/${templateName}.country}}`, + btr && `{{` + `#${templateName}.district}}`, + a$2("dd", null, (location === null || location === void 0 ? void 0 : location.district) || (btr && `{{ ${templateName}.district }}`)), + btr && `{{` + `/${templateName}.district}}`, + btr && `{{` + `#${templateName}.post_code}}`, + a$2("dd", null, (location === null || location === void 0 ? void 0 : location.post_code) || (btr && `{{ ${templateName}.post_code }}`)), + btr && `{{` + `/${templateName}.post_code}}`, + btr && `{{` + `#${templateName}.street}}`, + a$2("dd", null, (location === null || location === void 0 ? void 0 : location.street) || (btr && `{{ ${templateName}.street }}`)), + btr && `{{` + `/${templateName}.street}}`, + btr && `{{` + `#${templateName}.town}}`, + a$2("dd", null, (location === null || location === void 0 ? void 0 : location.town) || (btr && `{{ ${templateName}.town }}`)), + btr && `{{` + `/${templateName}.town}}`, + btr && `{{` + `#${templateName}.town_location}}`, + a$2("dd", null, (location === null || location === void 0 ? void 0 : location.town_location) || (btr && `{{ ${templateName}.town_location }}`)), + btr && `{{` + `/${templateName}.town_location}}`); + } + function ShowOrderDetails({ order_summary, refund_amount, contract_terms, btr }) { + const productList = (btr ? [{}] : ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.products) || [])); + const auditorsList = (btr ? [{}] : ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.auditors) || [])); + const exchangesList = (btr ? [{}] : ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.exchanges) || [])); + const hasDeliveryInfo = btr || !!(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_date) || !!(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_location); + return a$2(Page, null, + a$2("header", null, + a$2("h1", null, + "Details of order ", + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.order_id) || `{{ contract_terms.order_id }}`)), + a$2("section", null, + btr && `{{#refund_amount}}`, + (btr || refund_amount) && a$2("section", null, + a$2(InfoBox, null, + a$2("b", null, "Refunded:"), + " The merchant refunded you ", + a$2("b", null, refund_amount || `{{ refund_amount }}`), + ".")), + btr && `{{/refund_amount}}`, + a$2("section", null, + a$2(TableExpanded, null, + a$2("dt", null, "Order summary:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.summary) || `{{ contract_terms.summary }}`), + a$2("dt", null, "Amount paid:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.amount) || `{{ contract_terms.amount }}`), + a$2("dt", null, "Order date:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.timestamp) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.timestamp.t_ms) != 'never' ? + format(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.timestamp.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ contract_terms.timestamp_str }}`, + " "), + a$2("dt", null, "Merchant name:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant.name) || `{{ contract_terms.merchant.name }}`))), + btr && `{{#contract_terms.hasProducts}}`, + !productList.length ? null : a$2("section", null, + a$2("h2", null, "Products purchased"), + a$2(TableSimple, null, + btr && '{{' + '#contract_terms.products' + '}}', + productList.map((p, i) => { + const taxList = (btr ? [{}] : (p.taxes || [])); + return a$2(y, { key: i }, + a$2("p", null, p.description || `{{description}}`), + a$2("dl", null, + a$2("dt", null, "Quantity:"), + a$2("dd", null, p.quantity || `{{quantity}}`), + a$2("dt", null, "Price:"), + a$2("dd", null, p.price || `{{price}}`), + btr && `{{#hasTaxes}}`, + !taxList.length ? null : a$2(y, null, + btr && '{{' + '#taxes' + '}}', + taxList.map((t, i) => { + return a$2(y, { key: i }, + a$2("dt", null, t.name || `{{name}}`), + a$2("dd", null, t.tax || `{{tax}}`)); + }), + btr && '{{' + '/taxes' + '}}'), + btr && `{{/hasTaxes}}`, + btr && `{{#delivery_date}}`, + (btr || p.delivery_date) && a$2(y, null, + a$2("dt", null, "Delivered on:"), + a$2("dd", null, + p.delivery_date ? + (p.delivery_date.t_ms != 'never' ? + format(p.delivery_date.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ delivery_date_str }}`, + " ")), + btr && `{{/delivery_date}}`, + btr && `{{#unit}}`, + (btr || p.unit) && a$2(y, null, + a$2("dt", null, "Product unit:"), + a$2("dd", null, p.unit || `{{.}}`)), + btr && `{{/unit}}`, + btr && `{{#product_id}}`, + (btr || p.product_id) && a$2(y, null, + a$2("dt", null, "Product ID:"), + a$2("dd", null, p.product_id || `{{.}}`)), + btr && `{{/product_id}}`)); + }), + btr && '{{' + '/contract_terms.products' + '}}')), + btr && `{{/contract_terms.hasProducts}}`, + btr && `{{#contract_terms.has_delivery_info}}`, + !hasDeliveryInfo ? null : a$2("section", null, + a$2("h2", null, "Delivery information"), + a$2(TableExpanded, null, + btr && `{{#contract_terms.delivery_date}}`, + (btr || (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_date)) && a$2(y, null, + a$2("dt", null, "Delivery date:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_date) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_date.t_ms) != 'never' ? + format(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_date.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ contract_terms.delivery_date_str }}`, + " ")), + btr && `{{/contract_terms.delivery_date}}`, + btr && `{{#contract_terms.delivery_location}}`, + (btr || (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_location)) && a$2(y, null, + a$2("dt", null, "Delivery address:"), + a$2(Location, { btr: btr, location: contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.delivery_location, templateName: "contract_terms.delivery_location" })), + btr && `{{/contract_terms.delivery_location}}`)), + btr && `{{/contract_terms.has_delivery_info}}`, + a$2("section", null, + a$2("h2", null, "Full payment information"), + a$2(TableExpanded, null, + a$2("dt", null, "Amount paid:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.amount) || `{{ contract_terms.amount }}`), + a$2("dt", null, "Wire transfer method:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.wire_method) || `{{ contract_terms.wire_method }}`), + a$2("dt", null, "Payment deadline:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline.t_ms) != 'never' ? + format(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.pay_deadline.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ contract_terms.pay_deadline_str }}`, + " "), + a$2("dt", null, "Exchange transfer deadline:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.wire_transfer_deadline) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.wire_transfer_deadline.t_ms) != 'never' ? + format(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.wire_transfer_deadline.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ contract_terms.wire_transfer_deadline_str }}`, + " "), + a$2("dt", null, "Maximum deposit fee:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.max_fee) || `{{ contract_terms.max_fee }}`), + a$2("dt", null, "Maximum wire fee:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.max_wire_fee) || `{{ contract_terms.max_wire_fee }}`), + a$2("dt", null, "Wire fee amortization:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.wire_fee_amortization) || `{{ contract_terms.wire_fee_amortization }}`, + " transactions"))), + a$2("section", null, + a$2("h2", null, "Refund information"), + a$2(TableExpanded, null, + a$2("dt", null, "Refund deadline:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.refund_deadline) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.refund_deadline.t_ms) != 'never' ? + format(contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.refund_deadline.t_ms, 'dd MMM yyyy HH:mm:ss') : + 'never') + : `{{ contract_terms.refund_deadline_str }}`, + " "), + btr && `{{#contract_terms.auto_refund}}`, + (btr || (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.auto_refund)) && a$2(y, null, + a$2("dt", null, "Attempt autorefund for:"), + a$2("dd", null, + (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.auto_refund) ? + ((contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.auto_refund.d_ms) != 'forever' ? + formatDuration(intervalToDuration({ start: 0, end: contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.auto_refund.d_ms })) : + 'forever') + : `{{ contract_terms.auto_refund_str }}`, + " ")), + btr && `{{/contract_terms.auto_refund}}`)), + a$2("section", null, + a$2("h2", null, "Additional order details"), + a$2(TableExpanded, null, + a$2("dt", null, "Public reorder URL:"), + a$2("dd", null, " -- not defined yet -- "), + btr && `{{#contract_terms.fulfillment_url}}`, + (btr || (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.fulfillment_url)) && a$2(y, null, + a$2("dt", null, "Fulfillment URL:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.fulfillment_url) || (btr && `{{ contract_terms.fulfillment_url }}`))), + btr && `{{/contract_terms.fulfillment_url}}`)), + a$2("section", null, + a$2("h2", null, "Full merchant information"), + a$2(TableExpanded, null, + a$2("dt", null, "Merchant name:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant.name) || `{{ contract_terms.merchant.name }}`), + a$2("dt", null, "Merchant address:"), + a$2(Location, { btr: btr, location: contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant.address, templateName: "contract_terms.merchant.address" }), + a$2("dt", null, "Merchant's jurisdiction:"), + a$2(Location, { btr: btr, location: contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant.jurisdiction, templateName: "contract_terms.merchant.jurisdiction" }), + a$2("dt", null, "Merchant URI:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant_base_url) || `{{ contract_terms.merchant_base_url }}`), + a$2("dt", null, "Merchant's public key:"), + a$2("dd", null, (contract_terms === null || contract_terms === void 0 ? void 0 : contract_terms.merchant_pub) || `{{ contract_terms.merchant_pub }}`))), + btr && `{{#contract_terms.hasAuditors}}`, + !auditorsList.length ? null : a$2("section", null, + a$2("h2", null, "Auditors accepted by the merchant"), + a$2(TableExpanded, null, + btr && '{{' + '#contract_terms.auditors' + '}}', + auditorsList.map((p, i) => { + return a$2(y, { key: i }, + a$2("p", null, p.name || `{{name}}`), + a$2("dt", null, "Auditor's public key:"), + a$2("dd", null, p.auditor_pub || `{{auditor_pub}}`), + a$2("dt", null, "Auditor's URL:"), + a$2("dd", null, p.url || `{{url}}`)); + }), + btr && '{{' + '/contract_terms.auditors' + '}}')), + btr && `{{/contract_terms.hasAuditors}}`, + btr && `{{#contract_terms.hasExchanges}}`, + !exchangesList.length ? null : a$2("section", null, + a$2("h2", null, "Exchanges accepted by the merchant"), + a$2(TableExpanded, null, + btr && '{{' + '#contract_terms.exchanges' + '}}', + exchangesList.map((p, i) => { + return a$2(y, { key: i }, + a$2("dt", null, "Exchange's URL:"), + a$2("dd", null, p.url || `{{url}}`), + a$2("dt", null, "Public key:"), + a$2("dd", null, p.master_pub || `{{master_pub}}`)); + }), + btr && '{{' + '/contract_terms.exchanges' + '}}')), + btr && `{{/contract_terms.hasExchanges}}`), + a$2(Footer, null)); } function mount() { try { const fromLocation = new URL(window.location.href).searchParams; const os = fromLocation.get('order_summary') || undefined; if (os) { - N(a$1(Head, { order_summary: os }), document.head); + N(a$2(Head, { order_summary: os }), document.head); } const ra = fromLocation.get('refund_amount') || undefined; const ct = fromLocation.get('contract_terms') || undefined; - N(a$1(ShowOrderDetails, { order_summary: os, refund_amount: ra }), document.body); + let contractTerms; + try { + contractTerms = JSON.parse(window.contractTermsStr); + } + catch (_a) { } + N(a$2(ShowOrderDetails, { contract_terms: contractTerms, order_summary: os, refund_amount: ra }), document.body); } catch (e) { console.error("got error", e); - document.body.innerText = `Fatal error: "${e.message}". Please report this bug at https://bugs.gnunet.org/.`; + if (e instanceof Error) { + document.body.innerText = `Fatal error: "${e.message}". Please report this bug at https://bugs.gnunet.org/.`; + } } } function buildTimeRendering() { return { - head: m(a$1(Head, null)), - body: m(a$1(ShowOrderDetails, null)) + head: m(a$2(Head, null)), + body: m(a$2(ShowOrderDetails, { btr: true })) }; } |