diff --git a/README.md b/README.md index 79f55092..aee4b408 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ If you are looking for a complete solution with firmware and cloud components, c - plain TCP, plain UDP, SSL/TLS (over TCP, one-way or two-way) - HTTP client, HTTP server - WebSocket client, WebSocket server - - JSON-RPC client, JSON-RPC server - MQTT client, MQTT broker - CoAP client, CoAP server - DNS client, DNS server, async DNS resolver diff --git a/docs/build-options/disabling-flags.md b/docs/build-options/disabling-flags.md index c88e25b8..cdb9af2c 100644 --- a/docs/build-options/disabling-flags.md +++ b/docs/build-options/disabling-flags.md @@ -7,6 +7,5 @@ title: Disabling flags - `MG_DISABLE_MQTT` disable MQTT support - `MG_DISABLE_SHA1` disable SHA1 support (used by Websocket) - `MG_DISABLE_MD5` disable MD5 support (used by HTTP auth) -- `MG_DISABLE_JSON_RPC` disable JSON-RPC support - `MG_DISABLE_SOCKETPAIR` disable `mg_broadcast()` API - `MG_DISABLE_HTTP_KEEP_ALIVE` useful for embedded systems to save resources diff --git a/docs/build-options/intro.md b/docs/build-options/intro.md index 5af9ff7a..871ea64e 100644 --- a/docs/build-options/intro.md +++ b/docs/build-options/intro.md @@ -14,9 +14,9 @@ flags. Also, some preprocessor flags can be used to tune internal Mongoose parameters. To set a preprocessor flag during compile time, use `-D ` -compiler option. For example, to disable both MQTT and JSON-RPC, +compiler option. For example, to disable both MQTT and COAP, compile the application `my_app.c` like this (assumed UNIX system): ``` - $ cc my_app.c mongoose.c -D MG_DISABLE_MQTT -D MG_DISABLE_JSON_RPC + $ cc my_app.c mongoose.c -D MG_DISABLE_MQTT -D MG_DISABLE_COAP ``` diff --git a/docs/c-api/intro.md b/docs/c-api/intro.md index cadbb453..342101e1 100644 --- a/docs/c-api/intro.md +++ b/docs/c-api/intro.md @@ -3,7 +3,6 @@ items: - { type: dir, name: mbuf.h } - { type: dir, name: net.h } - { type: dir, name: http.h } - - { type: dir, name: json-rpc.h } - { type: dir, name: dns.h } - { type: dir, name: dns-server.h } - { type: dir, name: mqtt.h } diff --git a/docs/c-api/json-rpc.h/intro.md b/docs/c-api/json-rpc.h/intro.md deleted file mode 100644 index 6cd9a81f..00000000 --- a/docs/c-api/json-rpc.h/intro.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "JSON-RPC" -symbol_kind: "intro" -decl_name: "json-rpc.h" -items: - - { type: file, name: mg_rpc_parse_reply.md } - - { type: file, name: mg_rpc_create_request.md } - - { type: file, name: mg_rpc_create_reply.md } - - { type: file, name: mg_rpc_create_error.md } - - { type: file, name: mg_rpc_create_std_error.md } - - { type: file, name: mg_rpc_dispatch.md } - - { type: file, name: struct_mg_rpc_request.md } - - { type: file, name: struct_mg_rpc_reply.md } - - { type: file, name: struct_mg_rpc_error.md } ---- - - - diff --git a/docs/c-api/json-rpc.h/mg_rpc_create_error.md b/docs/c-api/json-rpc.h/mg_rpc_create_error.md deleted file mode 100644 index b6910e02..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_create_error.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "mg_rpc_create_error()" -decl_name: "mg_rpc_create_error" -symbol_kind: "func" -signature: | - int mg_rpc_create_error(char *buf, int len, struct mg_rpc_request *req, - int code, const char *message, const char *fmt, ...); ---- - -Create JSON-RPC error reply in a given buffer. - -Return length of the error, which -can be larger then `len` that indicates an overflow. -`fmt` format string should conform to `json_emit()` API, -see https://github.com/cesanta/frozen - diff --git a/docs/c-api/json-rpc.h/mg_rpc_create_reply.md b/docs/c-api/json-rpc.h/mg_rpc_create_reply.md deleted file mode 100644 index 58a37365..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_create_reply.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "mg_rpc_create_reply()" -decl_name: "mg_rpc_create_reply" -symbol_kind: "func" -signature: | - int mg_rpc_create_reply(char *buf, int len, const struct mg_rpc_request *req, - const char *result_fmt, ...); ---- - -Create JSON-RPC reply in a given buffer. - -Return length of the reply, which -can be larger then `len` that indicates an overflow. -`result_fmt` format string should conform to `json_emit()` API, -see https://github.com/cesanta/frozen - diff --git a/docs/c-api/json-rpc.h/mg_rpc_create_request.md b/docs/c-api/json-rpc.h/mg_rpc_create_request.md deleted file mode 100644 index 28c83e40..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_create_request.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "mg_rpc_create_request()" -decl_name: "mg_rpc_create_request" -symbol_kind: "func" -signature: | - int mg_rpc_create_request(char *buf, int len, const char *method, - const char *id, const char *params_fmt, ...); ---- - -Create JSON-RPC request in a given buffer. - -Return length of the request, which -can be larger then `len` that indicates an overflow. -`params_fmt` format string should conform to `json_emit()` API, -see https://github.com/cesanta/frozen - diff --git a/docs/c-api/json-rpc.h/mg_rpc_create_std_error.md b/docs/c-api/json-rpc.h/mg_rpc_create_std_error.md deleted file mode 100644 index b682431c..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_create_std_error.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "mg_rpc_create_std_error()" -decl_name: "mg_rpc_create_std_error" -symbol_kind: "func" -signature: | - int mg_rpc_create_std_error(char *buf, int len, struct mg_rpc_request *req, - int code); ---- - -Create JSON-RPC error in a given buffer. - -Return length of the error, which -can be larger then `len` that indicates an overflow. See -JSON_RPC_*_ERROR definitions for standard error values: - -- `#define JSON_RPC_PARSE_ERROR (-32700)` -- `#define JSON_RPC_INVALID_REQUEST_ERROR (-32600)` -- `#define JSON_RPC_METHOD_NOT_FOUND_ERROR (-32601)` -- `#define JSON_RPC_INVALID_PARAMS_ERROR (-32602)` -- `#define JSON_RPC_INTERNAL_ERROR (-32603)` -- `#define JSON_RPC_SERVER_ERROR (-32000)` - diff --git a/docs/c-api/json-rpc.h/mg_rpc_dispatch.md b/docs/c-api/json-rpc.h/mg_rpc_dispatch.md deleted file mode 100644 index d58f5026..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_dispatch.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "mg_rpc_dispatch()" -decl_name: "mg_rpc_dispatch" -symbol_kind: "func" -signature: | - int mg_rpc_dispatch(const char *buf, int, char *dst, int dst_len, - const char **methods, mg_rpc_handler_t *handlers); ---- - -Dispatches a JSON-RPC request. - -Parses JSON-RPC request contained in `buf`, `len`. -Then, dispatches the request to the correct handler method. -Valid method names should be specified in NULL -terminated array `methods`, and corresponding handlers in `handlers`. -Result is put in `dst`, `dst_len`. Return: length of the result, which -can be larger then `dst_len` that indicates an overflow. -Overflown bytes are not written to the buffer. -If method is not found, an error is automatically generated. - diff --git a/docs/c-api/json-rpc.h/mg_rpc_parse_reply.md b/docs/c-api/json-rpc.h/mg_rpc_parse_reply.md deleted file mode 100644 index 36fad920..00000000 --- a/docs/c-api/json-rpc.h/mg_rpc_parse_reply.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "mg_rpc_parse_reply()" -decl_name: "mg_rpc_parse_reply" -symbol_kind: "func" -signature: | - int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks, - int max_toks, struct mg_rpc_reply *, - struct mg_rpc_error *); ---- - -Parse JSON-RPC reply contained in `buf`, `len` into JSON tokens array -`toks`, `max_toks`. If buffer contains valid reply, `reply` structure is -populated. The result of RPC call is located in `reply.result`. On error, -`error` structure is populated. Returns: the result of calling -`parse_json(buf, len, toks, max_toks)`: - -On success, an offset inside `json_string` is returned -where parsing has finished. On failure, a negative number is -returned, one of: - -- `#define JSON_STRING_INVALID -1` -- `#define JSON_STRING_INCOMPLETE -2` -- `#define JSON_TOKEN_ARRAY_TOO_SMALL -3` - diff --git a/docs/c-api/json-rpc.h/struct_mg_rpc_error.md b/docs/c-api/json-rpc.h/struct_mg_rpc_error.md deleted file mode 100644 index b2bff13b..00000000 --- a/docs/c-api/json-rpc.h/struct_mg_rpc_error.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "struct mg_rpc_error" -decl_name: "struct mg_rpc_error" -symbol_kind: "struct" -signature: | - struct mg_rpc_error { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *error_code; /* error.code */ - struct json_token *error_message; /* error.message */ - struct json_token *error_data; /* error.data, can be NULL */ - }; ---- - -JSON-RPC error - diff --git a/docs/c-api/json-rpc.h/struct_mg_rpc_reply.md b/docs/c-api/json-rpc.h/struct_mg_rpc_reply.md deleted file mode 100644 index fd606026..00000000 --- a/docs/c-api/json-rpc.h/struct_mg_rpc_reply.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "struct mg_rpc_reply" -decl_name: "struct mg_rpc_reply" -symbol_kind: "struct" -signature: | - struct mg_rpc_reply { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *result; /* Remote call result */ - }; ---- - -JSON-RPC response - diff --git a/docs/c-api/json-rpc.h/struct_mg_rpc_request.md b/docs/c-api/json-rpc.h/struct_mg_rpc_request.md deleted file mode 100644 index fc0bb8ae..00000000 --- a/docs/c-api/json-rpc.h/struct_mg_rpc_request.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "struct mg_rpc_request" -decl_name: "struct mg_rpc_request" -symbol_kind: "struct" -signature: | - struct mg_rpc_request { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *method; /* Method name */ - struct json_token *params; /* Method params */ - }; ---- - -JSON-RPC request - diff --git a/docs/overview.md b/docs/overview.md index 76901594..55821ae7 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -4,7 +4,7 @@ title: Overview Mongoose is a swiss army knife for embedded network programming. It implements event-driven non-blocking API for TCP, UDP, HTTP, -WebSocket, CoAP, MQTT, JSON-RPC for both client and server mode. +WebSocket, CoAP, MQTT for both client and server mode. Features include: - Cross-platform: works on Linux/UNIX, MacOS, QNX, eCos, Windows, Android, @@ -16,7 +16,6 @@ Features include: - plain TCP, plain UDP, SSL/TLS (over TCP, one-way or two-way) - HTTP client and server - WebSocket client and server - - JSON-RPC client and server - MQTT client and server - CoAP client and server - DNS client and server diff --git a/examples/CC3200/data.c b/examples/CC3200/data.c index 978186d7..8407eff8 100644 --- a/examples/CC3200/data.c +++ b/examples/CC3200/data.c @@ -95,27 +95,19 @@ static double send_acc_data_since(struct mg_connection *nc, static void process_command(struct mg_connection *nc, unsigned char *data, size_t len) { - struct json_token *toks = parse_json2((const char *) data, len); - if (toks == NULL) { + // TODO(lsm): use proper JSON parser + int cmd, n, val; + double t; + if (sscanf((char *) data, "{\t\": %d, \"ts\": %lf, %n", &cmd, &t, &n) != 2) { LOG(LL_ERROR, ("Invalid command: %.*s", (int) len, data)); return; } - struct json_token *t = find_json_token(toks, "t"); - if (t == NULL) { - LOG(LL_ERROR, ("Missing type field: %.*s", (int) len, data)); - goto out_free; - } - if (t->len == 1 && *t->ptr == '1') { - struct json_token *v = find_json_token(toks, "v"); - if (v == NULL) { + if (t == 1) { + if (sscanf((char *) data + n, "\"v\": %d", &val) != 1) { LOG(LL_ERROR, ("Missing value: %.*s", (int) len, data)); - goto out_free; + return; } - if (v->len != 1) { - LOG(LL_ERROR, ("Invalid value: %.*s", (int) len, data)); - goto out_free; - } - switch (*v->ptr) { + switch (val) { case '0': { GPIO_IF_LedOff(MCU_RED_LED_GPIO); break; @@ -130,15 +122,13 @@ static void process_command(struct mg_connection *nc, unsigned char *data, } default: { LOG(LL_ERROR, ("Invalid value: %.*s", (int) len, data)); - goto out_free; + return; } } } else { - LOG(LL_ERROR, ("Unknown command: %.*s", (int) t->len, t->ptr)); - goto out_free; + LOG(LL_ERROR, ("Unknown command: %.*s", (int) len, data)); + return; } -out_free: - free(toks); } void data_conn_handler(struct mg_connection *nc, int ev, void *ev_data) { diff --git a/examples/json_rpc_server/Makefile b/examples/json_rpc_server/Makefile deleted file mode 100644 index 5ba40971..00000000 --- a/examples/json_rpc_server/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -PROG = json_rpc_server -include ../examples.mk diff --git a/examples/json_rpc_server/json_rpc_server.c b/examples/json_rpc_server/json_rpc_server.c deleted file mode 100644 index 81e43801..00000000 --- a/examples/json_rpc_server/json_rpc_server.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - * - * To test this server, do - * $ curl -d '{"id":1,method:"sum",params:[22,33]}' 127.0.0.1:8000 - */ - -#include "mongoose.h" - -static const char *s_http_port = "8000"; - -static int rpc_sum(char *buf, int len, struct mg_rpc_request *req) { - double sum = 0; - int i; - - if (req->params[0].type != JSON_TYPE_ARRAY) { - return mg_rpc_create_std_error(buf, len, req, - JSON_RPC_INVALID_PARAMS_ERROR); - } - - for (i = 0; i < req->params[0].num_desc; i++) { - if (req->params[i + 1].type != JSON_TYPE_NUMBER) { - return mg_rpc_create_std_error(buf, len, req, - JSON_RPC_INVALID_PARAMS_ERROR); - } - sum += strtod(req->params[i + 1].ptr, NULL); - } - return mg_rpc_create_reply(buf, len, req, "f", sum); -} - -static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) { - struct http_message *hm = (struct http_message *) ev_data; - static const char *methods[] = {"sum", NULL}; - static mg_rpc_handler_t handlers[] = {rpc_sum, NULL}; - char buf[100]; - - switch (ev) { - case MG_EV_HTTP_REQUEST: - mg_rpc_dispatch(hm->body.p, hm->body.len, buf, sizeof(buf), methods, - handlers); - mg_printf(nc, - "HTTP/1.0 200 OK\r\nContent-Length: %d\r\n" - "Content-Type: application/json\r\n\r\n%s", - (int) strlen(buf), buf); - nc->flags |= MG_F_SEND_AND_CLOSE; - break; - default: - break; - } -} - -int main(void) { - struct mg_mgr mgr; - struct mg_connection *nc; - - mg_mgr_init(&mgr, NULL); - nc = mg_bind(&mgr, s_http_port, ev_handler); - mg_set_protocol_http_websocket(nc); - - printf("Starting JSON-RPC server on port %s\n", s_http_port); - for (;;) { - mg_mgr_poll(&mgr, 1000); - } - mg_mgr_free(&mgr); - - return 0; -} diff --git a/examples/raspberry_pi_mjpeg_led/Makefile b/examples/raspberry_pi_mjpeg_led/Makefile deleted file mode 100644 index 31ed1a44..00000000 --- a/examples/raspberry_pi_mjpeg_led/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -NS=../../mongoose.c -FLAGS = ../../mongoose.c -I../.. -CFLAGS=-W -Wall -DMG_ENABLE_THREADS -pthread $(CFLAGS_EXTRA) -PROGS = device_side cloud_side - -all: $(PROGS) - -device_side: Makefile device_side.c $(NS) - $(CC) device_side.c $(FLAGS) -o $@ $(CFLAGS) - -cloud_side: Makefile cloud_side.c $(NS) - $(CC) cloud_side.c $(FLAGS) -o $@ $(CFLAGS) - -device_side.exe: Makefile device_side.c $(NS) - cl device_side.c $(FLAGS) /MD /Fe$@ - -clean: - rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROGS) diff --git a/examples/raspberry_pi_mjpeg_led/README.adoc b/examples/raspberry_pi_mjpeg_led/README.adoc deleted file mode 100644 index 007ef698..00000000 --- a/examples/raspberry_pi_mjpeg_led/README.adoc +++ /dev/null @@ -1,72 +0,0 @@ -= Raspberry Pi camera/LED demo - -== Overview - -The link:/[demo] consists of web app providing access to a webcam and a LED attached to a RaspberryPi. -The device is assumed to have a limited bandwidth towards the server hosting the web app. - -== Objective - -The demo shows how to use websockets to communicate bidirectionally with an embedded device using standard protocols. - -It also shows that it's possible to use Smart.c to develop also the cloud endpoint and expose WebSocket and RESTful APIs -easy to integreate with modern web stacks. - -== How it works - -image::docs/arch.png[] - -There are two components, once with runs on the device (`device_side`) and one that runs on a stronger machine -and with more bandwidth (`cloud_side`). - -The device app connects to the cloud app via websocket and sends a new jpeg frame as fast as the underlying `raspistill` camera -grabbing application can handle. The device automatically attempts reconnecting. - -The cloud side serves the webapp static pages and serves an MPJEG image on `/mpjg`. -The MPJEG image handler blocks all the clients until a JPEG frame arrives via websocket -and then every client will receive a copy of the frame. - -The web app can turn on and off the LED via a RESTful api accessible via the `/api` handler. - -== Installation - -=== Server side - ----- -git clone https://github.com/cesanta/mongoose -cd mongoose/examples/web_demo -make cloud_side && ./cloud_side 0.0.0.0:8080 ----- - -=== Raspberry Pi - -The instructions provided here are tailored for the Raspbian distribution. - -==== Dependencies - -jpegoptim:: -apt-get install jpegoptim - -camera:: -run raspi-config and enable camera - -==== LED - -In order to access the led on your link:http://www.qdh.org.uk/wordpress/?page_id=15[HotPi] -board you need to export the gpio pins: - ----- -for i in 22 23 24; do - echo $i >/sys/class/gpio/export - echo out >/sys/class/gpio/gpio$i/direction - chgrp pi /sys/class/gpio/gpio$i/value -done ----- - -==== Build and run - ----- -git clone https://github.com/cesanta/mongoose -cd mongoose/examples/web_demo -make device_side && ./device_side yourserver:8080 ----- diff --git a/examples/raspberry_pi_mjpeg_led/cloud_side.c b/examples/raspberry_pi_mjpeg_led/cloud_side.c deleted file mode 100644 index 92c28ba5..00000000 --- a/examples/raspberry_pi_mjpeg_led/cloud_side.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ - -/* - * This is the cloud endpoint of the Raspberry Pi camera/LED example - * of the Mongoose networking library. - * It is a simple web server, serving both static files, a REST API handler, - * and a WebSocket handler. - */ -#include "mongoose.h" - -static struct mg_serve_http_opts web_root_opts; - -/* - * Forwards the jpeg frame data to all open mjpeg connections. - * - * Incoming messages follow a very simple binary frame format: - * 4 bytes: timestamp (in network byte order) - * n bytes: jpeg payload - * - * The timestamp is used to compute a lag. - * It's done in a quite stupid way as it requires the device clock - * to be synchronized with the cloud endpoint. - */ -static void push_frame_to_clients(struct mg_mgr *mgr, - const struct websocket_message *wm) { - struct mg_connection *nc; - /* - * mjpeg connections are tagged with the MG_F_USER_2 flag so we can find them - * my scanning the connection list provided by the mongoose manager. - */ - for (nc = mg_next(mgr, NULL); nc != NULL; nc = mg_next(mgr, nc)) { - if (!(nc->flags & MG_F_USER_2)) continue; // Ignore un-marked requests - - mg_printf(nc, - "--w00t\r\nContent-Type: image/jpeg\r\n" - "Content-Length: %lu\r\n\r\n", - (unsigned long) wm->size); - mg_send(nc, wm->data, wm->size); - mg_send(nc, "\r\n", 2); - printf("Image pushed to %p\n", nc); - } -} - -/* - * Forwards API payload to the device, by scanning through - * all the connections to find those that are tagged as WebSocket. - */ -static void send_command_to_the_device(struct mg_mgr *mgr, - const struct mg_str *cmd) { - struct mg_connection *nc; - for (nc = mg_next(mgr, NULL); nc != NULL; nc = mg_next(mgr, nc)) { - if (!(nc->flags & MG_F_IS_WEBSOCKET)) - continue; // Ignore non-websocket requests - - mg_send_websocket_frame(nc, WEBSOCKET_OP_TEXT, cmd->p, cmd->len); - printf("Sent API command [%.*s] to %p\n", (int) cmd->len, cmd->p, nc); - } -} - -/* - * Main event handler. Receives data events and dispatches to - * the appropriate handler function. - * - * 1. RESTful API requests are handled by send_command_to_the_device. - * 2. requests to /mpeg are established and left open waiting for data to arrive - * from WebSocket. - * 3. WebSocket frames are handled by push_frame_to_clients. - * 4. All other connections are passed to the mg_serve_http handler - * which serves static files. - */ -static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) { - struct websocket_message *wm = (struct websocket_message *) ev_data; - struct http_message *hm = (struct http_message *) ev_data; - - switch (ev) { - case MG_EV_HTTP_REQUEST: - if (mg_vcmp(&hm->uri, "/mjpg") == 0) { - nc->flags |= MG_F_USER_2; /* Set a mark on image requests */ - mg_printf(nc, "%s", - "HTTP/1.0 200 OK\r\n" - "Cache-Control: no-cache\r\n" - "Pragma: no-cache\r\n" - "Expires: Thu, 01 Dec 1994 16:00:00 GMT\r\n" - "Connection: close\r\n" - "Content-Type: multipart/x-mixed-replace; " - "boundary=--w00t\r\n\r\n"); - } else if (mg_vcmp(&hm->uri, "/api") == 0 && hm->body.len > 0) { - /* - * RESTful API call. HTTP message body should be a JSON message. - * We should parse it and take appropriate action. - * In our case, simply forward that call to the device. - */ - printf("API CALL: [%.*s] [%.*s]\n", (int) hm->method.len, hm->method.p, - (int) hm->body.len, hm->body.p); - send_command_to_the_device(nc->mgr, &hm->body); - mg_printf(nc, "HTTP/1.0 200 OK\nContent-Length: 0\n\n"); - } else { - /* Delegate to the static web server handler for all other paths. */ - mg_serve_http(nc, hm, web_root_opts); - } - break; - case MG_EV_WEBSOCKET_FRAME: - printf("Got websocket frame, size %lu\n", (unsigned long) wm->size); - push_frame_to_clients(nc->mgr, wm); - break; - } -} - -int main(int argc, char *argv[]) { - struct mg_mgr mgr; - struct mg_connection *nc; - - if (argc != 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); - exit(EXIT_FAILURE); - } - - printf("Listening on: [%s]\n", argv[1]); - mg_mgr_init(&mgr, NULL); - - /* - * mg_bind() creates a listening connection on a given ip:port and - * with an attached event handler. - * The event handler will only trigger TCP events until the http - * protocol handler is installed. - */ - if ((nc = mg_bind(&mgr, argv[1], ev_handler)) == NULL) { - fprintf(stderr, "Error binding to %s\n", argv[1]); - exit(EXIT_FAILURE); - } - mg_set_protocol_http_websocket(nc); - web_root_opts.document_root = "./web_root"; - - /* - * We explicitly hand over control to the Mongoose manager - * in this event loop and we can easily multiplex other activities. - */ - for (;;) { - mg_mgr_poll(&mgr, 1000); - } - - return EXIT_SUCCESS; -} diff --git a/examples/raspberry_pi_mjpeg_led/device_side.c b/examples/raspberry_pi_mjpeg_led/device_side.c deleted file mode 100644 index 42636280..00000000 --- a/examples/raspberry_pi_mjpeg_led/device_side.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ - -/* - * This is the device endpoint of the Raspberry Pi camera/LED example - * of the Mongoose networking library. - * It is a simple websocket client, sending jpeg frames obtained from the - * RPi camera and receiving JSON commands through the same WebSocket channel - */ - -#include -#include "mongoose.h" - -static int s_poll_interval_ms = 100; -static int s_still_period = 100; -static int s_vertical_flip = 0; -static int s_width = 320; -static int s_height = 180; -static const char *s_mjpg_file = "/var/run/shm/cam.jpg"; - -static struct mg_connection *client; - -/* - * Check if there is a new image available and - * send it to the cloud endpoint if the send buffer is not too full. - * The image is moved in a new file by the jpeg optimizer function; - * this ensures that we will detect a new frame when raspistill writes - * it's output file. - */ -static void send_mjpg_frame(struct mg_connection *nc, const char *file_path) { - static int skipped_frames = 0; - struct stat st; - FILE *fp; - - /* Check file modification time. */ - if (stat(file_path, &st) == 0) { - /* Skip the frame if there is too much unsent data. */ - if (nc->send_mbuf.len > 256) skipped_frames++; - - /* Read new mjpg frame into a buffer */ - fp = fopen(file_path, "rb"); - char buf[st.st_size]; - fread(buf, 1, sizeof(buf), fp); - fclose(fp); - - /* - * Delete the file so we can detect when raspistill creates a new one. - * mtime granularity is only 1s. - */ - unlink(file_path); - - /* Send those buffer through the websocket connection */ - mg_send_websocket_frame(nc, WEBSOCKET_OP_BINARY, buf, sizeof(buf)); - printf("Sent mjpg frame, %lu bytes after skippping %d frames\n", - (unsigned long) sizeof(buf), skipped_frames); - skipped_frames = 0; - } -} - -/* - * Turn on or off the LED. - * The LED in this example is an RGB led, so all the colors have to be set. - */ -static void set_led(int v) { - char cmd[512]; - snprintf(cmd, sizeof(cmd), - "for i in 22 23 24; do" - " echo %d >/sys/class/gpio/gpio$i/value; done", - v); - system(cmd); -} - -/* - * Parse control JSON and perform command: - * for now only LED on/off is supported. - */ -static void perform_control_command(const char *data, size_t len) { - struct json_token toks[200], *onoff; - parse_json(data, len, toks, sizeof(toks)); - onoff = find_json_token(toks, "onoff"); - set_led(strncmp("[\"on\"]", onoff->ptr, onoff->len) == 0); -} - -/* Main event handler. Sends websocket frames and receives control commands */ -static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) { - struct websocket_message *wm = (struct websocket_message *) ev_data; - - switch (ev) { - case MG_EV_CONNECT: - printf("Reconnect: %s\n", *(int *) ev_data == 0 ? "ok" : "failed"); - if (*(int *) ev_data == 0) { - /* - * Tune the tcp send buffer size, so that we can skip frames - * when the connection is congested. This helps maintaining a - * reasonable latency. - */ - int sndbuf_size = 512; - if (setsockopt(nc->sock, SOL_SOCKET, SO_SNDBUF, (void *) &sndbuf_size, - sizeof(int)) == -1) { - perror("failed to tune TCP send buffer size\n"); - } - - mg_send_websocket_handshake(nc, "/stream", NULL); - } - break; - case MG_EV_CLOSE: - printf("Connection %p closed\n", nc); - client = NULL; - break; - case MG_EV_POLL: - send_mjpg_frame(nc, s_mjpg_file); - break; - case MG_EV_WEBSOCKET_FRAME: - printf("Got control command: [%.*s]\n", (int) wm->size, wm->data); - perform_control_command((const char *) wm->data, wm->size); - break; - } -} - -/* - * This thread regenerates s_mjpg_file every s_poll_interval_ms milliseconds. - * It is Raspberry PI specific, change this function on other systems. - */ -static void *generate_mjpg_data_thread_func(void *param) { - char cmd[400]; - (void) param; - - snprintf(cmd, sizeof(cmd), - "raspistill -w %d -h %d -n -q 100 -tl %d " - "-t 999999999 -v %s -o %s >/dev/null 2>&1", - s_width, s_height, s_still_period, s_vertical_flip ? "-vf" : "", - s_mjpg_file); - - for (;;) { - int ret = system(cmd); - if (WIFSIGNALED(ret)) exit(1); - sleep(1); - } - return NULL; -} - -int main(int argc, char *argv[]) { - struct mg_mgr mgr; - char *addr = argv[1]; - - if (argc < 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); - exit(EXIT_FAILURE); - } - - /* Start separate thread that generates MJPG data */ - mg_start_thread(generate_mjpg_data_thread_func, NULL); - - printf("Streaming [%s] to [%s]\n", s_mjpg_file, addr); - - mg_mgr_init(&mgr, NULL); - - for (;;) { - mg_mgr_poll(&mgr, s_poll_interval_ms); - - /* Reconnect if disconnected */ - if (!client) { - sleep(1); /* limit reconnections frequency */ - printf("Reconnecting to %s...\n", addr); - client = mg_connect(&mgr, addr, ev_handler); - if (client) mg_set_protocol_http_websocket(client); - } - } - - return EXIT_SUCCESS; -} diff --git a/examples/raspberry_pi_mjpeg_led/docs/arch.png b/examples/raspberry_pi_mjpeg_led/docs/arch.png deleted file mode 100644 index 938f71a8..00000000 Binary files a/examples/raspberry_pi_mjpeg_led/docs/arch.png and /dev/null differ diff --git a/examples/raspberry_pi_mjpeg_led/web_root/doc.html b/examples/raspberry_pi_mjpeg_led/web_root/doc.html deleted file mode 100644 index f3bb9ae6..00000000 --- a/examples/raspberry_pi_mjpeg_led/web_root/doc.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - -Raspberry Pi camera/LED demo - - - - - -
-
-

Overview

-
-
-

The demo consists of web app providing access to a webcam and a LED attached to a RaspberryPi. -The device is assumed to have a limited bandwidth towards the server hosting the web app.

-
-
-
-
-

Objective

-
-
-

The demo shows how to use websockets to communicate bidirectionally with an embedded device using standard protocols.

-
-
-

It also shows that it’s possible to use Smart.c to develop also the cloud endpoint and expose WebSocket and RESTful APIs -easy to integreate with modern web stacks.

-
-
-
-
-

How it works

-
-
-
-arch -
-
-
-

There are two components, once with runs on the device (device_side) and one that runs on a stronger machine -and with more bandwidth (cloud_side).

-
-
-

The device app connects to the cloud app via websocket and sends a new jpeg frame as fast as the underlying raspistill camera -grabbing application can handle. The device automatically attempts reconnecting.

-
-
-

The cloud side serves the webapp static pages and serves an MPJEG image on /mpjg. -The MPJEG image handler blocks all the clients until a JPEG frame arrives via websocket -and then every client will receive a copy of the frame.

-
-
-

The web app can turn on and off the LED via a RESTful api accessible via the /api handler.

-
-
-
-
-

Installation

-
-
-

Server side

-
-
-
git clone https://github.com/cesanta/mongoose
-cd mongoose/examples/web_demo
-make cloud_side && ./cloud_side 0.0.0.0:8080
-
-
-
-
-

Raspberry Pi

-
-

The instructions provided here are tailored for the Raspbian distribution.

-
-
-

Dependencies

-
-
-
jpegoptim
-
-

apt-get install jpegoptim

-
-
camera
-
-

run raspi-config and enable camera

-
-
-
-
-
-

LED

-
-

In order to access the led on your HotPi -board you need to export the gpio pins:

-
-
-
-
for i in 22 23 24; do
-  echo $i >/sys/class/gpio/export
-  echo out >/sys/class/gpio/gpio$i/direction
-  chgrp pi /sys/class/gpio/gpio$i/value
-done
-
-
-
-
-

Build and run

-
-
-
git clone https://github.com/cesanta/mongoose
-cd mongoose/examples/web_demo
-make device_side && ./device_side yourserver:8080
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/examples/raspberry_pi_mjpeg_led/web_root/docs/arch.png b/examples/raspberry_pi_mjpeg_led/web_root/docs/arch.png deleted file mode 120000 index 47db27dc..00000000 --- a/examples/raspberry_pi_mjpeg_led/web_root/docs/arch.png +++ /dev/null @@ -1 +0,0 @@ -../../docs/arch.png \ No newline at end of file diff --git a/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.css b/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.css deleted file mode 100755 index ec9c9934..00000000 --- a/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Framework7 0.9.6 - * Full Featured HTML Framework For Building iOS 7 Apps - * - * http://www.idangero.us/framework7 - * - * Copyright 2014, Vladimir Kharlampidi - * The iDangero.us - * http://www.idangero.us/ - * - * Licensed under MIT - * - * Released on: September 13, 2014 -*/ -html,body{position:relative;height:100%;width:100%;overflow-x:hidden}body{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;margin:0;padding:0;color:#000;font-size:14px;line-height:1.4;width:100%;-webkit-text-size-adjust:100%;background:#fff;overflow:hidden}@media all and (width:1024px) and (height:691px) and (orientation:landscape){html,body{height:671px}}@media all and (width:1024px) and (height:692px) and (orientation:landscape){html,body{height:672px}}*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none}a,input,textarea,select{outline:0}a{text-decoration:none;color:#007aff}p{margin:1em 0}.row{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-lines:multiple;-moz-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.row>[class*=col-]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row .col-100{width:100%;width:-webkit-calc((100% - 15px*0) / 1);width:calc((100% - 15px*0) / 1)}.row.no-gutter .col-100{width:100%}.row .col-95{width:95%;width:-webkit-calc((100% - 15px*0.05263157894736836) / 1.0526315789473684);width:calc((100% - 15px*0.05263157894736836) / 1.0526315789473684)}.row.no-gutter .col-95{width:95%}.row .col-90{width:90%;width:-webkit-calc((100% - 15px*0.11111111111111116) / 1.1111111111111112);width:calc((100% - 15px*0.11111111111111116) / 1.1111111111111112)}.row.no-gutter .col-90{width:90%}.row .col-85{width:85%;width:-webkit-calc((100% - 15px*0.17647058823529416) / 1.1764705882352942);width:calc((100% - 15px*0.17647058823529416) / 1.1764705882352942)}.row.no-gutter .col-85{width:85%}.row .col-80{width:80%;width:-webkit-calc((100% - 15px*0.25) / 1.25);width:calc((100% - 15px*0.25) / 1.25)}.row.no-gutter .col-80{width:80%}.row .col-75{width:75%;width:-webkit-calc((100% - 15px*0.33333333333333326) / 1.3333333333333333);width:calc((100% - 15px*0.33333333333333326) / 1.3333333333333333)}.row.no-gutter .col-75{width:75%}.row .col-66{width:66.66666666666666%;width:-webkit-calc((100% - 15px*0.5000000000000002) / 1.5000000000000002);width:calc((100% - 15px*0.5000000000000002) / 1.5000000000000002)}.row.no-gutter .col-66{width:66.66666666666666%}.row .col-60{width:60%;width:-webkit-calc((100% - 15px*0.6666666666666667) / 1.6666666666666667);width:calc((100% - 15px*0.6666666666666667) / 1.6666666666666667)}.row.no-gutter .col-60{width:60%}.row .col-50{width:50%;width:-webkit-calc((100% - 15px*1) / 2);width:calc((100% - 15px*1) / 2)}.row.no-gutter .col-50{width:50%}.row .col-40{width:40%;width:-webkit-calc((100% - 15px*1.5) / 2.5);width:calc((100% - 15px*1.5) / 2.5)}.row.no-gutter .col-40{width:40%}.row .col-33{width:33.333333333333336%;width:-webkit-calc((100% - 15px*2) / 3);width:calc((100% - 15px*2) / 3)}.row.no-gutter .col-33{width:33.333333333333336%}.row .col-25{width:25%;width:-webkit-calc((100% - 15px*3) / 4);width:calc((100% - 15px*3) / 4)}.row.no-gutter .col-25{width:25%}.row .col-20{width:20%;width:-webkit-calc((100% - 15px*4) / 5);width:calc((100% - 15px*4) / 5)}.row.no-gutter .col-20{width:20%}.row .col-15{width:15%;width:-webkit-calc((100% - 15px*5.666666666666667) / 6.666666666666667);width:calc((100% - 15px*5.666666666666667) / 6.666666666666667)}.row.no-gutter .col-15{width:15%}.row .col-10{width:10%;width:-webkit-calc((100% - 15px*9) / 10);width:calc((100% - 15px*9) / 10)}.row.no-gutter .col-10{width:10%}.row .col-5{width:5%;width:-webkit-calc((100% - 15px*19) / 20);width:calc((100% - 15px*19) / 20)}.row.no-gutter .col-5{width:5%}@media all and (min-width:768px){.row .tablet-100{width:100%;width:-webkit-calc((100% - 15px*0) / 1);width:calc((100% - 15px*0) / 1)}.row.no-gutter .tablet-100{width:100%}.row .tablet-95{width:95%;width:-webkit-calc((100% - 15px*0.05263157894736836) / 1.0526315789473684);width:calc((100% - 15px*0.05263157894736836) / 1.0526315789473684)}.row.no-gutter .tablet-95{width:95%}.row .tablet-90{width:90%;width:-webkit-calc((100% - 15px*0.11111111111111116) / 1.1111111111111112);width:calc((100% - 15px*0.11111111111111116) / 1.1111111111111112)}.row.no-gutter .tablet-90{width:90%}.row .tablet-85{width:85%;width:-webkit-calc((100% - 15px*0.17647058823529416) / 1.1764705882352942);width:calc((100% - 15px*0.17647058823529416) / 1.1764705882352942)}.row.no-gutter .tablet-85{width:85%}.row .tablet-80{width:80%;width:-webkit-calc((100% - 15px*0.25) / 1.25);width:calc((100% - 15px*0.25) / 1.25)}.row.no-gutter .tablet-80{width:80%}.row .tablet-75{width:75%;width:-webkit-calc((100% - 15px*0.33333333333333326) / 1.3333333333333333);width:calc((100% - 15px*0.33333333333333326) / 1.3333333333333333)}.row.no-gutter .tablet-75{width:75%}.row .tablet-66{width:66.66666666666666%;width:-webkit-calc((100% - 15px*0.5000000000000002) / 1.5000000000000002);width:calc((100% - 15px*0.5000000000000002) / 1.5000000000000002)}.row.no-gutter .tablet-66{width:66.66666666666666%}.row .tablet-60{width:60%;width:-webkit-calc((100% - 15px*0.6666666666666667) / 1.6666666666666667);width:calc((100% - 15px*0.6666666666666667) / 1.6666666666666667)}.row.no-gutter .tablet-60{width:60%}.row .tablet-50{width:50%;width:-webkit-calc((100% - 15px*1) / 2);width:calc((100% - 15px*1) / 2)}.row.no-gutter .tablet-50{width:50%}.row .tablet-40{width:40%;width:-webkit-calc((100% - 15px*1.5) / 2.5);width:calc((100% - 15px*1.5) / 2.5)}.row.no-gutter .tablet-40{width:40%}.row .tablet-33{width:33.333333333333336%;width:-webkit-calc((100% - 15px*2) / 3);width:calc((100% - 15px*2) / 3)}.row.no-gutter .tablet-33{width:33.333333333333336%}.row .tablet-25{width:25%;width:-webkit-calc((100% - 15px*3) / 4);width:calc((100% - 15px*3) / 4)}.row.no-gutter .tablet-25{width:25%}.row .tablet-20{width:20%;width:-webkit-calc((100% - 15px*4) / 5);width:calc((100% - 15px*4) / 5)}.row.no-gutter .tablet-20{width:20%}.row .tablet-15{width:15%;width:-webkit-calc((100% - 15px*5.666666666666667) / 6.666666666666667);width:calc((100% - 15px*5.666666666666667) / 6.666666666666667)}.row.no-gutter .tablet-15{width:15%}.row .tablet-10{width:10%;width:-webkit-calc((100% - 15px*9) / 10);width:calc((100% - 15px*9) / 10)}.row.no-gutter .tablet-10{width:10%}.row .tablet-5{width:5%;width:-webkit-calc((100% - 15px*19) / 20);width:calc((100% - 15px*19) / 20)}.row.no-gutter .tablet-5{width:5%}}.views,.view{position:relative;width:100%;height:100%;z-index:5000}.views{overflow:auto;-webkit-overflow-scrolling:touch}.view{overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pages{position:relative;width:100%;height:100%;overflow:hidden;background:#000}.page{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;background:#efeff4;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;-webkit-box-shadow:none;box-shadow:none}.page.cached{display:none}.page-on-left{opacity:.9;-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(-20%,0,0);-ms-transform:translate3d(-20%,0,0);transform:translate3d(-20%,0,0)}.page-on-center{opacity:1;-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.page-on-right{-webkit-box-shadow:none;box-shadow:none;opacity:1;-webkit-transform:translate3d(100%,0,0);-ms-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.page-content{overflow:auto;-webkit-overflow-scrolling:touch;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:100%}.page-transitioning{-webkit-transition-duration:400ms;transition-duration:400ms}.page-from-right-to-center{-webkit-animation:pageFromRightToCenter 400ms forwards;animation:pageFromRightToCenter 400ms forwards}.page-from-center-to-right{-webkit-animation:pageFromCenterToRight 400ms forwards;animation:pageFromCenterToRight 400ms forwards}@-webkit-keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(100%,0,0)}}@keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(100%,0,0)}}.page-from-center-to-left{-webkit-animation:pageFromCenterToLeft 400ms forwards;animation:pageFromCenterToLeft 400ms forwards}.page-from-left-to-center{-webkit-animation:pageFromLeftToCenter 400ms forwards;animation:pageFromLeftToCenter 400ms forwards}@-webkit-keyframes pageFromCenterToLeft{from{opacity:1;-webkit-transform:translate3d(0,0,0)}to{opacity:.9;-webkit-transform:translate3d(-20%,0,0)}}@-webkit-keyframes pageFromLeftToCenter{from{opacity:.9;-webkit-transform:translate3d(-20%,0,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0)}}@keyframes pageFromCenterToLeft{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:.9;transform:translate3d(-20%,0,0)}}@keyframes pageFromLeftToCenter{from{opacity:.9;transform:translate3d(-20%,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}html.android .page{box-shadow:none!important}html.android .page-from-right-to-center{-webkit-animation:pageFromRightToCenterDegrade 400ms forwards;animation:pageFromRightToCenterDegrade 400ms forwards}html.android .page-from-center-to-right{-webkit-animation:pageFromCenterToRightDegrade 400ms forwards;animation:pageFromCenterToRightDegrade 400ms forwards}@-webkit-keyframes pageFromRightToCenterDegrade{from{-webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRightDegrade{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@keyframes pageFromRightToCenterDegrade{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRightDegrade{from{transform:translate3d(0,0,0)}to{transform:translate3d(100%,0,0)}}.navbar-inner,.toolbar-inner{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 8px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.navbar,.toolbar{height:44px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:17px;position:relative;margin:0;z-index:500;-webkit-backface-visibility:hidden;backface-visibility:hidden}.navbar b,.toolbar b{font-weight:500}.navbar a.link,.toolbar a.link{line-height:44px;height:44px;text-decoration:none;position:relative;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-transition-duration:300ms;transition-duration:300ms}html:not(.watch-active-state) .navbar a.link:active,html:not(.watch-active-state) .toolbar a.link:active,.navbar a.link.active-state,.toolbar a.link.active-state{opacity:.3;-webkit-transition-duration:0ms;transition-duration:0ms}.navbar a.link i+span,.toolbar a.link i+span,.navbar a.link i+i,.toolbar a.link i+i,.navbar a.link span+i,.toolbar a.link span+i,.navbar a.link span+span,.toolbar a.link span+span{margin-left:7px}.navbar a.icon-only,.toolbar a.icon-only{min-width:44px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;margin:0}.navbar i.icon,.toolbar i.icon{display:block}.navbar{left:0;top:0;background:#f7f7f8;border-bottom:1px solid #c4c4c4}html.retina.ios-gt-7 .navbar{border-bottom-width:.5px}.navbar .center{font-size:17px;font-weight:500;text-align:center;margin:0;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:44px;-webkit-flex-shrink:10;-ms-flex:0 10 auto;flex-shrink:10;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.navbar .left,.navbar .right{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.navbar .left a+a,.navbar .right a+a{margin-left:15px}.navbar .left{margin-right:10px}.navbar .right{margin-left:10px}.navbar .right:first-child{position:absolute;right:8px;height:100%}.toolbar{left:0;bottom:0;background:#f7f7f8;border-top:1px solid #c4c4c4}html.retina.ios-gt-7 .toolbar{border-top-width:.5px}.toolbar a{-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1;position:relative;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.tabbar{color:#929292;z-index:5001}.tabbar a{color:#929292}.tabbar a.active{color:#007aff}.tabbar a.tab-link,.tabbar a.link{height:100%;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;overflow:visible;-webkit-box-flex:1;-ms-flex:1;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.tabbar i.icon{height:30px}.tabbar-labels{height:50px}.tabbar-labels a.tab-link,.tabbar-labels a.link{padding-top:4px;padding-bottom:4px;height:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.tabbar-labels span.tabbar-label{line-height:1;display:block;letter-spacing:.01em;font-size:10px;position:relative;text-overflow:ellipsis;white-space:nowrap}@media all and (min-width:768px){.tabbar .toolbar-inner{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.tabbar a.tab-link,.tabbar a.link{width:auto;min-width:105px}.tabbar-labels{height:56px}.tabbar-labels span.tabbar-label{font-size:14px}}.navbar-from-right-to-center .left,.navbar-from-right-to-center .right,.navbar-from-right-to-center .center{-webkit-animation:navbarElementFadeIn 400ms forwards;animation:navbarElementFadeIn 400ms forwards}.navbar-from-right-to-center .sliding{opacity:1}.navbar-from-center-to-right .left,.navbar-from-center-to-right .right,.navbar-from-center-to-right .center{-webkit-animation:navbarElementFadeOut 400ms forwards;animation:navbarElementFadeOut 400ms forwards}.navbar-from-center-to-right .sliding{opacity:0}@-webkit-keyframes navbarElementFadeIn{from{opacity:0}to{opacity:1}}@keyframes navbarElementFadeIn{from{opacity:0}to{opacity:1}}.navbar-from-center-to-left .left,.navbar-from-center-to-left .right,.navbar-from-center-to-left .center{-webkit-animation:navbarElementFadeOut 400ms forwards;animation:navbarElementFadeOut 400ms forwards}.navbar-from-center-to-left .sliding{opacity:0}.navbar-from-left-to-center .left,.navbar-from-left-to-center .right,.navbar-from-left-to-center .center{-webkit-animation:navbarElementFadeIn 400ms forwards;animation:navbarElementFadeIn 400ms forwards}.navbar-from-left-to-center .sliding{opacity:1}.navbar-on-left .left,.navbar-on-left .right,.navbar-on-left .center{opacity:0}.navbar-on-left .sliding{opacity:0}.navbar-on-right .left,.navbar-on-right .right,.navbar-on-right .center{opacity:0}.navbar-on-right .sliding{opacity:0}@-webkit-keyframes navbarElementFadeOut{from{opacity:1}to{opacity:0}}@keyframes navbarElementFadeOut{from{opacity:1}to{opacity:0}}.navbar-from-right-to-center .left.sliding .back.link .icon,.navbar-from-center-to-right .left.sliding .back.link .icon,.navbar-from-center-to-left .left.sliding .back.link .icon,.navbar-from-left-to-center .left.sliding .back.link .icon{-webkit-transition-duration:400ms;transition-duration:400ms}.navbar-from-right-to-center .sliding,.navbar-from-center-to-right .sliding,.navbar-from-center-to-left .sliding,.navbar-from-left-to-center .sliding{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-animation:none;animation:none}.page>.navbar,.view>.navbar,.views>.navbar,.page>.toolbar,.view>.toolbar,.views>.toolbar{position:absolute}.navbar-through .page-content,.navbar-fixed .page-content{padding-top:44px}.toolbar-through .page-content,.toolbar-fixed .page-content,.tabbar-through .page-content,.tabbar-fixed .page-content{padding-bottom:44px}.tabbar-labels-fixed .page-content,.tabbar-labels-through .page-content{padding-bottom:50px}@media all and (min-width:768px){.tabbar-labels-fixed .page-content,.tabbar-labels-through .page-content{padding-bottom:56px}}.hidden-navbar .navbar{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,-100%,0);-ms-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.hiding-navbar .navbar{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.page.no-navbar .page-content{padding-top:0}.hidden-toolbar .toolbar{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.hiding-toolbar .toolbar{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.page.no-toolbar .page-content{padding-bottom:0}.searchbar{height:44px;background:#c9c9ce;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #b4b4b4;padding:0 8px;overflow:hidden;position:relative;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}html.retina.ios-gt-7 .searchbar{border-bottom-width:.5px}.searchbar .searchbar-input{width:100%;height:28px;position:relative;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.searchbar input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;display:block;border:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border-radius:5px;font-family:inherit;color:#000;font-size:14px;font-weight:400;padding:0 28px;background:#fff url("data:image/svg+xml;charset=utf-8,") no-repeat 8px center;-webkit-background-size:13px 13px;background-size:13px 13px}.searchbar input[type=search]::-webkit-input-placeholder{color:#939398;opacity:1}.searchbar input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.searchbar .searchbar-clear{position:absolute;width:28px;height:28px;right:0;top:0;opacity:0;pointer-events:none;background:url("data:image/svg+xml;charset=utf-8,") no-repeat center;-webkit-background-size:14px 14px;background-size:14px 14px;-webkit-transition-duration:300ms;transition-duration:300ms;cursor:pointer}.searchbar .searchbar-cancel{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);font-size:17px;cursor:pointer;opacity:0;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;margin-left:0;pointer-events:none}.searchbar.searchbar-active .searchbar-cancel{margin-left:8px;opacity:1;pointer-events:auto}html:not(.watch-active-state) .searchbar.searchbar-active .searchbar-cancel:active,.searchbar.searchbar-active .searchbar-cancel.active-state{opacity:.3;-webkit-transition-duration:0ms;transition-duration:0ms}.searchbar.searchbar-not-empty .searchbar-clear{pointer-events:auto;opacity:1}.searchbar-overlay{position:absolute;left:0;top:0;width:100%;height:100%;z-index:100;opacity:0;pointer-events:none;background:rgba(0,0,0,.4);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.searchbar-overlay.searchbar-overlay-active{opacity:1;pointer-events:auto}.searchbar-not-found{display:none}.hidden-by-searchbar,.list-block .hidden-by-searchbar,.list-block li.hidden-by-searchbar{display:none}.page>.searchbar{position:absolute;width:100%;left:0;top:0;z-index:200}.page>.searchbar~.page-content{padding-top:44px}.navbar-fixed .page>.searchbar,.navbar-through .page>.searchbar,.navbar-fixed>.searchbar,.navbar-through>.searchbar{top:44px}.navbar-fixed .page>.searchbar~.page-content,.navbar-through .page>.searchbar~.page-content,.navbar-fixed>.searchbar~.page-content,.navbar-through>.searchbar~.page-content{padding-top:88px}.messagebar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:0ms;transition-duration:0ms}.messagebar textarea{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #c8c8cd;background:#fff;border-radius:5px;box-shadow:none;display:block;padding:3px 8px;margin:0;width:100%;height:28px;color:#000;font-size:17px;line-height:20px;font-family:inherit;resize:none;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.messagebar .link{-ms-flex-item-align:flex-end;-webkit-align-self:flex-end;align-self:flex-end}.messagebar .link.icon-only:first-child{margin-left:-6px}.messagebar .link:not(.icon-only)+textarea{margin-left:8px}.messagebar textarea+.link{margin-left:8px}.messagebar .link{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.messagebar~.page-content{padding-bottom:44px}.page.no-toolbar .messagebar~.page-content{padding-bottom:44px}.hidden-toolbar .messagebar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:0ms;transition-duration:0ms}i.icon{display:inline-block;vertical-align:middle;background-size:100% auto;background-position:center;background-repeat:no-repeat;font-style:normal;position:relative}i.icon.icon-back{width:12px;height:20px;background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-bars{width:21px;height:13px;background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-camera{width:25px;height:20px;background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-f7{width:29px;height:29px;background-image:url(../img/i-f7.png)}i.icon.icon-form-name{width:29px;height:29px;background-image:url(../img/i-form-name.png)}i.icon.icon-form-password{width:29px;height:29px;background-image:url(../img/i-form-password.png)}i.icon.icon-form-email{width:29px;height:29px;background-image:url(../img/i-form-email.png)}i.icon.icon-form-calendar{width:29px;height:29px;background-image:url(../img/i-form-calendar.png)}i.icon.icon-form-tel{width:29px;height:29px;background-image:url(../img/i-form-tel.png)}i.icon.icon-form-gender{width:29px;height:29px;background-image:url(../img/i-form-gender.png)}i.icon.icon-form-toggle{width:29px;height:29px;background-image:url(../img/i-form-toggle.png)}i.icon.icon-form-comment{width:29px;height:29px;background-image:url(../img/i-form-comment.png)}i.icon.icon-form-settings{width:29px;height:29px;background-image:url(../img/i-form-settings.png)}i.icon.icon-form-url{width:29px;height:29px;background-image:url(../img/i-form-url.png)}i.icon.icon-next,i.icon.icon-prev{width:15px;height:15px}i.icon.icon-next{background:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-prev{background:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-plus{width:25px;height:25px;font-size:31px;line-height:20px;text-align:center;font-weight:100}.badge{font-size:13px;display:inline-block;color:#fff;background:#8e8e93;border-radius:20px;padding:1px 7px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.icon .badge{position:absolute;left:100%;margin-left:-10px;top:-2px;font-size:10px;padding:1px 5px}.content-block{margin:35px 0;padding:0 15px;color:#6d6d72}.content-block-title{position:relative;overflow:hidden;margin:0;white-space:nowrap;text-overflow:ellipsis;font-size:14px;text-transform:uppercase;line-height:1;color:#6d6d72;margin:35px 15px 10px}.content-block-title+.list-block,.content-block-title+.content-block{margin-top:10px}.content-block-inner{background:#fff;padding:10px 15px;margin-left:-15px;width:100%;border-bottom:1px solid #c8c7cc;border-top:1px solid #c8c7cc;color:#000}html.retina.ios-gt-7 .content-block-inner{border-top-width:.5px;border-bottom-width:.5px}.content-block.inset{margin-left:15px;margin-right:15px;border-radius:7px}.content-block.inset .content-block-inner{border:none;border-radius:7px}@media all and (min-width:768px){.content-block.tablet-inset{margin-left:15px;margin-right:15px;border-radius:7px}.content-block.tablet-inset .content-block-inner{border:none;border-radius:7px}}.list-block{margin:35px 0;font-size:17px}.list-block ul{background:#fff;list-style:none;padding:0;margin:0;border-top:1px solid #c8c7cc;border-bottom:1px solid #c8c7cc;position:relative}.list-block ul ul{border-top:none;border-bottom:none;padding-left:45px}.list-block .align-top,.list-block .align-top .item-content,.list-block .align-top .item-inner{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.list-block.inset{margin-left:15px;margin-right:15px;border-radius:7px}.list-block.inset .content-block-title{margin-left:0;margin-right:0}.list-block.inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.inset li:first-child:last-child>a{border-radius:7px}@media all and (min-width:768px){.list-block.tablet-inset{margin-left:15px;margin-right:15px;border-radius:7px}.list-block.tablet-inset .content-block-title{margin-left:0;margin-right:0}.list-block.tablet-inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.tablet-inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.tablet-inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.tablet-inset li:first-child:last-child>a{border-radius:7px}.list-block.tablet-inset .content-block-title{margin-left:0;margin-right:0}.list-block.tablet-inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.tablet-inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.tablet-inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.tablet-inset li:first-child:last-child>a{border-radius:7px}}.list-block li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}.list-block .item-media{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;-webkit-box-lines:single;-moz-box-lines:single;-webkit-flex-wrap:nowrap;-ms-flex-wrap:none;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;padding-top:7px;padding-bottom:8px}.list-block .item-media i+i{margin-left:5px}.list-block .item-media i+img{margin-left:5px}.list-block .item-media+.item-inner{margin-left:15px}.list-block .item-inner{padding-right:15px;border-bottom:1px solid #c8c7cc;width:100%;padding-top:8px;padding-bottom:7px;min-height:44px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1;-ms-flex:1;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.list-block .item-title{-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;max-width:100%}.list-block .item-title.label{width:35%;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.list-block .item-input{width:100%;margin-top:-8px;margin-bottom:-7px;-webkit-box-flex:1;-ms-flex:1;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.list-block .item-after{white-space:nowrap;color:#8e8e93;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;margin-left:5px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;max-height:28px}.list-block .smart-select .item-after{max-width:70%;overflow:hidden;text-overflow:ellipsis;position:relative}.list-block .item-link{-webkit-transition-duration:300ms;transition-duration:300ms;display:block;color:inherit}.list-block .item-link .item-inner{padding-right:35px;background:no-repeat -webkit-calc(100% - 15px) center;background:no-repeat calc(100% - 15px) center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}html:not(.watch-active-state) .list-block .item-link:active,.list-block .item-link.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) .list-block .item-link:active .item-inner,.list-block .item-link.active-state .item-inner{border-bottom-color:transparent}.list-block .item-link.list-button{padding:0 15px;text-align:center;color:#007aff;display:block;border-bottom:1px solid #c8c7cc;line-height:43px}.list-block .item-content{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:15px;min-height:44px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.list-block .list-block-label{margin:10px 0 35px;padding:0 15px;font-size:14px;color:#8f8f94}.list-block .swipeout{overflow:hidden;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.list-block .swipeout.deleting{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block .swipeout.deleting .swipeout-content{-webkit-transform:translate3d(-100%,0,0);-ms-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.list-block .swipeout.transitioning .swipeout-content,.list-block .swipeout.transitioning .swipeout-actions-right a,.list-block .swipeout.transitioning .swipeout-actions-left a,.list-block .swipeout.transitioning .swipeout-overswipe{-webkit-transition:300ms;transition:300ms}.list-block .swipeout-content{position:relative;z-index:10}.list-block .swipeout-overswipe{-webkit-transition:200ms left;transition:200ms left}.list-block .swipeout-actions-left,.list-block .swipeout-actions-right{position:absolute;top:0;height:100%;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transform:translate3d(0%,0,0);-ms-transform:translate3d(0%,0,0);transform:translate3d(0%,0,0)}.list-block .swipeout-actions-left a,.list-block .swipeout-actions-right a{padding:0 30px;color:#fff;background:#c7c7cc;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;position:relative;left:0}.list-block .swipeout-actions-left a:after,.list-block .swipeout-actions-right a:after{content:'';position:absolute;top:0;width:600%;height:100%;background:inherit;z-index:-1}.list-block .swipeout-actions-left a.swipeout-delete,.list-block .swipeout-actions-right a.swipeout-delete{background:#ff3b30}.list-block .swipeout-actions-right{right:0;-webkit-transform:translate3d(100%,0,0);-ms-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.list-block .swipeout-actions-right a:after{left:100%;margin-left:-1px}.list-block .swipeout-actions-left{left:0;-webkit-transform:translate3d(-100%,0,0);-ms-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.list-block .swipeout-actions-left a:after{right:100%;margin-right:-1px}.list-block .item-subtitle{font-size:15px;position:relative;overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis}.list-block .item-text{font-size:15px;color:#8e8e93;line-height:21px;position:relative;overflow:hidden;height:42px;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box}.list-block.media-list .item-title,.list-block li.media-item .item-title{font-weight:500}.list-block.media-list .item-inner,.list-block li.media-item .item-inner{display:block;padding-top:10px;padding-bottom:9px;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch}.list-block.media-list .item-link .item-inner,.list-block li.media-item .item-link .item-inner{background:0 0;padding-right:15px}.list-block.media-list .item-link .item-title-row,.list-block li.media-item .item-link .item-title-row{padding-right:20px;background:no-repeat right center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}.list-block.media-list .item-media,.list-block li.media-item .item-media{padding-top:9px;padding-bottom:10px}.list-block.media-list .item-media img,.list-block li.media-item .item-media img{display:block}.list-block.media-list .item-title-row,.list-block li.media-item .item-title-row{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.list-block .list-group:nth-child(n+2) ul{border-top:none}.list-block .item-divider,.list-block .list-group-title{background:#f7f7f7;border-top:1px solid #c8c7cc;margin-top:-1px;padding:4px 15px;white-space:nowrap;position:relative;max-width:100%;text-overflow:ellipsis;overflow:hidden;color:#8e8e93}.list-block .list-group-title{position:relative;position:-webkit-sticky;position:-moz-sticky;position:sticky;top:0;z-index:10;margin-top:0;border-top:none}.list-block .sortable-handler{position:absolute;right:0;top:0;height:-webkit-calc(100% - 1px);height:calc(100% - 1px);z-index:10;background-repeat:no-repeat;background-size:18px 12px;background-position:center;width:35px;background-image:url("data:image/svg+xml;charset=utf-8,");opacity:0;visibility:hidden;cursor:pointer;-webkit-transition-duration:300ms;transition-duration:300ms}.list-block.sortable .item-inner{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block.sortable-opened .sortable-handler{visibility:visible;opacity:1}.list-block.sortable-opened .item-inner,.list-block.sortable-opened .item-link .item-inner{padding-right:35px}.list-block.sortable-opened .item-link .item-inner,.list-block.sortable-opened .item-link .item-title-row{background-image:none}.list-block.sortable-sorting li{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block li.sorting{z-index:50;background:rgba(255,255,255,.8);box-shadow:0 2px 8px rgba(0,0,0,.6);-webkit-transition-duration:0ms;transition-duration:0ms}.list-block li.sorting .item-inner{border-bottom:none}.list-block li:last-child .list-button{border-bottom:none}.list-block li:last-child .item-inner,.list-block li:last-child li:last-child .item-inner{border-bottom:none}.list-block li li:last-child .item-inner,.list-block li:last-child li .item-inner{border-bottom:1px solid #c8c7cc}html.retina.ios-gt-7 .list-block ul{border-top-width:.5px;border-bottom-width:.5px}html.retina.ios-gt-7 .list-block li:not(:last-child) .item-inner{border-bottom-width:.5px}html.retina.ios-gt-7 .item-divider{border-top-width:.5px;margin-top:-.5px}html.retina.ios-gt-7 .item-link.list-button{border-bottom-width:.5px}.contacts-content{background:#fff}.contacts-block{margin:0}.contacts-block .list-group-title{padding:0 15px;background:#f7f7f7;color:#000;font-weight:500;line-height:22px;height:22px}.contacts-block .list-group:first-child ul{border-top:none}.contacts-block .list-group:last-child ul{border-bottom:none}.list-block input[type=text],.list-block input[type=password],.list-block input[type=email],.list-block input[type=tel],.list-block input[type=url],.list-block input[type=date],.list-block input[type=datetime-local],.list-block input[type=number],.list-block select,.list-block textarea{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;background:0 0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;padding:0 0 0 5px;margin:0;width:100%;height:43px;color:#000;font-size:17px;font-family:inherit}.list-block input[type=date],.list-block input[type=datetime-local]{line-height:44px}.list-block select{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}.list-block .lable{vertical-align:top}.list-block textarea{height:100px;resize:none;line-height:1.4;padding-top:8px;padding-bottom:7px}.label-switch{display:inline-block;vertical-align:middle;width:52px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:32px;position:relative;cursor:pointer;-ms-flex-item-align:center;-webkit-align-self:center;align-self:center}.label-switch .checkbox{width:52px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:32px;background:#e5e5e5;z-index:0;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border:none;cursor:pointer;position:relative;-webkit-transition-duration:300ms;transition-duration:300ms}.label-switch .checkbox:before{content:' ';position:absolute;left:2px;top:2px;width:48px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:28px;background:#fff;z-index:1;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.label-switch .checkbox:after{content:' ';height:28px;width:28px;border-radius:28px;background:#fff;position:absolute;z-index:2;top:2px;left:2px;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4);-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px);-webkit-transition-duration:300ms;transition-duration:300ms}.label-switch input[type=checkbox]{display:none}.label-switch input[type=checkbox]:checked+.checkbox{background:#4cd964}.label-switch input[type=checkbox]:checked+.checkbox:before{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.label-switch input[type=checkbox]:checked+.checkbox:after{-webkit-transform:translateX(22px);-ms-transform:translateX(22px);transform:translateX(22px)}html.android .label-switch input[type=checkbox]+.checkbox{-webkit-transition-duration:0;transition-duration:0}html.android .label-switch input[type=checkbox]+.checkbox:after,html.android .label-switch input[type=checkbox]+.checkbox:before{-webkit-transition-duration:0;transition-duration:0}.button{border:1px solid #007aff;color:#007aff;text-decoration:none;text-align:center;display:block;border-radius:5px;line-height:27px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;padding:0 10px;margin:0;height:29px;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-family:inherit;cursor:pointer}input[type=submit].button,input[type=button].button{width:100%}html:not(.watch-active-state) .button:active,.button.active-state{background:rgba(0,122,255,.15)}.button.button-round{border-radius:27px}.button.active{background:#007aff;color:#fff}.button.button-big{font-size:17px;height:44px;line-height:42px}.button.button-fill{color:#fff;background:#007aff;border:none}html:not(.watch-active-state) .button.button-fill:active,.button.button-fill.active-state{opacity:.8}.buttons-row{-ms-flex-item-align:center;-webkit-align-self:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-lines:single;-moz-box-lines:single;-webkit-flex-wrap:nowrap;-ms-flex-wrap:none;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.buttons-row .button{border-radius:0;border-left-width:0;width:100%;-webkit-box-flex:1;-ms-flex:1}.buttons-row .button:first-child{border-radius:5px 0 0 5px;border-left-width:1px;border-left-style:solid}.buttons-row .button:last-child{border-radius:0 5px 5px 0}.buttons-row .button.button-round:first-child{border-radius:27px 0 0 27px}.buttons-row .button.button-round:last-child{border-radius:0 27px 27px 0}.range-slider{width:100%;position:relative;overflow:hidden;padding-left:3px;padding-right:3px;margin-left:-1px;-ms-flex-item-align:center;-webkit-align-self:center;align-self:center}.range-slider input[type=range]{position:relative;height:28px;width:100%;margin:4px 0 5px;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,#b7b8b7),color-stop(100%,#b7b8b7));background:linear-gradient(to right,#b7b8b7 0,#b7b8b7 100%);background-position:center;background-size:100% 2px;background-repeat:no-repeat;outline:0}.range-slider input[type=range]:after{height:2px;background:#fff;content:' ';width:5px;top:50%;margin-top:-1px;left:-5px;z-index:1;position:absolute}.range-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border:none;height:28px;width:28px;position:relative;background:0 0}.range-slider input[type=range]::-webkit-slider-thumb:after{height:28px;width:28px;border-radius:28px;background:#fff;z-index:10;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.4);box-shadow:0 2px 4px rgba(0,0,0,.4);position:absolute;left:0;top:0;content:' '}.range-slider input[type=range]::-webkit-slider-thumb:before{position:absolute;top:50%;right:100%;width:2000px;height:2px;margin-top:-1px;z-index:1;background:#007aff;content:' '}label.label-checkbox{cursor:pointer}label.label-checkbox i.icon-form-checkbox{width:22px;height:22px;position:relative;border-radius:22px;border:1px solid #c7c7cc;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}label.label-checkbox i.icon-form-checkbox:after{content:' ';position:absolute;left:50%;margin-left:-6px;top:50%;margin-top:-4px;width:12px;height:9px}label.label-checkbox input[type=checkbox],label.label-checkbox input[type=radio]{display:none}label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{border:none;background-color:#007aff}label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox:after,label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox:after{background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8,");-webkit-background-size:12px 9px;background-size:12px 9px}label.label-radio{cursor:pointer}label.label-radio input[type=checkbox],label.label-radio input[type=radio]{display:none}label.label-radio input[type=checkbox]~.item-inner,label.label-radio input[type=radio]~.item-inner{padding-right:35px}label.label-radio input[type=checkbox]:checked~.item-inner,label.label-radio input[type=radio]:checked~.item-inner{background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8, ");background-position:90% center;background-position:-webkit-calc(100% - 15px) center;background-position:calc(100% - 15px) center;-webkit-background-size:13px 10px;background-size:13px 10px}label.label-checkbox,label.label-radio{-webkit-transition-duration:300ms;transition-duration:300ms}html:not(.watch-active-state) label.label-checkbox:active,html:not(.watch-active-state) label.label-radio:active,label.label-checkbox.active-state,label.label-radio.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) label.label-checkbox:active .item-inner,html:not(.watch-active-state) label.label-radio:active .item-inner,label.label-checkbox.active-state .item-inner,label.label-radio.active-state .item-inner{border-bottom-color:transparent}.smart-select select{display:none}.list-block .accordion-item-toggle{cursor:pointer;-webkit-transition-duration:300ms;transition-duration:300ms}.list-block .accordion-item-toggle .item-inner{padding-right:35px;background:no-repeat -webkit-calc(100% - 15px) center;background:no-repeat calc(100% - 15px) center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}html:not(.watch-active-state) .list-block .accordion-item-toggle:active,.list-block .accordion-item-toggle.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) .list-block .accordion-item-toggle:active>.item-inner,.list-block .accordion-item-toggle.active-state>.item-inner{border-bottom-color:transparent}.list-block .accordion-item-toggle .item-inner,.list-block .accordion-item>.item-link .item-inner{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-property:background-color,border-color;transition-property:background-color,border-color}.list-block .accordion-item-expanded .accordion-toggle .item-inner,.list-block .accordion-item-expanded>.item-link .item-inner{background-image:url("data:image/svg+xml;charset=utf-8,");background-size:20px 20px;border-bottom-color:transparent}.list-block .accordion-item .content-block,.list-block .accordion-item .list-block{margin-top:0;margin-bottom:0}.list-block .accordion-item ul{padding-left:0}.accordion-item-content{position:relative;overflow:hidden;height:0;font-size:14px;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.accordion-item-expanded .accordion-item-content{height:auto}.modal-overlay,.preloader-indicator-overlay,.popup-overlay{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:10600;visibility:hidden;opacity:0;-webkit-transition-duration:400ms;transition-duration:400ms}.modal-overlay.modal-overlay-visible,.preloader-indicator-overlay.modal-overlay-visible,.popup-overlay.modal-overlay-visible{visibility:visible;opacity:1}html.ios .modal-overlay.modal-overlay-visible,html.ios .preloader-indicator-overlay.modal-overlay-visible,html.ios .popup-overlay.modal-overlay-visible{overflow:auto;-webkit-overflow-scrolling:touch}.popup-overlay{z-index:10200}.modal{width:270px;position:absolute;z-index:11000;left:50%;margin-left:-135px;margin-top:0;top:50%;text-align:center;border-radius:7px;opacity:0;-webkit-transform:translate3d(0,0,0) scale(1.185);-ms-transform:translate3d(0,0,0) scale(1.185);transform:translate3d(0,0,0) scale(1.185);-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform,opacity;-ms-transition-property:-ms-transform,opacity;-o-transition-property:-o-transform,opacity;transition-property:transform,opacity;color:#000}.modal.modal-in{opacity:1;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0) scale(1);-ms-transform:translate3d(0,0,0) scale(1);transform:translate3d(0,0,0) scale(1)}.modal.modal-out{opacity:0;z-index:10999;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0) scale(0.815);-ms-transform:translate3d(0,0,0) scale(0.815);transform:translate3d(0,0,0) scale(0.815)}.modal-inner{padding:15px;border-bottom:1px solid #b5b5b5;border-radius:7px 7px 0 0;background:#e8e8e8}.modal-title{font-weight:500;font-size:18px;text-align:center}.modal-title+.modal-text{margin-top:5px}.modal-buttons{height:44px;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.modal-button{width:100%;padding:0 5px;height:44px;font-size:17px;line-height:44px;text-align:center;color:#007aff;background:#e8e8e8;display:block;position:relative;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-right:1px solid #b5b5b5;-webkit-box-flex:1;-ms-flex:1}.modal-button:first-child{border-radius:0 0 0 7px}.modal-button:last-child{border-right:none;border-radius:0 0 7px}.modal-button:first-child:last-child{border-radius:0 0 7px 7px}.modal-button.modal-button-bold{font-weight:500}html:not(.watch-active-state) .modal-button:active,.modal-button.active-state{background:#d4d4d4}.modal-no-buttons .modal-inner{border-radius:7px;border-bottom:none}.modal-no-buttons .modal-buttons{display:none}.actions-modal{position:absolute;left:0;bottom:0;z-index:11000;width:100%;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.actions-modal.modal-in{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.actions-modal.modal-out{z-index:10999;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.actions-modal-group{margin:8px}.actions-modal-button,.actions-modal-label{width:100%;text-align:center;font-weight:400;margin:0;background:rgba(243,243,243,.95);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;border-bottom:1px solid #d2d2d6}.actions-modal-button a,.actions-modal-label a{text-decoration:none;color:inherit}.actions-modal-button b,.actions-modal-label b{font-weight:500}.actions-modal-button.actions-modal-button-bold,.actions-modal-label.actions-modal-button-bold{font-weight:500}.actions-modal-button.actions-modal-button-red,.actions-modal-label.actions-modal-button-red{color:#ff3b30}.actions-modal-button:first-child,.actions-modal-label:first-child{border-radius:4px 4px 0 0}.actions-modal-button:last-child,.actions-modal-label:last-child{border:none;border-radius:0 0 4px 4px}.actions-modal-button:first-child:last-child,.actions-modal-label:first-child:last-child{border-radius:4px}.actions-modal-button{cursor:pointer;line-height:43px;font-size:20px;color:#007aff}html:not(.watch-active-state) .actions-modal-button:active,.actions-modal-button.active-state{background:#dcdcdc}.actions-modal-label{font-size:13px;line-height:1.3;min-height:44px;padding:8px 10px;color:#8a8a8a;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}input.modal-text-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:30px;background:#fff;margin:0;margin-top:15px;padding:0 5px;border:1px solid #a0a0a0;border-radius:5px;width:100%;font-size:14px;font-family:inherit;display:block;-webkit-box-shadow:0 0 0 rgba(0,0,0,0);box-shadow:0 0 0 rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}input.modal-text-input+input.modal-text-input{margin-top:5px}input.modal-text-input.modal-text-input-double{border-radius:5px 5px 0 0}input.modal-text-input.modal-text-input-double+input.modal-text-input{margin-top:0;border-top:0;border-radius:0 0 5px 5px}.popover{width:320px;background:rgba(255,255,255,.95);z-index:11000;margin:0;top:0;opacity:0;left:0;border-radius:7px;position:absolute;display:none;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition-property:opacity;-moz-transition-property:opacity;-ms-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.popover.modal-in{-webkit-transition-duration:300ms;transition-duration:300ms;opacity:1}.popover .list-block{margin:0}.popover .list-block ul{background:0 0}.popover .list-block:first-child ul{border-top:none;border-radius:7px 7px 0 0}.popover .list-block:first-child li:first-child a{border-radius:7px 7px 0 0}.popover .list-block:last-child ul{border-bottom:none;border-radius:0 0 7px 7px}.popover .list-block:last-child li:last-child a{border-radius:0 0 7px 7px}.popover .list-block:first-child:last-child li:first-child:last-child a,.popover .list-block:first-child:last-child ul:first-child:last-child{border-radius:7px}.popover .list-block+.list-block{margin-top:35px}.popover-angle{width:26px;height:26px;position:absolute;left:-26px;top:0;z-index:100;overflow:hidden}.popover-angle:after{content:' ';background:rgba(255,255,255,.95);width:26px;height:26px;position:absolute;left:0;top:0;border-radius:3px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.popover-angle.on-left{left:-26px}.popover-angle.on-left:after{left:19px;top:0}.popover-angle.on-right{left:100%}.popover-angle.on-right:after{left:-19px;top:0}.popover-angle.on-top{left:0;top:-26px}.popover-angle.on-top:after{left:0;top:19px}.popover-angle.on-bottom{left:0;top:100%}.popover-angle.on-bottom:after{left:0;top:-19px}.popover-inner{overflow:auto;-webkit-overflow-scrolling:touch}.actions-popover .list-block+.list-block{margin-top:20px}.actions-popover .list-block ul{background:#fff}.actions-popover-label{padding:8px 10px;color:#8a8a8a;font-size:13px;line-height:1.3;text-align:center;border-bottom:1px solid #d2d2d6}.actions-popover-label:last-child{border-bottom:none}.popup,.login-screen{position:absolute;left:0;top:0;width:100%;height:100%;z-index:10400;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:none;overflow:auto;-webkit-overflow-scrolling:touch;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-ms-transition-property:-ms-transform;-o-transition-property:-o-transform;transition-property:transform;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.popup.modal-in,.login-screen.modal-in,.popup.modal-out,.login-screen.modal-out{-webkit-transition-duration:400ms;transition-duration:400ms}.popup.modal-in,.login-screen.modal-in{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.popup.modal-out,.login-screen.modal-out{-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.login-screen.modal-in,.login-screen.modal-out{display:block}@media all and (min-width:630px) and (min-height:630px){.popup:not(.tablet-fullscreen){width:630px;height:630px;left:50%;top:50%;margin-left:-315px;margin-top:-315px;-webkit-transform:translate3d(0,1024px,0);-ms-transform:translate3d(0,1024px,0);transform:translate3d(0,1024px,0)}.popup:not(.tablet-fullscreen).modal-in{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.popup:not(.tablet-fullscreen).modal-out{-webkit-transform:translate3d(0,1024px,0);-ms-transform:translate3d(0,1024px,0);transform:translate3d(0,1024px,0)}}@media all and (max-width:629px),(max-height:629px){html.with-statusbar-overlay .popup{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}html.with-statusbar-overlay .popup-overlay{z-index:9800}}html.with-statusbar-overlay .login-screen,html.with-statusbar-overlay .popup.tablet-fullscreen{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}.modal .preloader{width:34px;height:34px}.preloader-indicator-overlay{visibility:visible;opacity:0;background:0 0}.preloader-indicator-modal{position:absolute;left:50%;top:50%;padding:8px;margin-left:-25px;margin-top:-25px;background:rgba(0,0,0,.8);z-index:11000;border-radius:5px}.preloader-indicator-modal .preloader{display:block;width:34px;height:34px}html.retina.ios-gt-7 .modal-inner{border-bottom-width:.5px}html.retina.ios-gt-7 .modal-button{border-right-width:.5px}html.retina.ios-gt-7 .actions-modal-button,html.retina.ios-gt-7 .actions-modal-label{border-bottom-width:.5px}html.retina.ios-gt-7 .actions-popover-label{border-bottom-width:.5px}html.retina.ios-gt-7 input.modal-text-input{border-width:.5px}.panel-overlay{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0);opacity:0;z-index:5999;display:none}.panel{z-index:1000;display:none;background:#111;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:auto;-webkit-overflow-scrolling:touch;position:absolute;width:260px;top:0;height:100%;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:400ms;transition-duration:400ms}.panel.panel-left.panel-cover{z-index:6000;left:-260px}.panel.panel-left.panel-reveal{left:0}.panel.panel-right.panel-cover{z-index:6000;right:-260px}.panel.panel-right.panel-reveal{right:0}body.with-panel-left-cover .views,body.with-panel-right-cover .views{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}body.with-panel-left-cover .panel-overlay,body.with-panel-right-cover .panel-overlay{display:block}body.with-panel-left-reveal .views,body.with-panel-right-reveal .views{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform}body.with-panel-left-reveal .panel-overlay,body.with-panel-right-reveal .panel-overlay{display:block}body.with-panel-left-reveal .views{-webkit-transform:translate3d(260px,0,0);-ms-transform:translate3d(260px,0,0);transform:translate3d(260px,0,0)}body.with-panel-left-reveal .panel-overlay{margin-left:260px}body.with-panel-left-cover .panel-left{-webkit-transform:translate3d(260px,0,0);-ms-transform:translate3d(260px,0,0);transform:translate3d(260px,0,0)}body.with-panel-right-reveal .views{-webkit-transform:translate3d(-260px,0,0);-ms-transform:translate3d(-260px,0,0);transform:translate3d(-260px,0,0)}body.with-panel-right-reveal .panel-overlay{margin-left:-260px}body.with-panel-right-cover .panel-right{-webkit-transform:translate3d(-260px,0,0);-ms-transform:translate3d(-260px,0,0);transform:translate3d(-260px,0,0)}body.panel-closing .views{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform}.tabs .tab{display:none}.tabs .tab.active{display:block}.tabs-animated-wrap{position:relative;width:100%;overflow:hidden;height:100%}.tabs-animated-wrap>.tabs{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;height:100%;-webkit-transition-duration:300ms;transition-duration:300ms}.tabs-animated-wrap>.tabs>.tab{width:100%;display:block;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.messages-content{background:#fff}.messages{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.messages-date{text-align:center;font-weight:500;font-size:11px;line-height:1;margin:10px 15px;color:#8e8e93}.messages-date span{font-weight:400}.message{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 10px 0;max-width:70%;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.message:first-child{margin-top:10px}.message .message-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding:6px 16px 9px;min-width:48px;min-height:35px;font-size:17px;line-height:1.2;word-break:break-word}.message.message-pic .message-text{padding:0;background:0 0}.message.message-pic img{display:block;height:auto;max-width:100%;border-radius:16px}.message-name{font-size:12px;line-height:1;color:#8e8e93;margin-bottom:2px;margin-top:7px;display:none}.message-avatar{width:29px;height:29px;border-radius:100%;margin-top:-29px;position:relative;top:1px;background-size:cover;opacity:0;-webkit-transition-duration:400ms;transition-duration:400ms}.message-sent{-ms-flex-item-align:end;-webkit-align-self:flex-end;align-self:flex-end;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end}.message-sent .message-name{margin-right:16px}.message-sent.message-with-avatar .message-text{margin-right:29px}.message-sent.message-with-avatar .message-name{margin-right:45px}.message-sent .message-text{padding-right:22px;background-color:#00d449;color:#fff;margin-left:auto;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 56% 49% 43%}.message-sent.message-last .message-text{border-radius:16px 16px 0;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 56% 49% 43%}.message-sent.message-last.message-pic img{border-radius:16px 16px 0}.message-received{-ms-flex-item-align:start;-webkit-align-self:flex-start;align-self:flex-start;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.message-received .message-text{padding-left:22px;background-color:#e5e5ea;color:#000;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 43% 49% 56%}.message-received .message-name{margin-left:16px}.message-received.message-with-avatar .message-text{margin-left:29px}.message-received.message-with-avatar .message-name{margin-left:45px}.message-received.message-last .message-text{border-radius:16px 16px 16px 0;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 43% 49% 56%}.message-received.message-last.message-pic img{border-radius:16px 16px 16px 0}.message-first .message-name{display:block}.message-last{margin-bottom:8px}.message-last .message-avatar{opacity:1}.message-appear{-webkit-animation:messageAppearFromBottom 400ms;animation:messageAppearFromBottom 400ms}.new-messages-first .message-appear{-webkit-animation:messageAppearFromTop 400ms;animation:messageAppearFromTop 400ms}html.retina.ios-6 .message,html.retina.ios-6 .message.message-pic img{-webkit-mask-box-image:none;border-radius:16px}@-webkit-keyframes messageAppearFromBottom{from{-webkit-transform:translate3d(0,100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@keyframes messageAppearFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@-webkit-keyframes messageAppearFromTop{from{-webkit-transform:translate3d(0,-100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@keyframes messageAppearFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}html.with-statusbar-overlay body{padding-top:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html.with-statusbar-overlay body .statusbar-overlay{display:block}html.with-statusbar-overlay body .panel{padding-top:20px}.statusbar-overlay{background:#f7f7f8;z-index:10000;position:absolute;left:0;top:0;height:20px;width:100%;display:none;-webkit-transition-duration:400ms;transition-duration:400ms}.preloader{display:inline-block;width:20px;height:20px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:preloader-spin 1s step-end infinite;animation:preloader-spin 1s step-end infinite}.preloader:after{display:block;content:"";width:100%;height:100%;background-image:url("data:image/svg+xml;charset=utf-8,");background-position:50%;background-size:100%;background-repeat:no-repeat}.preloader-white:after{background-image:url("data:image/svg+xml;charset=utf-8,")}@-webkit-keyframes preloader-spin{0%{-webkit-transform:rotate(0deg)}8.33333333%{-webkit-transform:rotate(30deg)}16.66666667%{-webkit-transform:rotate(60deg)}25%{-webkit-transform:rotate(90deg)}33.33333333%{-webkit-transform:rotate(120deg)}41.66666667%{-webkit-transform:rotate(150deg)}50%{-webkit-transform:rotate(180deg)}58.33333333%{-webkit-transform:rotate(210deg)}66.66666667%{-webkit-transform:rotate(240deg)}75%{-webkit-transform:rotate(270deg)}83.33333333%{-webkit-transform:rotate(300deg)}91.66666667%{-webkit-transform:rotate(330deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes preloader-spin{0%{transform:rotate(0deg)}8.33333333%{transform:rotate(30deg)}16.66666667%{transform:rotate(60deg)}25%{transform:rotate(90deg)}33.33333333%{transform:rotate(120deg)}41.66666667%{transform:rotate(150deg)}50%{transform:rotate(180deg)}58.33333333%{transform:rotate(210deg)}66.66666667%{transform:rotate(240deg)}75%{transform:rotate(270deg)}83.33333333%{transform:rotate(300deg)}91.66666667%{transform:rotate(330deg)}100%{transform:rotate(360deg)}}.pull-to-refresh-layer{position:absolute;position:relative;margin-top:-44px;left:0;top:0;width:100%;height:44px}.pull-to-refresh-layer .preloader{position:absolute;left:50%;top:50%;margin-left:-10px;margin-top:-10px;visibility:hidden}.pull-to-refresh-layer .pull-to-refresh-arrow{width:13px;height:20px;position:absolute;left:50%;top:50%;margin-left:-6px;margin-top:-10px;background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:13px 20px;z-index:10;-webkit-transform:rotate(0deg) translate3d(0,0,0);-ms-transform:rotate(0deg) translate3d(0,0,0);transform:rotate(0deg) translate3d(0,0,0);-webkit-transition-duration:300ms;transition-duration:300ms}.pull-to-refresh-content.transitioning,.pull-to-refresh-content.refreshing{-webkit-transition-duration:400ms;transition-duration:400ms}.pull-to-refresh-content:not(.refreshing) .preloader{-webkit-animation:none;animation:none}.pull-to-refresh-content.refreshing{-webkit-transform:translate3d(0,44px,0);-ms-transform:translate3d(0,44px,0);transform:translate3d(0,44px,0)}.pull-to-refresh-content.refreshing .pull-to-refresh-arrow{visibility:hidden;-webkit-transition-duration:0ms;transition-duration:0ms}.pull-to-refresh-content.refreshing .preloader{visibility:visible}.pull-to-refresh-content.pull-up .pull-to-refresh-arrow{-webkit-transform:rotate(180deg) translate3d(0,0,0);-ms-transform:rotate(180deg) translate3d(0,0,0);transform:rotate(180deg) translate3d(0,0,0)}.slider-container{position:relative;overflow:hidden;width:100%;height:100%}.slider-wrapper{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slider-container-vertical>.slider-wrapper{-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.slider-slide{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;height:100%}.slider-pagination{position:absolute;z-index:10;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0;bottom:10px;width:100%;text-align:center;-webkit-transition-duration:300ms;transition-duration:300ms;opacity:1;-webkit-transition-property:opacity;-moz-transition-property:opacity;transition-property:opacity}.slider-pagination.slider-pagination-hidden{opacity:0;pointer-events:none}.slider-container-vertical>.slider-pagination{right:10px;left:auto;top:50%;bottom:auto;width:auto;height:auto;-webkit-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.slider-container-vertical>.slider-pagination .slider-pagination-bullet{display:block;margin:5px 0}.slider-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2;margin:0 5px}.slider-pagination-active{opacity:1;background:#007aff}.photo-browser{position:absolute;left:0;top:0;width:100%;height:100%;z-index:10500}body>.photo-browser{opacity:0;display:none;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}body>.photo-browser.photo-browser-in{display:block;-webkit-animation:photoBrowserIn 400ms forwards;animation:photoBrowserIn 400ms forwards}body>.photo-browser.photo-browser-out{display:block;-webkit-animation:photoBrowserOut 400ms forwards;animation:photoBrowserOut 400ms forwards}html.with-statusbar-overlay body>.photo-browser{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}.popup>.photo-browser .navbar,body>.photo-browser .navbar,.popup>.photo-browser .toolbar,body>.photo-browser .toolbar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser .page[data-page=photo-browser-slides]{background:0 0}.photo-browser-popup{background:0 0}.photo-browser .navbar,.view[data-page=photo-browser-slides] .navbar,.photo-browser .toolbar,.view[data-page=photo-browser-slides] .toolbar{background:rgba(247,247,247,.95);-webkit-transition-duration:400ms;transition-duration:400ms}.view[data-page=photo-browser-slides] .page[data-page=photo-browser-slides] .navbar,.view[data-page=photo-browser-slides] .page[data-page=photo-browser-slides] .toolbar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-exposed .navbar,.photo-browser-exposed .toolbar{opacity:0;visibility:hidden;pointer-events:none}.photo-browser-exposed .photo-browser-slider-container{background:#000}.photo-browser-of{margin:0 5px}.photo-browser-captions{pointer-events:none;position:absolute;left:0;width:100%;bottom:0;z-index:10;opacity:1;-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-captions.photo-browser-captions-exposed{opacity:0}.toolbar~.photo-browser-captions{bottom:44px;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-exposed .toolbar~.photo-browser-captions{-webkit-transform:translate3d(0,44px,0);-ms-transform:translate3d(0,44px,0);transform:translate3d(0,44px,0)}.toolbar~.photo-browser-captions.photo-browser-captions-exposed{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-caption{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition-duration:300ms;transition-duration:300ms;position:absolute;bottom:0;left:0;opacity:0;padding:4px 5px;width:100%;text-align:center;color:#fff;background:rgba(0,0,0,.8)}.photo-browser-caption:empty{display:none}.photo-browser-caption.photo-browser-caption-active{opacity:1}.photo-browser-captions-light .photo-browser-caption{background:rgba(255,255,255,.8);color:#000}.photo-browser-exposed .photo-browser-caption{color:#fff;background:rgba(0,0,0,.8)}.photo-browser-slider-container{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;background:#fff;-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-slider-wrapper{position:absolute;left:0;top:0;width:100%;height:100%;padding:0;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.photo-browser-link-inactive{opacity:.3}.photo-browser-slide{width:100%;height:100%;position:relative;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.photo-browser-slide.transitioning{-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-slide span{width:100%;text-align:center;display:none}.photo-browser-slide img{width:auto;height:auto;max-width:100%;max-height:100%;display:none}.photo-browser-slide.slider-slide-active span,.photo-browser-slide.slider-slide-next span,.photo-browser-slide.slider-slide-prev span{display:block}.photo-browser-slide.slider-slide-active img,.photo-browser-slide.slider-slide-next img,.photo-browser-slide.slider-slide-prev img{display:inline}.photo-browser-slide iframe{width:100%;height:100%}.photo-browser-dark .navbar,.photo-browser-dark .toolbar{background:rgba(30,30,30,.8);border:none;color:#fff}.photo-browser-dark .navbar a,.photo-browser-dark .toolbar a{color:#fff}.photo-browser-dark .photo-browser-slider-container{background:#000}@-webkit-keyframes photoBrowserIn{0%{-webkit-transform:translate3d(0,0,0) scale(0.5);opacity:0}100%{-webkit-transform:translate3d(0,0,0) scale(1);opacity:1}}@keyframes photoBrowserIn{0%{transform:translate3d(0,0,0) scale(0.5);opacity:0}100%{transform:translate3d(0,0,0) scale(1);opacity:1}}@-webkit-keyframes photoBrowserOut{0%{-webkit-transform:translate3d(0,0,0) scale(1);opacity:1}100%{-webkit-transform:translate3d(0,0,0) scale(0.5);opacity:0}}@keyframes photoBrowserOut{0%{transform:translate3d(0,0,0) scale(1);opacity:1}100%{transform:translate3d(0,0,0) scale(0.5);opacity:0}}.notifications{position:absolute;left:0;top:0;width:100%;z-index:20000;color:#fff;font-size:14px;margin:0;border:none;display:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:100%;overflow:auto;-webkit-overflow-scrolling:touch;-webkit-transition-duration:450ms;transition-duration:450ms;background:rgba(0,0,0,.85);-webkit-perspective:1200px;perspective:1200px}.notifications.list-block>ul{border:none;background:0 0;margin:0}.with-statusbar-overlay .notifications{padding-top:20px;-webkit-transform:translate3d(0,-20px,0);-ms-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}.notifications .item-content{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.notifications .item-text,.notifications .item-subtitle,.notifications .item-title{font-size:14px}.notifications .item-title{font-weight:500}.notifications .item-text{height:auto;color:#d2d2d2;line-height:inherit}.notifications .item-text,.notifications .item-subtitle{font-weight:300}.notifications .item-inner{border-bottom-color:rgba(255,255,255,.2)}.notifications .item-media i.icon{width:20px;height:20px;-webkit-background-size:cover;background-size:cover;background-position:center;background-repeat:no-repeat}.notifications li.notification-item .item-media{padding-top:13px}.notifications .close-notification{width:19px;height:19px;background:url("data:image/svg+xml;charset=utf-8,") no-repeat center top;-webkit-background-size:100% auto;background-size:100% auto;position:relative}.notifications .close-notification span{position:absolute;width:44px;height:44px;left:50%;top:50%;margin-left:-22px;margin-top:-22px}.notifications .notification-item{max-width:568px;margin:0 auto;-webkit-transition-duration:450ms;transition-duration:450ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.notifications .notification-hidden{opacity:0;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.login-screen-content{background:#fff}.login-screen-content .login-screen-title,.login-screen-content .list-block,.login-screen-content .content-block,.login-screen-content .list-block-label{max-width:480px;margin:25px auto}.login-screen-content .list-block ul{border:none;background:0 0}.login-screen-content .list-block-label{text-align:center}.login-screen-title{text-align:center;font-size:30px}.disabled,[disabled]{opacity:.55;pointer-events:none}.disabled .disabled,.disabled [disabled],[disabled] .disabled,[disabled] [disabled]{opacity:1}.color-gray{color:#8e8e93}.list-block .item-link.list-button.color-gray,.tabbar a.active.color-gray,a.color-gray{color:#8e8e93}.label-switch input[type=checkbox]:checked+.checkbox.color-gray,.label-switch.color-gray input[type=checkbox]:checked+.checkbox{background-color:#8e8e93}.color-gray.button:not(.button-fill),.color-gray.buttons-row .button,.theme-gray .button:not(.button-fill){border-color:#8e8e93}html:not(.watch-active-state) .color-gray.button:not(.button-fill):active,html:not(.watch-active-state) .color-gray.buttons-row .button:active,html:not(.watch-active-state) .theme-gray .button:not(.button-fill):active,.color-gray.button:not(.button-fill).active-state,.color-gray.buttons-row .button.active-state,.theme-gray .button:not(.button-fill).active-state{background-color:rgba(142,142,147,.15)}.color-gray.button:not(.button-fill).active,.color-gray.buttons-row .button.active,.theme-gray .button:not(.button-fill).active{background-color:#8e8e93;color:#fff}.theme-gray .button.button-fill,.button.button-fill.color-gray{background:#8e8e93;color:#fff}.color-gray i.icon,.theme-gray i.icon,i.icon.color-gray,i.icon.theme-gray{color:#8e8e93}i.icon-next.color-gray,i.icon-next.theme-gray,.theme-gray i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-gray,i.icon-prev.theme-gray,.theme-gray i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-gray,i.icon-back.theme-gray,.theme-gray i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-gray,i.icon-bars.theme-gray,.theme-gray i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-gray a,.theme-gray .item-link.list-button{color:#8e8e93}.theme-gray .tabbar a,.tabbar.theme-gray a{color:inherit}.theme-gray .tabbar a.active,.tabbar.theme-gray a.active{color:#8e8e93}.theme-gray .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-gray input[type=range]::-webkit-slider-thumb:before{background-color:#8e8e93}.theme-gray label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-gray label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#8e8e93}.theme-gray label.label-radio input[type=checkbox]:checked~.item-inner,.theme-gray label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-gray .slider-pagination-active{background-color:#8e8e93}.bg-gray,.button.button-fill.bg-gray,a.bg-gray,.list-block .swipeout-actions-left a.bg-gray,.list-block .swipeout-actions-right a.bg-gray{background-color:#8e8e93}.border-gray{border-color:#8e8e93}.color-white{color:#fff}.list-block .item-link.list-button.color-white,.tabbar a.active.color-white,a.color-white{color:#fff}.label-switch input[type=checkbox]:checked+.checkbox.color-white,.label-switch.color-white input[type=checkbox]:checked+.checkbox{background-color:#fff}.color-white.button:not(.button-fill),.color-white.buttons-row .button,.theme-white .button:not(.button-fill){border-color:#fff}html:not(.watch-active-state) .color-white.button:not(.button-fill):active,html:not(.watch-active-state) .color-white.buttons-row .button:active,html:not(.watch-active-state) .theme-white .button:not(.button-fill):active,.color-white.button:not(.button-fill).active-state,.color-white.buttons-row .button.active-state,.theme-white .button:not(.button-fill).active-state{background-color:rgba(255,255,255,.15)}.color-white.button:not(.button-fill).active,.color-white.buttons-row .button.active,.theme-white .button:not(.button-fill).active{background-color:#fff;color:#fff}.theme-white .button.button-fill,.button.button-fill.color-white{background:#fff;color:#fff}.color-white i.icon,.theme-white i.icon,i.icon.color-white,i.icon.theme-white{color:#fff}i.icon-next.color-white,i.icon-next.theme-white,.theme-white i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-white,i.icon-prev.theme-white,.theme-white i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-white,i.icon-back.theme-white,.theme-white i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-white,i.icon-bars.theme-white,.theme-white i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-white a,.theme-white .item-link.list-button{color:#fff}.theme-white .tabbar a,.tabbar.theme-white a{color:inherit}.theme-white .tabbar a.active,.tabbar.theme-white a.active{color:#fff}.theme-white .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-white input[type=range]::-webkit-slider-thumb:before{background-color:#fff}.theme-white label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-white label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#fff}.theme-white label.label-radio input[type=checkbox]:checked~.item-inner,.theme-white label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-white .slider-pagination-active{background-color:#fff}.bg-white,.button.button-fill.bg-white,a.bg-white,.list-block .swipeout-actions-left a.bg-white,.list-block .swipeout-actions-right a.bg-white{background-color:#fff}.border-white{border-color:#fff}.color-black{color:#000}.list-block .item-link.list-button.color-black,.tabbar a.active.color-black,a.color-black{color:#000}.label-switch input[type=checkbox]:checked+.checkbox.color-black,.label-switch.color-black input[type=checkbox]:checked+.checkbox{background-color:#000}.color-black.button:not(.button-fill),.color-black.buttons-row .button,.theme-black .button:not(.button-fill){border-color:#000}html:not(.watch-active-state) .color-black.button:not(.button-fill):active,html:not(.watch-active-state) .color-black.buttons-row .button:active,html:not(.watch-active-state) .theme-black .button:not(.button-fill):active,.color-black.button:not(.button-fill).active-state,.color-black.buttons-row .button.active-state,.theme-black .button:not(.button-fill).active-state{background-color:rgba(0,0,0,.15)}.color-black.button:not(.button-fill).active,.color-black.buttons-row .button.active,.theme-black .button:not(.button-fill).active{background-color:#000;color:#fff}.theme-black .button.button-fill,.button.button-fill.color-black{background:#000;color:#fff}.color-black i.icon,.theme-black i.icon,i.icon.color-black,i.icon.theme-black{color:#000}i.icon-next.color-black,i.icon-next.theme-black,.theme-black i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-black,i.icon-prev.theme-black,.theme-black i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-black,i.icon-back.theme-black,.theme-black i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-black,i.icon-bars.theme-black,.theme-black i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-black a,.theme-black .item-link.list-button{color:#000}.theme-black .tabbar a,.tabbar.theme-black a{color:inherit}.theme-black .tabbar a.active,.tabbar.theme-black a.active{color:#000}.theme-black .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-black input[type=range]::-webkit-slider-thumb:before{background-color:#000}.theme-black label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-black label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#000}.theme-black label.label-radio input[type=checkbox]:checked~.item-inner,.theme-black label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-black .slider-pagination-active{background-color:#000}.bg-black,.button.button-fill.bg-black,a.bg-black,.list-block .swipeout-actions-left a.bg-black,.list-block .swipeout-actions-right a.bg-black{background-color:#000}.border-black{border-color:#000}.color-lightblue{color:#5ac8fa}.list-block .item-link.list-button.color-lightblue,.tabbar a.active.color-lightblue,a.color-lightblue{color:#5ac8fa}.label-switch input[type=checkbox]:checked+.checkbox.color-lightblue,.label-switch.color-lightblue input[type=checkbox]:checked+.checkbox{background-color:#5ac8fa}.color-lightblue.button:not(.button-fill),.color-lightblue.buttons-row .button,.theme-lightblue .button:not(.button-fill){border-color:#5ac8fa}html:not(.watch-active-state) .color-lightblue.button:not(.button-fill):active,html:not(.watch-active-state) .color-lightblue.buttons-row .button:active,html:not(.watch-active-state) .theme-lightblue .button:not(.button-fill):active,.color-lightblue.button:not(.button-fill).active-state,.color-lightblue.buttons-row .button.active-state,.theme-lightblue .button:not(.button-fill).active-state{background-color:rgba(90,200,250,.15)}.color-lightblue.button:not(.button-fill).active,.color-lightblue.buttons-row .button.active,.theme-lightblue .button:not(.button-fill).active{background-color:#5ac8fa;color:#fff}.theme-lightblue .button.button-fill,.button.button-fill.color-lightblue{background:#5ac8fa;color:#fff}.color-lightblue i.icon,.theme-lightblue i.icon,i.icon.color-lightblue,i.icon.theme-lightblue{color:#5ac8fa}i.icon-next.color-lightblue,i.icon-next.theme-lightblue,.theme-lightblue i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-lightblue,i.icon-prev.theme-lightblue,.theme-lightblue i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-lightblue,i.icon-back.theme-lightblue,.theme-lightblue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-lightblue,i.icon-bars.theme-lightblue,.theme-lightblue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-lightblue a,.theme-lightblue .item-link.list-button{color:#5ac8fa}.theme-lightblue .tabbar a,.tabbar.theme-lightblue a{color:inherit}.theme-lightblue .tabbar a.active,.tabbar.theme-lightblue a.active{color:#5ac8fa}.theme-lightblue .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-lightblue input[type=range]::-webkit-slider-thumb:before{background-color:#5ac8fa}.theme-lightblue label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-lightblue label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#5ac8fa}.theme-lightblue label.label-radio input[type=checkbox]:checked~.item-inner,.theme-lightblue label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-lightblue .slider-pagination-active{background-color:#5ac8fa}.bg-lightblue,.button.button-fill.bg-lightblue,a.bg-lightblue,.list-block .swipeout-actions-left a.bg-lightblue,.list-block .swipeout-actions-right a.bg-lightblue{background-color:#5ac8fa}.border-lightblue{border-color:#5ac8fa}.color-yellow{color:#fc0}.list-block .item-link.list-button.color-yellow,.tabbar a.active.color-yellow,a.color-yellow{color:#fc0}.label-switch input[type=checkbox]:checked+.checkbox.color-yellow,.label-switch.color-yellow input[type=checkbox]:checked+.checkbox{background-color:#fc0}.color-yellow.button:not(.button-fill),.color-yellow.buttons-row .button,.theme-yellow .button:not(.button-fill){border-color:#fc0}html:not(.watch-active-state) .color-yellow.button:not(.button-fill):active,html:not(.watch-active-state) .color-yellow.buttons-row .button:active,html:not(.watch-active-state) .theme-yellow .button:not(.button-fill):active,.color-yellow.button:not(.button-fill).active-state,.color-yellow.buttons-row .button.active-state,.theme-yellow .button:not(.button-fill).active-state{background-color:rgba(255,204,0,.15)}.color-yellow.button:not(.button-fill).active,.color-yellow.buttons-row .button.active,.theme-yellow .button:not(.button-fill).active{background-color:#fc0;color:#fff}.theme-yellow .button.button-fill,.button.button-fill.color-yellow{background:#fc0;color:#fff}.color-yellow i.icon,.theme-yellow i.icon,i.icon.color-yellow,i.icon.theme-yellow{color:#fc0}i.icon-next.color-yellow,i.icon-next.theme-yellow,.theme-yellow i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-yellow,i.icon-prev.theme-yellow,.theme-yellow i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-yellow,i.icon-back.theme-yellow,.theme-yellow i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-yellow,i.icon-bars.theme-yellow,.theme-yellow i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-yellow a,.theme-yellow .item-link.list-button{color:#fc0}.theme-yellow .tabbar a,.tabbar.theme-yellow a{color:inherit}.theme-yellow .tabbar a.active,.tabbar.theme-yellow a.active{color:#fc0}.theme-yellow .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-yellow input[type=range]::-webkit-slider-thumb:before{background-color:#fc0}.theme-yellow label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-yellow label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#fc0}.theme-yellow label.label-radio input[type=checkbox]:checked~.item-inner,.theme-yellow label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-yellow .slider-pagination-active{background-color:#fc0}.bg-yellow,.button.button-fill.bg-yellow,a.bg-yellow,.list-block .swipeout-actions-left a.bg-yellow,.list-block .swipeout-actions-right a.bg-yellow{background-color:#fc0}.border-yellow{border-color:#fc0}.color-orange{color:#ff9500}.list-block .item-link.list-button.color-orange,.tabbar a.active.color-orange,a.color-orange{color:#ff9500}.label-switch input[type=checkbox]:checked+.checkbox.color-orange,.label-switch.color-orange input[type=checkbox]:checked+.checkbox{background-color:#ff9500}.color-orange.button:not(.button-fill),.color-orange.buttons-row .button,.theme-orange .button:not(.button-fill){border-color:#ff9500}html:not(.watch-active-state) .color-orange.button:not(.button-fill):active,html:not(.watch-active-state) .color-orange.buttons-row .button:active,html:not(.watch-active-state) .theme-orange .button:not(.button-fill):active,.color-orange.button:not(.button-fill).active-state,.color-orange.buttons-row .button.active-state,.theme-orange .button:not(.button-fill).active-state{background-color:rgba(255,149,0,.15)}.color-orange.button:not(.button-fill).active,.color-orange.buttons-row .button.active,.theme-orange .button:not(.button-fill).active{background-color:#ff9500;color:#fff}.theme-orange .button.button-fill,.button.button-fill.color-orange{background:#ff9500;color:#fff}.color-orange i.icon,.theme-orange i.icon,i.icon.color-orange,i.icon.theme-orange{color:#ff9500}i.icon-next.color-orange,i.icon-next.theme-orange,.theme-orange i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-orange,i.icon-prev.theme-orange,.theme-orange i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-orange,i.icon-back.theme-orange,.theme-orange i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-orange,i.icon-bars.theme-orange,.theme-orange i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-orange a,.theme-orange .item-link.list-button{color:#ff9500}.theme-orange .tabbar a,.tabbar.theme-orange a{color:inherit}.theme-orange .tabbar a.active,.tabbar.theme-orange a.active{color:#ff9500}.theme-orange .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-orange input[type=range]::-webkit-slider-thumb:before{background-color:#ff9500}.theme-orange label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-orange label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff9500}.theme-orange label.label-radio input[type=checkbox]:checked~.item-inner,.theme-orange label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-orange .slider-pagination-active{background-color:#ff9500}.bg-orange,.button.button-fill.bg-orange,a.bg-orange,.list-block .swipeout-actions-left a.bg-orange,.list-block .swipeout-actions-right a.bg-orange{background-color:#ff9500}.border-orange{border-color:#ff9500}.color-pink{color:#ff2d55}.list-block .item-link.list-button.color-pink,.tabbar a.active.color-pink,a.color-pink{color:#ff2d55}.label-switch input[type=checkbox]:checked+.checkbox.color-pink,.label-switch.color-pink input[type=checkbox]:checked+.checkbox{background-color:#ff2d55}.color-pink.button:not(.button-fill),.color-pink.buttons-row .button,.theme-pink .button:not(.button-fill){border-color:#ff2d55}html:not(.watch-active-state) .color-pink.button:not(.button-fill):active,html:not(.watch-active-state) .color-pink.buttons-row .button:active,html:not(.watch-active-state) .theme-pink .button:not(.button-fill):active,.color-pink.button:not(.button-fill).active-state,.color-pink.buttons-row .button.active-state,.theme-pink .button:not(.button-fill).active-state{background-color:rgba(255,45,85,.15)}.color-pink.button:not(.button-fill).active,.color-pink.buttons-row .button.active,.theme-pink .button:not(.button-fill).active{background-color:#ff2d55;color:#fff}.theme-pink .button.button-fill,.button.button-fill.color-pink{background:#ff2d55;color:#fff}.color-pink i.icon,.theme-pink i.icon,i.icon.color-pink,i.icon.theme-pink{color:#ff2d55}i.icon-next.color-pink,i.icon-next.theme-pink,.theme-pink i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-pink,i.icon-prev.theme-pink,.theme-pink i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-pink,i.icon-back.theme-pink,.theme-pink i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-pink,i.icon-bars.theme-pink,.theme-pink i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-pink a,.theme-pink .item-link.list-button{color:#ff2d55}.theme-pink .tabbar a,.tabbar.theme-pink a{color:inherit}.theme-pink .tabbar a.active,.tabbar.theme-pink a.active{color:#ff2d55}.theme-pink .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-pink input[type=range]::-webkit-slider-thumb:before{background-color:#ff2d55}.theme-pink label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-pink label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff2d55}.theme-pink label.label-radio input[type=checkbox]:checked~.item-inner,.theme-pink label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-pink .slider-pagination-active{background-color:#ff2d55}.bg-pink,.button.button-fill.bg-pink,a.bg-pink,.list-block .swipeout-actions-left a.bg-pink,.list-block .swipeout-actions-right a.bg-pink{background-color:#ff2d55}.border-pink{border-color:#ff2d55}.color-blue{color:#007aff}.list-block .item-link.list-button.color-blue,.tabbar a.active.color-blue,a.color-blue{color:#007aff}.label-switch input[type=checkbox]:checked+.checkbox.color-blue,.label-switch.color-blue input[type=checkbox]:checked+.checkbox{background-color:#007aff}.color-blue.button:not(.button-fill),.color-blue.buttons-row .button,.theme-blue .button:not(.button-fill){border-color:#007aff}html:not(.watch-active-state) .color-blue.button:not(.button-fill):active,html:not(.watch-active-state) .color-blue.buttons-row .button:active,html:not(.watch-active-state) .theme-blue .button:not(.button-fill):active,.color-blue.button:not(.button-fill).active-state,.color-blue.buttons-row .button.active-state,.theme-blue .button:not(.button-fill).active-state{background-color:rgba(0,122,255,.15)}.color-blue.button:not(.button-fill).active,.color-blue.buttons-row .button.active,.theme-blue .button:not(.button-fill).active{background-color:#007aff;color:#fff}.theme-blue .button.button-fill,.button.button-fill.color-blue{background:#007aff;color:#fff}.color-blue i.icon,.theme-blue i.icon,i.icon.color-blue,i.icon.theme-blue{color:#007aff}i.icon-next.color-blue,i.icon-next.theme-blue,.theme-blue i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-blue,i.icon-prev.theme-blue,.theme-blue i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-blue,i.icon-back.theme-blue,.theme-blue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-blue,i.icon-bars.theme-blue,.theme-blue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-blue a,.theme-blue .item-link.list-button{color:#007aff}.theme-blue .tabbar a,.tabbar.theme-blue a{color:inherit}.theme-blue .tabbar a.active,.tabbar.theme-blue a.active{color:#007aff}.theme-blue .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-blue input[type=range]::-webkit-slider-thumb:before{background-color:#007aff}.theme-blue label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-blue label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#007aff}.theme-blue label.label-radio input[type=checkbox]:checked~.item-inner,.theme-blue label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-blue .slider-pagination-active{background-color:#007aff}.bg-blue,.button.button-fill.bg-blue,a.bg-blue,.list-block .swipeout-actions-left a.bg-blue,.list-block .swipeout-actions-right a.bg-blue{background-color:#007aff}.border-blue{border-color:#007aff}.color-green{color:#4cd964}.list-block .item-link.list-button.color-green,.tabbar a.active.color-green,a.color-green{color:#4cd964}.label-switch input[type=checkbox]:checked+.checkbox.color-green,.label-switch.color-green input[type=checkbox]:checked+.checkbox{background-color:#4cd964}.color-green.button:not(.button-fill),.color-green.buttons-row .button,.theme-green .button:not(.button-fill){border-color:#4cd964}html:not(.watch-active-state) .color-green.button:not(.button-fill):active,html:not(.watch-active-state) .color-green.buttons-row .button:active,html:not(.watch-active-state) .theme-green .button:not(.button-fill):active,.color-green.button:not(.button-fill).active-state,.color-green.buttons-row .button.active-state,.theme-green .button:not(.button-fill).active-state{background-color:rgba(76,217,100,.15)}.color-green.button:not(.button-fill).active,.color-green.buttons-row .button.active,.theme-green .button:not(.button-fill).active{background-color:#4cd964;color:#fff}.theme-green .button.button-fill,.button.button-fill.color-green{background:#4cd964;color:#fff}.color-green i.icon,.theme-green i.icon,i.icon.color-green,i.icon.theme-green{color:#4cd964}i.icon-next.color-green,i.icon-next.theme-green,.theme-green i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-green,i.icon-prev.theme-green,.theme-green i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-green,i.icon-back.theme-green,.theme-green i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-green,i.icon-bars.theme-green,.theme-green i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-green a,.theme-green .item-link.list-button{color:#4cd964}.theme-green .tabbar a,.tabbar.theme-green a{color:inherit}.theme-green .tabbar a.active,.tabbar.theme-green a.active{color:#4cd964}.theme-green .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-green input[type=range]::-webkit-slider-thumb:before{background-color:#4cd964}.theme-green label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-green label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#4cd964}.theme-green label.label-radio input[type=checkbox]:checked~.item-inner,.theme-green label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-green .slider-pagination-active{background-color:#4cd964}.bg-green,.button.button-fill.bg-green,a.bg-green,.list-block .swipeout-actions-left a.bg-green,.list-block .swipeout-actions-right a.bg-green{background-color:#4cd964}.border-green{border-color:#4cd964}.color-red{color:#ff3b30}.list-block .item-link.list-button.color-red,.tabbar a.active.color-red,a.color-red{color:#ff3b30}.label-switch input[type=checkbox]:checked+.checkbox.color-red,.label-switch.color-red input[type=checkbox]:checked+.checkbox{background-color:#ff3b30}.color-red.button:not(.button-fill),.color-red.buttons-row .button,.theme-red .button:not(.button-fill){border-color:#ff3b30}html:not(.watch-active-state) .color-red.button:not(.button-fill):active,html:not(.watch-active-state) .color-red.buttons-row .button:active,html:not(.watch-active-state) .theme-red .button:not(.button-fill):active,.color-red.button:not(.button-fill).active-state,.color-red.buttons-row .button.active-state,.theme-red .button:not(.button-fill).active-state{background-color:rgba(255,59,48,.15)}.color-red.button:not(.button-fill).active,.color-red.buttons-row .button.active,.theme-red .button:not(.button-fill).active{background-color:#ff3b30;color:#fff}.theme-red .button.button-fill,.button.button-fill.color-red{background:#ff3b30;color:#fff}.color-red i.icon,.theme-red i.icon,i.icon.color-red,i.icon.theme-red{color:#ff3b30}i.icon-next.color-red,i.icon-next.theme-red,.theme-red i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-red,i.icon-prev.theme-red,.theme-red i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-red,i.icon-back.theme-red,.theme-red i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-red,i.icon-bars.theme-red,.theme-red i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}.theme-red a,.theme-red .item-link.list-button{color:#ff3b30}.theme-red .tabbar a,.tabbar.theme-red a{color:inherit}.theme-red .tabbar a.active,.tabbar.theme-red a.active{color:#ff3b30}.theme-red .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-red input[type=range]::-webkit-slider-thumb:before{background-color:#ff3b30}.theme-red label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-red label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff3b30}.theme-red label.label-radio input[type=checkbox]:checked~.item-inner,.theme-red label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-red .slider-pagination-active{background-color:#ff3b30}.bg-red,.button.button-fill.bg-red,a.bg-red,.list-block .swipeout-actions-left a.bg-red,.list-block .swipeout-actions-right a.bg-red{background-color:#ff3b30}.border-red{border-color:#ff3b30} \ No newline at end of file diff --git a/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.js b/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.js deleted file mode 100755 index adf2042e..00000000 --- a/examples/raspberry_pi_mjpeg_led/web_root/framework7.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Framework7 0.9.6 - * Full Featured HTML Framework For Building iOS 7 Apps - * - * http://www.idangero.us/framework7 - * - * Copyright 2014, Vladimir Kharlampidi - * The iDangero.us - * http://www.idangero.us/ - * - * Licensed under MIT - * - * Released on: September 13, 2014 -*/ -!function(){"use strict";window.Framework7=function(b){function c(a){var b=a.replace(/^./,function(a){return a.toUpperCase()});l["onPage"+b]=function(b,c){return l.onPage(a,b,c)}}function d(a,b,c){b=n(b);var d=b.find(a);return d.length>1&&("string"==typeof c.selector&&(d=b.find(c.selector+" "+a)),d.length>1&&(d=b.find("."+l.params.viewMainClass+" "+a))),1===d.length?d:void 0}function e(a,b,c){"to-left"===c&&(a.removeClass("page-on-center").addClass("page-from-center-to-left"),b.addClass("page-from-right-to-center")),"to-right"===c&&(a.removeClass("page-on-left").addClass("page-from-left-to-center"),b.removeClass("page-on-center").addClass("page-from-center-to-right"))}function f(a,b,c){"to-left"===c&&(b.removeClass("navbar-on-right").addClass("navbar-from-right-to-center"),b.find(".sliding").each(function(){var a=n(this);a.transform("translate3d(0px,0,0)"),l.params.animateNavBackIcon&&a.hasClass("left")&&a.find(".back .icon").length>0&&a.find(".back .icon").transform("translate3d(0px,0,0)")}),a.removeClass("navbar-on-center").addClass("navbar-from-center-to-left"),a.find(".sliding").each(function(){var a=n(this);l.params.animateNavBackIcon&&(a.hasClass("center")&&b.find(".sliding.left .back .icon").length>0&&(this.f7NavbarLeftOffset+=b.find(".sliding.left .back span")[0].offsetLeft),a.hasClass("left")&&a.find(".back .icon").length>0&&a.find(".back .icon").transform("translate3d("+-this.f7NavbarLeftOffset+"px,0,0)")),a.transform("translate3d("+this.f7NavbarLeftOffset+"px,0,0)")})),"to-right"===c&&(a.removeClass("navbar-on-left").addClass("navbar-from-left-to-center"),a.find(".sliding").each(function(){var a=n(this);a.transform("translate3d(0px,0,0)"),l.params.animateNavBackIcon&&a.hasClass("left")&&a.find(".back .icon").length>0&&a.find(".back .icon").transform("translate3d(0px,0,0)")}),b.removeClass("navbar-on-center").addClass("navbar-from-center-to-right"),b.find(".sliding").each(function(){var a=n(this);l.params.animateNavBackIcon&&a.hasClass("left")&&a.find(".back .icon").length>0&&a.find(".back .icon").transform("translate3d("+-this.f7NavbarRightOffset+"px,0,0)"),a.transform("translate3d("+this.f7NavbarRightOffset+"px,0,0)")}))}function g(a,b,c,e){var f,g,h,i,j,k,m,o,p=n(a.container),q=n(a.pagesContainer);if(l.pluginHook("loadPage",a,b,c),l._tempDomElement.innerHTML="",b||"string"==typeof c)l._tempDomElement.innerHTML=c;else if("length"in c&&c.length>1)for(var r=0;r1)for(var v=0;v1){for(m=0;m0)){for(m=0;m0&&a.find(".back .icon").transform("translate3d("+-this.f7NavbarRightOffset+"px,0,0)")});i[0].clientLeft;l.pageAnimCallbacks("before",a,{pageContainer:i[0],url:b,position:"right",oldPage:j,newPage:i}),u?(e(j,i,"to-left",a),r&&setTimeout(function(){f(o,p,"to-left",a)},0),i.animationEnd(function(){h()})):h()}function i(a,b,c){l.pluginHook("preprocess",a,b,c),a=l.pluginProcess("preprocess",a),l.params.preprocess?(a=l.params.preprocess(a,b,c),"undefined"!=typeof a&&c(a)):c(a)}function j(){var a=this,b=a.scrollTop,c=a.scrollHeight,d=a.offsetHeight,e=a.getAttribute("data-distance");e||(e=50),"string"==typeof e&&e.indexOf("%")>=0&&(e=parseInt(e,10)/100*d),e>d&&(e=d),b+d>=c-e&&n(a).trigger("infinite")}function k(){l.device.ipad&&(document.body.scrollLeft=0,setTimeout(function(){document.body.scrollLeft=0},0))}var l=this;l.version="0.9.6",l.params={cache:!0,cacheIgnore:[],cacheIgnoreGetParameters:!1,cacheDuration:6e5,preloadPreviousPage:!0,uniqueHistory:!1,pushState:!1,pushStateRoot:void 0,pushStateNoAnimation:!1,pushStateSeparator:"#!/",fastClicks:!0,fastClicksDistanceThreshold:0,activeState:!0,activeStateElements:"a, button, label, span",animateNavBackIcon:!1,swipeBackPage:!0,swipeBackPageThreshold:0,swipeBackPageActiveArea:30,swipeBackPageBoxShadow:!0,ajaxLinks:void 0,externalLinks:["external"],sortable:!0,swipeout:!0,swipeoutNoFollow:!1,smartSelectBackTemplate:'',smartSelectBackText:"Back",smartSelectSearchbar:!1,smartSelectBackOnSelect:!1,searchbarHideDividers:!0,searchbarHideGroups:!0,swipePanel:!1,swipePanelActiveArea:0,swipePanelCloseOpposite:!0,swipePanelNoFollow:!1,swipePanelThreshold:0,panelsCloseByOutside:!0,modalButtonOk:"OK",modalButtonCancel:"Cancel",modalUsernamePlaceholder:"Username",modalPasswordPlaceholder:"Password",modalTitle:"Framework7",modalCloseByOutside:!1,actionsCloseByOutside:!0,popupCloseByOutside:!0,modalPreloaderTitle:"Loading... ",init:!0,viewClass:"view",viewMainClass:"view-main",viewsClass:"views",notificationCloseOnClick:!1,notificationCloseIcon:!0,animatePages:!0};for(var m in b)l.params[m]=b[m];var n=a,o=Template7;l._compiledTemplates={},l.touchEvents={start:l.support.touch?"touchstart":"mousedown",move:l.support.touch?"touchmove":"mousemove",end:l.support.touch?"touchend":"mouseup"},l.ls=localStorage,l.rtl="rtl"===n("body").css("direction"),l.rtl&&n("html").attr("dir","rtl"),"undefined"!=typeof l.params.statusbarOverlay&&(l.params.statusbarOverlay?n("html").addClass("with-statusbar-overlay"):n("html").removeClass("with-statusbar-overlay")),l.globalEventListeners={},l.initGlobalEventListeners=function(){function a(a){var b;n(document).on(a,function(c){for(b=0;b0;return("string"==typeof b||b.nodeType||"length"in b)&&(b=d?{content:b}:{url:b}),c.indexOf("reload")>=0&&(b.reload=!0,c.indexOf("previous")>=0&&(b.reloadPrevious=!0)),c.indexOf("refresh")>=0&&(b.url=c.indexOf("previous")>=0?f.history[f.history.length-2]:f.url,b.reload=!0,b.ignoreCache=!0,c.indexOf("previous")>=0&&(b.reloadPrevious=!0)),l.loadPage(f,b)}}var d={dynamicNavbar:!1,domCache:!1,linksView:void 0,uniqueHistory:l.params.uniqueHistory,swipeBackPage:l.params.swipeBackPage,swipeBackPageBoxShadow:l.params.swipeBackPageBoxShadow,swipeBackPageActiveArea:l.params.swipeBackPageActiveArea,swipeBackPageThreshold:l.params.swipeBackPageThreshold,animatePages:l.params.animatePages,preloadPreviousPage:l.params.preloadPreviousPage};b=b||{};for(var e in d)"undefined"==typeof b[e]&&(b[e]=d[e]);var f=this;f.params=b,f.selector=a;var g=n(a);f.container=g[0];var h=document.location.href;f.history=[];var i=h,j=l.params.pushStateSeparator,k=l.params.pushStateRoot;if(l.params.pushState&&(k?i=k:i.indexOf(j)>=0&&i.indexOf(j+"#")<0&&(i=i.split(j)[0])),f.url=g.attr("data-url")||f.params.url||i,f.url&&f.history.push(f.url),f.contentCache={},g[0].f7View=f,f.pagesContainer=g.find(".pages")[0],f.allowPageChange=!0,!f.activePage){var m,o=n(f.pagesContainer).find(".page-on-center");0===o.length&&(o=n(f.pagesContainer).find(".page"),o=o.eq(o.length-1)),o.length>0&&(m=o[0].f7PageData),m&&(m.view=f,f.url&&(m.url=f.url),f.activePage=m,o[0].f7PageData=m)}f.main=g.hasClass(l.params.viewMainClass);var p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=!1,E=!1,F={},G=!0;f.handleTouchStart=function(a){G&&f.params.swipeBackPage&&!D&&!l.swipeoutOpenedEl&&(E=!1,D=!0,p=void 0,F.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,F.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,u=(new Date).getTime(),B=f.params.dynamicNavbar&&g.find(".navbar-inner").length>1)},f.handleTouchMove=function(a){if(D){var b="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,c="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY;if("undefined"==typeof p&&(p=!!(p||Math.abs(c-F.y)>Math.abs(b-F.x))),p||a.f7PreventSwipeBack||l.preventSwipeBack)return void(D=!1);if(!E){var d=!1;s=g.width();var e=n(a.target),h=e.hasClass("swipeout")?e:e.parents(".swipeout");h.length>0&&(!l.rtl&&h.find(".swipeout-actions-left").length>0&&(d=!0),l.rtl&&h.find(".swipeout-actions-right").length>0&&(d=!0)),q=e.is(".page")?e:e.parents(".page"),q.hasClass("no-swipeback")&&(d=!0),r=g.find(".page-on-left:not(.cached)");var i=F.x-g.offset().left>f.params.swipeBackPageActiveArea;if(i=l.rtl?F.xf.params.swipeBackPageActiveArea,i&&(d=!0),(0===r.length||0===q.length)&&(d=!0),d)return void(D=!1);B&&(v=g.find(".navbar-on-center:not(.cached)"),w=g.find(".navbar-on-left:not(.cached)"),x=v.find(".left, .center, .right"),y=w.find(".left, .center, .right"),l.params.animateNavBackIcon&&(z=v.find(".left.sliding .back .icon"),A=w.find(".left.sliding .back .icon")))}a.f7PreventPanelSwipe=!0,E=!0,a.preventDefault();var j=l.rtl?-1:1;t=(b-F.x-f.params.swipeBackPageThreshold)*j,0>t&&(t=0);var k=t/s,m={percentage:k,activePage:q[0],previousPage:r[0],activeNavbar:v[0],previousNavbar:w[0]};f.params.onSwipeBackMove&&f.params.onSwipeBackMove(m),g.trigger("swipebackmove",m);var o=t*j,u=(t/5-s/5)*j;if(1===l.device.pixelRatio&&(o=Math.round(o),u=Math.round(u)),q.transform("translate3d("+o+"px,0,0)"),f.params.swipeBackPageBoxShadow&&"android"!==l.device.os&&(q[0].style.boxShadow="0px 0px 12px rgba(0,0,0,"+(.5-.5*k)+")"),r.transform("translate3d("+u+"px,0,0)"),r[0].style.opacity=.9+.1*k,B){var G;for(G=0;G=0){var H=k*C[0].f7NavbarRightOffset;1===l.device.pixelRatio&&(H=Math.round(H)),C.transform("translate3d("+H+"px,0,0)"),l.params.animateNavBackIcon&&C[0].className.indexOf("left")>=0&&z.length>0&&z.transform("translate3d("+-H+"px,0,0)")}for(G=0;G=0){var I=C[0].f7NavbarLeftOffset*(1-k);1===l.device.pixelRatio&&(I=Math.round(I)),C.transform("translate3d("+I+"px,0,0)"),l.params.animateNavBackIcon&&C[0].className.indexOf("left")>=0&&A.length>0&&A.transform("translate3d("+-I+"px,0,0)")}}}},f.handleTouchEnd=function(){if(!D||!E)return D=!1,void(E=!1);if(D=!1,E=!1,0===t)return n([q[0],r[0]]).transform("").css({opacity:"",boxShadow:""}),void(B&&(x.transform("").css({opacity:""}),y.transform("").css({opacity:""}),z&&z.length>0&&z.transform(""),A&&z.length>0&&A.transform("")));var a=(new Date).getTime()-u,b=!1;if((300>a&&t>10||a>=300&&t>s/2)&&(q.removeClass("page-on-center").addClass("page-on-right"),r.removeClass("page-on-left").addClass("page-on-center"),B&&(v.removeClass("navbar-on-center").addClass("navbar-on-right"),w.removeClass("navbar-on-left").addClass("navbar-on-center")),b=!0),n([q[0],r[0]]).transform("").css({opacity:"",boxShadow:""}).addClass("page-transitioning"),B&&(x.css({opacity:""}).each(function(){var a=b?this.f7NavbarRightOffset:0,c=n(this);c.transform("translate3d("+a+"px,0,0)"),l.params.animateNavBackIcon&&c.hasClass("left")&&z.length>0&&z.addClass("page-transitioning").transform("translate3d("+-a+"px,0,0)")}).addClass("page-transitioning"),y.transform("").css({opacity:""}).each(function(){var a=b?0:this.f7NavbarLeftOffset,c=n(this);c.transform("translate3d("+a+"px,0,0)"),l.params.animateNavBackIcon&&c.hasClass("left")&&A.length>0&&A.addClass("page-transitioning").transform("translate3d("+-a+"px,0,0)")}).addClass("page-transitioning")),G=!1,f.allowPageChange=!1,b){var c=f.history[f.history.length-2];f.url=c,l.pageAnimCallbacks("before",f,{pageContainer:r[0],url:c,position:"left",newPage:r,oldPage:q,swipeBack:!0})}q.transitionEnd(function(){n([q[0],r[0]]).removeClass("page-transitioning"),B&&(x.removeClass("page-transitioning").css({opacity:""}),y.removeClass("page-transitioning").css({opacity:""}),z&&z.length>0&&z.removeClass("page-transitioning"),A&&A.length>0&&A.removeClass("page-transitioning")),G=!0,f.allowPageChange=!0,b&&(l.params.pushState&&history.back(),l.pageAnimCallbacks("after",f,{pageContainer:r[0],url:c,position:"left",newPage:r,oldPage:q,swipeBack:!0}),l.afterGoBack(f,q,r))})},f.attachEvents=function(a){var b=a?"off":"on";g[b](l.touchEvents.start,f.handleTouchStart),g[b](l.touchEvents.move,f.handleTouchMove),g[b](l.touchEvents.end,f.handleTouchEnd)},f.detachEvents=function(){f.attachEvents(!0)},f.params.swipeBackPage&&f.attachEvents(),l.views.push(f),f.main&&(l.mainView=f);for(var H="loadPage loadContent reloadPage reloadContent reloadPreviousPage reloadPreviousContent refreshPage refreshPreviousPage".split(" "),I=0;I=0&&h.indexOf(j+"#")<0&&(J=h.split(j)[1]);var K=l.params.pushStateNoAnimation?!1:void 0;J&&l.loadPage(f,{url:J,animatePages:K,pushState:!1})}return f.destroy=function(){f.detachEvents(),f=void 0},l.pluginHook("addView",f),f};l.addView=function(a,b){return new p(a,b)},l.navbarInitCallback=function(a,b,c,d,e,f){var g={container:c,innerContainer:d},h={url:e,query:n.parseUrlQuery(e||""),container:b,name:n(b).attr("data-page"),view:a,from:f},i={navbar:g,page:h};l.pluginHook("navbarInit",g,h),n(d).trigger("navbarInit",i)},l.sizeNavbars=function(a){var b=a?n(a).find(".navbar .navbar-inner:not(.cached)"):n(".navbar .navbar-inner:not(.cached)");b.each(function(){var a,b,c=n(this),d=c.find(l.rtl?".right":".left"),e=c.find(l.rtl?".left":".right"),f=c.find(".center"),g=0===d.length,h=0===e.length,i=g?0:d.outerWidth(!0),j=h?0:e.outerWidth(!0),k=f.outerWidth(!0),m=c.width(),o=c.hasClass("navbar-on-left");h&&(a=m-k),g&&(a=0),g||h||(a=(m-j-k+i)/2);var p=(m-k)/2;m-i-j>k?(i>p&&(p=i),p+k>m-j&&(p=m-j-k),b=p-a):b=0;var q=l.rtl?-1:1,r=b;l.rtl&&g&&h&&f.length>0&&(r=-r),f.css({left:r+"px"}),f.hasClass("sliding")&&(f[0].f7NavbarLeftOffset=-(a+b)*q,f[0].f7NavbarRightOffset=(m-a-b-k)*q,o&&f.transform("translate3d("+f[0].f7NavbarLeftOffset+"px, 0, 0)")),!g&&d.hasClass("sliding")&&(l.rtl?(d[0].f7NavbarLeftOffset=-(m-d.outerWidth())/2*q,d[0].f7NavbarRightOffset=i*q):(d[0].f7NavbarLeftOffset=-i,d[0].f7NavbarRightOffset=(m-d.outerWidth())/2),o&&d.transform("translate3d("+d[0].f7NavbarLeftOffset+"px, 0, 0)")),!h&&e.hasClass("sliding")&&(l.rtl?(e[0].f7NavbarLeftOffset=-j*q,e[0].f7NavbarRightOffset=(m-e.outerWidth())/2*q):(e[0].f7NavbarLeftOffset=-(m-e.outerWidth())/2,e[0].f7NavbarRightOffset=j),o&&e.transform("translate3d("+e[0].f7NavbarLeftOffset+"px, 0, 0)"))})},l.hideNavbar=function(a){return n(a).addClass("hidden-navbar"),!0},l.showNavbar=function(a){var b=n(a);return b.addClass("hiding-navbar").removeClass("hidden-navbar").find(".navbar").transitionEnd(function(){b.removeClass("hiding-navbar")}),!0},l.hideToolbar=function(a){return n(a).addClass("hidden-toolbar"),!0},l.showToolbar=function(a){var b=n(a);b.addClass("hiding-toolbar").removeClass("hidden-toolbar").find(".toolbar").transitionEnd(function(){b.removeClass("hiding-toolbar")})},l.initSearchbar=function(a){function b(){o.val("").trigger("change"),k.removeClass("searchbar-active searchbar-not-empty"),q.length>0&&q.css(w,-v+"px"),r&&m.removeClass("searchbar-overlay-active"),l.device.ios?setTimeout(function(){o.blur()},400):o.blur()}function c(){l.device.ios?setTimeout(function(){r&&!k.hasClass("searchbar-active")&&m.addClass("searchbar-overlay-active"),k.addClass("searchbar-active"),q.length>0&&q.css(w,"0px"),r.trigger("enableSearch")},400):(r&&!k.hasClass("searchbar-active")&&m.addClass("searchbar-overlay-active"),k.addClass("searchbar-active"),q.length>0&&q.css(w,"0px"),r.trigger("disableSearch"))}function d(){o.val("").trigger("change"),r.trigger("clearSearch")}function e(){setTimeout(function(){var a=o.val().trim();0===a.length?(k.removeClass("searchbar-not-empty"),r&&k.hasClass("searchbar-active")&&m.addClass("searchbar-overlay-active")):(k.addClass("searchbar-not-empty"),r&&k.hasClass("searchbar-active")&&m.removeClass("searchbar-overlay-active")),r.length>0&&s&&i(a)},0)}function f(a){a.preventDefault()}function g(a){var g=a?"off":"on";k[g]("submit",f),q[g]("click",b),m[g]("click",b),o[g]("focus",c),o[g]("change keydown keypress keyup",e),p[g]("click",d)}function h(){g(!0)}function i(a){var b=a.trim().toLowerCase().split(" ");r.find("li").removeClass("hidden-by-searchbar");var c=[];r.find("li").each(function(a,d){d=n(d);var e=d.find(s);if(0!==e.length){var f;f=e.text().trim().toLowerCase();for(var g=0,h=0;h=0&&g++;g!==b.length?d.addClass("hidden-by-searchbar"):c.push(d[0])}}),l.params.searchbarHideDividers&&r.find(".item-divider, .list-group-title").each(function(){for(var a=n(this),b=a.nextAll("li"),c=!0,d=0;d0&&(v=q.width(),q.css(w,-v+"px")),k[0].f7DestroySearchbar=h,g(),a.hasClass("page")&&a.on("pageBeforeRemove",j)}},l.destroySearchbar=function(a){a=n(a);var b=a.hasClass("searchbar")?a:a.find(".searchbar");0!==b.length&&b[0].f7DestroySearchbar&&b[0].f7DestroySearchbar()},l.initMessagebar=function(a){function b(a){a.preventDefault()}function c(){j.css({height:""});var a=j[0].offsetHeight,b=a-j[0].clientHeight,c=j[0].scrollHeight;if(c+b>a){var d=c+b,e=l+(d-m),f=h.attr("data-max-height")||h.parents(".view")[0].offsetHeight-88;e>f&&(e=f,d=e-l+m),j.css("height",d+"px"),h.css("height",e+"px"),k.length>0&&(k.css("padding-bottom",e+"px"),k.scrollTop(k[0].scrollHeight-k[0].offsetHeight))}else k.length>0&&(h.css({height:""}),k.css({"padding-bottom":""}))}function d(){clearTimeout(i),i=setTimeout(function(){c()},0)}function e(a){var c=a?"off":"on";h[c]("submit",b),j[c]("change keydown keypress keyup paste cut",d)}function f(){e(!0)}function g(){f(),a.off("pageBeforeRemove",g)}a=n(a);var h=a.hasClass("messagebar")?a:a.find(".messagebar");if(0!==h.length){var i,j=h.find("textarea"),k=h.parents(".page").find(".page-content"),l=h[0].offsetHeight,m=j[0].offsetHeight;h[0].f7DestroyMessagebar=f,e(),a.hasClass("page")&&a.on("pageBeforeRemove",g)}},l.destroyMessagebar=function(a){a=n(a);var b=a.hasClass("messagebar")?a:a.find(".messagebar");0!==b.length&&b[0].f7DestroyMessagebar&&b[0].f7DestroyMessagebar()},l.cache=[],l.removeFromCache=function(a){for(var b=!1,c=0;c=0&&(e=a.split("?")[0]),l.params.cache&&!c&&a.indexOf("nocache")<0&&l.params.cacheIgnore.indexOf(e)<0)for(var f=0;f1){for(var d=b.split(" "),e=[],f=0;f0?"navbar-on-left":"navbar-on-center"),s.length>1&&(n(s[0]).remove(),s=u.find(".navbar-inner")),u.prepend(t[0])),x.prepend(r[0]),l.pageInitCallback(a,r[0],h,"left",v?t[0]:void 0),v&&l.navbarInitCallback(a,r[0],u[0],t[0],h,"right"),v&&t.hasClass("navbar-on-left")&&j&&t.find(".sliding").each(function(){var a=n(this);l.params.animateNavBackIcon&&(a.hasClass("left")&&a.find(".back .icon").length>0&&a.find(".back .icon").transform("translate3d("+-this.f7NavbarLeftOffset+"px,0,0)"),a.hasClass("center")&&s.find(".left .back .icon ~ span").length>0&&(this.f7NavbarLeftOffset+=s.find(".left .back span")[0].offsetLeft)),a.transform("translate3d("+this.f7NavbarLeftOffset+"px,0,0)")}),k)return r.addClass("page-on-left"),void(a.allowPageChange=!0);a.url=h;r[0].clientLeft;c()}if(!a.allowPageChange)return!1;var h=b.url,j=b.animatePages,k=b.preloadOnly,m=b.pushState,o=b.ignoreCache,p=b.forceUrl;a.allowPageChange=!1,l.xhr&&a.xhr&&a.xhr===l.xhr&&(l.xhr.abort(),l.xhr=!1),l.pluginHook("goBack",a,h,k),l.params.pushState&&("undefined"==typeof m&&(m=!0),!k&&history.state&&m&&history.back());var q,r,s,t,u,v,w=n(a.container),x=n(a.pagesContainer),y=x.children(".page");if("undefined"==typeof j&&(j=a.params.animatePages),y.length>1&&!p){if(k)return void(a.allowPageChange=!0);if(a.url=a.history[a.history.length-2],r=n(y[y.length-2]),q=n(y[y.length-1]),a.params.dynamicNavbar){v=!0;var z=w.find(".navbar-inner:not(.cached)");t=n(z[0]),s=n(z[1])}c()}else{if(y.length>1&&p&&(l.pageRemoveCallback(a,y[y.length-2],"left"),n(y[y.length-2]).remove(),a.params.dynamicNavbar&&w.find(".navbar-inner:not(.cached)").eq(0).remove(),y=x.children(".page")),h&&0===h.indexOf("#")&&(h=void 0),(p&&!h||!p)&&(h=a.history[a.history.length-2]),!h)return void(a.allowPageChange=!0);if(p&&a.history.indexOf(h)&&(a.history=a.history.slice(0,a.history.indexOf(h)+2)),!a.params.domCache&&h in a.contentCache){var A=a.contentCache[h];return l._tempDomElement.innerHTML="",n(l._tempDomElement).append(A),void g()}l.get(h,a,o,function(b,c){return c?void(a.allowPageChange=!0):void i(b,h,function(a){l._tempDomElement.innerHTML=a,g()})})}},l.afterGoBack=function(a,b,c){if(b=n(b),c=n(c),l.pageRemoveCallback(a,b[0],"right"),b.remove(),c.removeClass("page-from-left-to-center page-on-left").addClass("page-on-center"),a.allowPageChange=!0,a.params.dynamicNavbar){{var d=n(a.container).find(".navbar-inner:not(.cached)");n(d[1]).remove(),n(d[0]).removeClass("navbar-on-left navbar-from-left-to-center").addClass("navbar-on-center")}if(a.params.preloadPreviousPage&&a.params.domCache){var e=n(a.container).find(".navbar-inner.cached");n(e[e.length-1]).removeClass("cached")}}var f=a.history.pop();if(!a.params.domCache&&f&&f.indexOf("#content-")>-1&&f in a.contentCache&&(a.contentCache[f]=null,delete a.contentCache[f]),l.params.pushState&&l.pushStateClearQueue(),a.params.preloadPreviousPage){if(a.params.domCache){var g=n(a.container).find(".page.cached");n(g[g.length-1]).removeClass("cached")}l.goBack(a,{preloadOnly:!0})}};var s=document.createElement("div");l.modal=function(a){a=a||{};var b="";if(l.params.modalTemplate)l._compiledTemplates.modal||(l._compiledTemplates.modal=o.compile(l.params.modalTemplate)),b=l._compiledTemplates.modal(a);else{var c="";if(a.buttons&&a.buttons.length>0)for(var d=0;d'+a.buttons[d].text+""; -var e=a.title?'":"",f=a.title?'":"",g=a.afterText?a.afterText:"",h=a.buttons&&0!==a.buttons.length?"":"modal-no-buttons";b='"}s.innerHTML=b;var i=n(s).children();return n("body").append(i[0]),i.find(".modal-button").each(function(b,c){n(c).on("click",function(c){a.buttons[b].close!==!1&&l.closeModal(i),a.buttons[b].onClick&&a.buttons[b].onClick(i,c),a.onClick&&a.onClick(i,b)})}),l.openModal(i),i[0]},l.alert=function(a,b,c){return"function"==typeof b&&(c=arguments[1],b=void 0),l.modal({text:a||"",title:"undefined"==typeof b?l.params.modalTitle:b,buttons:[{text:l.params.modalButtonOk,bold:!0,onClick:c}]})},l.confirm=function(a,b,c,d){return"function"==typeof b&&(d=arguments[2],c=arguments[1],b=void 0),l.modal({text:a||"",title:"undefined"==typeof b?l.params.modalTitle:b,buttons:[{text:l.params.modalButtonCancel,onClick:d},{text:l.params.modalButtonOk,bold:!0,onClick:c}]})},l.prompt=function(a,b,c,d){return"function"==typeof b&&(d=arguments[2],c=arguments[1],b=void 0),l.modal({text:a||"",title:"undefined"==typeof b?l.params.modalTitle:b,afterText:'',buttons:[{text:l.params.modalButtonCancel},{text:l.params.modalButtonOk,bold:!0}],onClick:function(a,b){0===b&&d&&d(n(a).find(".modal-text-input").val()),1===b&&c&&c(n(a).find(".modal-text-input").val())}})},l.modalLogin=function(a,b,c,d){return"function"==typeof b&&(d=arguments[2],c=arguments[1],b=void 0),l.modal({text:a||"",title:"undefined"==typeof b?l.params.modalTitle:b,afterText:'',buttons:[{text:l.params.modalButtonCancel},{text:l.params.modalButtonOk,bold:!0}],onClick:function(a,b){var e=n(a).find('.modal-text-input[name="modal-username"]').val(),f=n(a).find('.modal-text-input[name="modal-password"]').val();0===b&&d&&d(e,f),1===b&&c&&c(e,f)}})},l.modalPassword=function(a,b,c,d){return"function"==typeof b&&(d=arguments[2],c=arguments[1],b=void 0),l.modal({text:a||"",title:"undefined"==typeof b?l.params.modalTitle:b,afterText:'',buttons:[{text:l.params.modalButtonCancel},{text:l.params.modalButtonOk,bold:!0}],onClick:function(a,b){var e=n(a).find('.modal-text-input[name="modal-password"]').val();0===b&&d&&d(e),1===b&&c&&c(e)}})},l.showPreloader=function(a){return l.modal({title:a||l.params.modalPreloaderTitle,text:'
'})},l.hidePreloader=function(){l.closeModal(".modal.modal-in")},l.showIndicator=function(){n("body").append('
')},l.hideIndicator=function(){n(".preloader-indicator-overlay, .preloader-indicator-modal").remove()},l.actions=function(a,b){var c,d,e,f=!1;1===arguments.length?b=a:l.device.ios?l.device.ipad&&(f=!0):n(window).width()>=768&&(f=!0),b=b||[],b.length>0&&!n.isArray(b[0])&&(b=[b]);var g;if(f){var h='
{{#each this}}
    {{#each this}}{{#if label}}
  • {{text}}
  • {{else}}
  • {{text}}
  • {{/if}}{{/each}}
{{/each}}
';l._compiledTemplates.actionsPopover||(l._compiledTemplates.actionsPopover=o.compile(h));var i=l._compiledTemplates.actionsPopover(b);c=n(l.popover(i,a,!0)),d=".list-block ul",e=".list-button"}else{if(l.params.modalActionsTemplate)l._compiledTemplates.actions||(l._compiledTemplates.actions=o.compile(l.params.modalActionsTemplate)),g=l._compiledTemplates.actions(b);else{for(var j="",k=0;k');var p=b[k][m],q=p.label?"actions-modal-label":"actions-modal-button";p.bold&&(q+=" actions-modal-button-bold"),p.color&&(q+=" color-"+p.color),j+=''+p.text+"",m===b[k].length-1&&(j+="")}g='
'+j+"
"}s.innerHTML=g,c=n(s).children(),n("body").append(c[0]),d=".actions-modal-group",e=".actions-modal-button"}var r=c.find(d);return r.each(function(a,d){var g=a;n(d).children().each(function(a,d){var h,i=a,j=b[g][i];!f&&n(d).is(e)&&(h=n(d)),f&&n(d).find(e).length>0&&(h=n(d).find(e)),h&&h.on("click",function(a){j.close!==!1&&l.closeModal(c),j.onClick&&j.onClick(c,a)})})}),f||l.openModal(c),c[0]},l.popover=function(a,b,c){function d(){a.css({left:"",top:""});var c=a.width(),d=a.height(),e=a.find(".popover-angle"),f=e.width()/2;e.removeClass("on-left on-right on-top on-bottom").css({left:"",top:""});var g=b.outerWidth(),h=b.outerHeight(),i=b.offset(),j=b.parents(".page");j.length>0&&(i.top=i.top-j[0].scrollTop);var k=n(window).height(),l=n(window).width(),m=0,o=0,p=0,q="top";d+fm?m=5:m+d>k&&(m=k-d-5),p-=m),"top"===q||"bottom"===q?(o=g/2+i.left-c/2,p=o,5>o&&(o=5),o+c>l&&(o=l-c-5),"top"===q&&e.addClass("on-bottom"),"bottom"===q&&e.addClass("on-top"),p-=o,e.css({left:c/2-f+p+"px"})):"middle"===q&&(o=i.left-c-f,e.addClass("on-right"),5>o&&(o=i.left+g+f,e.removeClass("on-right").addClass("on-left")),o+c>l&&(o=l-c-5,e.removeClass("on-right").addClass("on-left")),e.css({top:d/2-f+p+"px"})),a.css({top:m+"px",left:o+"px"})}if("undefined"==typeof c&&(c=!0),"string"==typeof a&&a.indexOf("<")>=0){var e=document.createElement("div");if(e.innerHTML=n.trim(a),!(e.childNodes.length>0))return!1;a=e.childNodes[0],c&&a.classList.add("remove-on-close"),n("body").append(a)}return a=n(a),b=n(b),0===a.length||0===b.length?!1:(0===a.find(".popover-angle").length&&a.append('
'),a.show(),d(),n(window).on("resize",d),a.on("close",function(){n(window).off("resize",d)}),a.find("."+l.params.viewClass).length>0&&l.sizeNavbars(a.find("."+l.params.viewClass)[0]),l.openModal(a),a[0])},l.popup=function(a,b){if("undefined"==typeof b&&(b=!0),"string"==typeof a&&a.indexOf("<")>=0){var c=document.createElement("div");if(c.innerHTML=n.trim(a),!(c.childNodes.length>0))return!1;a=c.childNodes[0],b&&a.classList.add("remove-on-close"),n("body").append(a)}return a=n(a),0===a.length?!1:(a.show(),a.find("."+l.params.viewClass).length>0&&l.sizeNavbars(a.find("."+l.params.viewClass)[0]),l.openModal(a),a[0])},l.loginScreen=function(a){return a||(a=".login-screen"),a=n(a),0===a.length?!1:(a.show(),a.find("."+l.params.viewClass).length>0&&l.sizeNavbars(a.find("."+l.params.viewClass)[0]),l.openModal(a),a[0])},l.openModal=function(a){a=n(a);var b=a.hasClass("popover"),c=a.hasClass("popup"),d=a.hasClass("login-screen");b||c||d||a.css({marginTop:-Math.round(a.outerHeight()/2)+"px"});var e;d||(0!==n(".modal-overlay").length||c||n("body").append(''),0===n(".popup-overlay").length&&c&&n("body").append(''),e=n(c?".popup-overlay":".modal-overlay"));a[0].clientLeft;return a.trigger("open"),d||e.addClass("modal-overlay-visible"),a.removeClass("modal-out").addClass("modal-in").transitionEnd(function(){a.trigger(a.hasClass("modal-out")?"closed":"opened")}),!0},l.closeModal=function(a){if(a=n(a||".modal-in"),"undefined"==typeof a||0!==a.length){var b=a.hasClass("popover"),c=a.hasClass("popup"),d=a.hasClass("login-screen"),e=a.hasClass("remove-on-close"),f=n(c?".popup-overlay":".modal-overlay");return f.removeClass(c&&a.length===n(".popup.modal-in").length?"modal-overlay-visible":"modal-overlay-visible"),a.trigger("close"),b?(a.removeClass("modal-in modal-out").trigger("closed").hide(),e&&a.remove()):a.removeClass("modal-in").addClass("modal-out").transitionEnd(function(){a.trigger(a.hasClass("modal-out")?"closed":"opened"),c||d?(a.removeClass("modal-out").hide(),e&&a.length>0&&a.remove()):a.remove()}),!0}},l.allowPanelOpen=!0,l.openPanel=function(a){function b(){e.transitionEnd(function(a){n(a.target).is(e)?(c.trigger(c.hasClass("active")?"opened":"closed"),l.allowPanelOpen=!0):b()})}if(!l.allowPanelOpen)return!1;var c=n(".panel-"+a);if(0===c.length||c.hasClass("active"))return!1;l.closePanel(),l.allowPanelOpen=!1;var d=c.hasClass("panel-reveal")?"reveal":"cover";c.css({display:"block"}).addClass("active"),c.trigger("open"),c.find("."+l.params.viewClass).length>0&&l.sizeNavbars&&l.sizeNavbars(c.find("."+l.params.viewClass)[0]);var e=(c[0].clientLeft,"reveal"===d?n("."+l.params.viewsClass):c);return b(),n("body").addClass("with-panel-"+a+"-"+d),!0},l.closePanel=function(){var a=n(".panel.active");if(0===a.length)return!1;var b=a.hasClass("panel-reveal")?"reveal":"cover",c=a.hasClass("panel-left")?"left":"right";a.removeClass("active");var d="reveal"===b?n("."+l.params.viewsClass):a;a.trigger("close"),l.allowPanelOpen=!1,d.transitionEnd(function(){a.hasClass("active")||(a.css({display:""}),a.trigger("closed"),n("body").removeClass("panel-closing"),l.allowPanelOpen=!0)}),n("body").addClass("panel-closing").removeClass("with-panel-"+c+"-"+b)},l.initSwipePanels=function(){function a(a){if(l.allowPanelOpen&&l.params.swipePanel&&!e&&!(n(".modal-in, .photo-browser-in").length>0||!l.params.swipePanelCloseOpposite&&n(".panel.active").length>0&&!d.hasClass("active"))){if(s.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,s.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,l.params.swipePanelCloseOpposite&&(q=n(".panel.active").length>0?n(".panel.active").hasClass("panel-left")?"left":"right":l.params.swipePanel),d=n(".panel.panel-"+q),l.params.swipePanelActiveArea){if("left"===q&&s.x>l.params.swipePanelActiveArea)return;if("right"===q&&s.xMath.abs(b-s.x))),g)return void(e=!1);if(!p&&(p=b>s.x?"to-right":"to-left","left"===q&&"to-left"===p&&!d.hasClass("active")||"right"===q&&"to-right"===p&&!d.hasClass("active")))return void(e=!1);if(l.params.swipePanelNoFollow){var n=(new Date).getTime()-h;return 300>n&&("to-left"===p&&("right"===q&&l.openPanel(q),"left"===q&&d.hasClass("active")&&l.closePanel()),"to-right"===p&&("left"===q&&l.openPanel(q),"right"===q&&d.hasClass("active")&&l.closePanel())),e=!1,void(f=!1)}f||(o=d.hasClass("panel-cover")?"cover":"reveal",d.show(),r.show(),k=d.hasClass("active"),m=d.width(),d.transition(0),d.find("."+l.params.viewClass).length>0&&l.sizeNavbars&&l.sizeNavbars(d.find("."+l.params.viewClass)[0])),f=!0,a.preventDefault();var u=k?0:-l.params.swipePanelThreshold;"right"===q&&(u=-u),i=b-s.x+u,"right"===q?(j=i-(k?m:0),j>0&&(j=0),-m>j&&(j=-m)):(j=i+(k?m:0),0>j&&(j=0),j>m&&(j=m)),"reveal"===o?(t.transform("translate3d("+j+"px,0,0)").transition(0),r.transform("translate3d("+j+"px,0,0)"),l.pluginHook("swipePanelSetTransform",t[0],d[0],Math.abs(j/m))):(d.transform("translate3d("+j+"px,0,0)").transition(0),l.pluginHook("swipePanelSetTransform",t[0],d[0],Math.abs(j/m)))}}function c(){if(!e||!f)return e=!1,void(f=!1);e=!1,f=!1;var a,b=(new Date).getTime()-h,c=0===j||Math.abs(j)===m;if(a=k?j===-m?"reset":300>b&&Math.abs(j)>=0||b>=300&&Math.abs(j)<=m/2?"left"===q&&j===m?"reset":"swap":"reset":0===j?"reset":300>b&&Math.abs(j)>0||b>=300&&Math.abs(j)>=m/2?"swap":"reset","swap"===a&&(l.allowPanelOpen=!0,k?(l.closePanel(),c&&(d.css({display:""}),n("body").removeClass("panel-closing"))):l.openPanel(q),c&&(l.allowPanelOpen=!0)),"reset"===a)if(k)l.allowPanelOpen=!0,l.openPanel(q);else if(l.closePanel(),c)l.allowPanelOpen=!0,d.css({display:""});else{var g="reveal"===o?t:d;n("body").addClass("panel-closing"),g.transitionEnd(function(){l.allowPanelOpen=!0,d.css({display:""}),n("body").removeClass("panel-closing")})}"reveal"===o&&(t.transition(""),t.transform("")),d.transition("").transform(""),r.css({display:""}).transform("")}var d=n(".panel.panel-"+l.params.swipePanel);if(0!==d.length){var e,f,g,h,i,j,k,m,o,p,q,r=n(".panel-overlay"),s={},t=n("."+l.params.viewsClass);q=l.params.swipePanel,n(document).on(l.touchEvents.start,a),n(document).on(l.touchEvents.move,b),n(document).on(l.touchEvents.end,c)}},l.initMessages=function(a){var b=n(a),c=b.find(".messages");if(0!==c.length){var d=b.find(".page-content");c.hasClass("new-messages-first")||(d[0].scrollTop=c.height()-d.height()),l.updateMessagesAngles(c)}},l.addMessage=function(a){if(a=a||{},a.type=a.type||"sent",!a.text||0===a.length)return!1;var b=n(".messages-content");if(0===b.length)return!1;var c=b.find(".messages"),d=c.hasClass("new-messages-first"),e="";a.day&&(e+='
'+a.day+(a.time?",":"")+(a.time?" "+a.time+"":"")+"
");var f=a.text.indexOf("=0?"message-pic":"",g=a.avatar?"message-with-avatar":"",h="message message-"+a.type+" "+f+" "+g+" message-appear";e+='
'+(a.name?'
'+a.name+"
":"")+'
'+a.text+"
"+(a.avatar?'
':"")+"
",d?c.prepend(e):c.append(e),l.updateMessagesAngles(c),l.scrollMessagesContainer(b)},l.updateMessagesAngles=function(a){a.find(".message").each(function(){var a=n(this);a.find(".message-text img").length>0&&a.addClass("message-pic"),a.find(".message-avatar").length>0&&a.addClass("message-with-avatar")}),a.find(".message-sent").each(function(){var a=n(this),b=a.next(".message-sent"),c=a.prev(".message-sent");0===b.length?a.addClass("message-last"):a.removeClass("message-last"),0===c.length?a.addClass("message-first"):a.removeClass("message-first"),c.length>0&&c.find(".message-name").length>0&&a.find(".message-name").length>0&&c.find(".message-name").text()!==a.find(".message-name").text()&&(c.addClass("message-last"),a.addClass("message-first"))}),a.find(".message-received").each(function(){var a=n(this),b=a.next(".message-received"),c=a.prev(".message-received");0===b.length?a.addClass("message-last"):a.removeClass("message-last"),0===c.length?a.addClass("message-first"):a.removeClass("message-first"),c.length>0&&c.find(".message-name").length>0&&a.find(".message-name").length>0&&c.find(".message-name").text()!==a.find(".message-name").text()&&(c.addClass("message-last"),a.addClass("message-first"))})},l.scrollMessagesContainer=function(a){if(a=n(a||".messages-content"),0!==a.length){var b=a.find(".messages"),c=b.hasClass("new-messages-first"),d=a[0].scrollTop,e=c?0:b.height()-a.height();e!==d&&a.scrollTop(e,300)}},l.swipeoutOpenedEl=void 0,l.allowSwipeout=!0,l.initSwipeout=function(a){function b(a){l.allowSwipeout&&(f=!1,e=!0,g=void 0,B.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,B.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,h=(new Date).getTime())}function c(a){if(e){var b="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,c="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY;if("undefined"==typeof g&&(g=!!(g||Math.abs(c-B.y)>Math.abs(b-B.x))),g)return void(e=!1);if(!f){if(n(".list-block.sortable-opened").length>0)return;j=n(this),k=j.find(".swipeout-content"),m=j.find(".swipeout-actions-right"),o=j.find(".swipeout-actions-left"),p=q=u=v=y=x=null,o.length>0&&(p=o.width(),u=o.children("a"),x=o.find(".swipeout-overswipe")),m.length>0&&(q=m.width(),v=m.children("a"),y=m.find(".swipeout-overswipe")),s=j.hasClass("swipeout-opened"),s&&(t=j.find(".swipeout-actions-left.swipeout-actions-opened").length>0?"left":"right"),j.removeClass("transitioning"),l.params.swipeoutNoFollow||(j.find(".swipeout-actions-opened").removeClass("swipeout-actions-opened"),j.removeClass("swipeout-opened"))}if(f=!0,a.preventDefault(),i=b-B.x,r=i,s&&("right"===t?r-=q:r+=p),r>0&&0===o.length||0>r&&0===m.length){if(!s)return void(e=f=!1);r=0}w=0>r?"to-left":r>0?"to-right":w?w:"to-left";var d,h,C;if(a.f7PreventPanelSwipe=!0,l.params.swipeoutNoFollow)return s?("right"===t&&i>0&&l.swipeoutClose(j),"left"===t&&0>i&&l.swipeoutClose(j)):(0>i&&m.length>0&&l.swipeoutOpen(j,"right"),i>0&&o.length>0&&l.swipeoutOpen(j,"left")),e=!1,void(f=!1);z=!1,A=!1;var D;if(m.length>0)for(C=r/q,-q>r&&(r=-q-Math.pow(-r-q,.8),y.length>0&&(A=!0)),d=0;d0&&D.hasClass("swipeout-overswipe")&&D.css({left:(A?-h:0)+"px"}),D.transform("translate3d("+(r-h*(1+Math.max(C,-1)))+"px,0,0)");if(o.length>0)for(C=r/p,r>p&&(r=p+Math.pow(r-p,.8),x.length>0&&(z=!0)),d=0;d0&&D.hasClass("swipeout-overswipe")&&D.css({left:(z?h:0)+"px"}),D.css("z-index",u.length-d).transform("translate3d("+(r+h*(1-Math.min(C,1)))+"px,0,0)");k.transform("translate3d("+r+"px,0,0)")}}function d(){if(!e||!f)return e=!1,void(f=!1);e=!1,f=!1;var a,b,c,d,g,t=(new Date).getTime()-h;if(c="to-left"===w?m:o,b="to-left"===w?q:p,a=300>t&&(-10>i&&"to-left"===w||i>10&&"to-right"===w)||t>=300&&Math.abs(r)>b/2?"open":"close",300>t&&(0===Math.abs(r)&&(a="close"),Math.abs(r)===b&&(a="open")),"open"===a){l.swipeoutOpenedEl=j,j.trigger("open"),j.addClass("swipeout-opened transitioning");var x="to-left"===w?-b:b;if(k.transform("translate3d("+x+"px,0,0)"),c.addClass("swipeout-actions-opened"),d="to-left"===w?v:u)for(g=0;g0&&u!==d)for(g=0;g0&&v!==d)for(g=0;g0&&v.transform(""),o.length>0&&u.transform("")))})}var e,f,g,h,i,j,k,m,o,p,q,r,s,t,u,v,w,x,y,z,A,B={};n(document).on(l.touchEvents.start,function(a){if(l.swipeoutOpenedEl){var b=n(a.target);l.swipeoutOpenedEl.is(b[0])||b.parents(".swipeout").is(l.swipeoutOpenedEl)||b.hasClass("modal-in")||b.parents(".modal-in").length>0||b.hasClass("modal-overlay")||l.swipeoutClose(l.swipeoutOpenedEl)}}),a?(n(a).on(l.touchEvents.start,b),n(a).on(l.touchEvents.move,c),n(a).on(l.touchEvents.end,d)):(n(document).on(l.touchEvents.start,".list-block li.swipeout",b),n(document).on(l.touchEvents.move,".list-block li.swipeout",c),n(document).on(l.touchEvents.end,".list-block li.swipeout",d))},l.swipeoutOpen=function(a,b){if(a=n(a),0!==a.length&&(a.length>1&&(a=n(a[0])),a.hasClass("swipeout")&&!a.hasClass("swipeout-opened"))){b||(b=a.find(".swipeout-actions-right").length>0?"right":"left");var c=a.find(".swipeout-actions-"+b);if(0!==c.length){a.trigger("open").addClass("swipeout-opened").removeClass("transitioning"),c.addClass("swipeout-actions-opened");var d,e=c.children("a"),f=c.width(),g="right"===b?-f:f;if(e.length>1){for(d=0;d1&&(a=n(a[0])),l.swipeoutOpenedEl=void 0,a.trigger("delete"),a.css({height:a.outerHeight()+"px"});{a[0].clientLeft}a.css({height:"0px"}).addClass("deleting transitioning").transitionEnd(function(){a.trigger("deleted"),a.remove()});var b="-100%";a.find(".swipeout-content").transform("translate3d("+b+",0,0)")}},l.sortableToggle=function(a){return a=n(a),0===a.length&&(a=n(".list-block.sortable")),a.toggleClass("sortable-opened"),a.trigger(a.hasClass("sortable-opened")?"open":"close"),a},l.sortableOpen=function(a){return a=n(a),0===a.length&&(a=n(".list-block.sortable")),a.addClass("sortable-opened"),a.trigger("open"),a},l.sortableClose=function(a){return a=n(a),0===a.length&&(a=n(".list-block.sortable")),a.removeClass("sortable-opened"),a.trigger("close"),a},l.initSortable=function(){function a(a){e=!1,d=!0,f="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,h=n(this).parent(),i=h.parent().find("li"),p=h.parents(".sortable"),a.preventDefault(),l.allowsPanelOpen=l.allowSwipeout=!1}function b(a){if(d&&h){var b=("touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,"touchmove"===a.type?a.targetTouches[0].pageY:a.pageY);e||(h.addClass("sorting"),p.addClass("sortable-sorting"),j=h[0].offsetTop,k=h.parent().height()-h[0].offsetTop-h.height()),e=!0,a.preventDefault(),a.f7PreventPanelSwipe=!0,g=b-f;var c=g;-j>c&&(c=-j),c>k&&(c=k),h.transform("translate3d(0,"+c+"px,0)"),o=m=void 0,i.each(function(){var a=n(this);if(a[0]!==h[0]){var b=a[0].offsetTop,d=a.height(),e=h[0].offsetTop+c;e>=b-d/2&&h.index()=e&&h.index()>a.index()?(n(this).transform("translate3d(0,100%,0)"),m=void 0,o||(o=a)):n(this).transform("translate3d(0, 0%,0)")}})}}function c(a){return l.allowsPanelOpen=l.allowSwipeout=!0,d&&e?(a.preventDefault(),i.transform(""),h.removeClass("sorting"),p.removeClass("sortable-sorting"),m&&(h.insertAfter(m),h.trigger("sort")),o&&(h.insertBefore(o),h.trigger("sort")),m=o=void 0,d=!1,void(e=!1)):(d=!1,void(e=!1))}var d,e,f,g,h,i,j,k,m,o,p;n(document).on(l.touchEvents.start,".list-block.sortable .sortable-handler",a),l.support.touch?(n(document).on(l.touchEvents.move,".list-block.sortable .sortable-handler",b),n(document).on(l.touchEvents.end,".list-block.sortable .sortable-handler",c)):(n(document).on(l.touchEvents.move,b),n(document).on(l.touchEvents.end,c))},l.initSmartSelects=function(a){var b=n(a);if(0!==b.length){var c=b.find(".smart-select");0!==c.length&&c.each(function(){var a=n(this),b=a.find("select");if(0!==b.length){var c=b[0];if(0!==c.length){for(var d=[],e=0;e'+d.join(", ")+""):f.text(d)}}})}},l.smartSelectOpen=function(a){function b(f){var g=f.detail.page;g.name===z&&(n(document).off("pageInit",b),n(g.container).find('input[name="'+q+'"]').on("change",function(){var b=this,f=b.value,g=[];if("checkbox"===b.type)for(var h=0;h'+f[s].group.label+"",i=f[s].group);var u="";"checkbox"===p&&(u+=''),f[s].icon&&(u+=''),f[s].image&&(u+=''),r+='
  • "}var v='",w="static";a.parents(".navbar-through").length>0&&(w="through"),a.parents(".navbar-fixed").length>0&&(w="fixed");var x,y,z="smart-select-"+q,A=a.parents(".page").hasClass("no-toolbar")?"no-toolbar":"",B=a.parents(".page").hasClass("no-navbar")?"no-navbar":"navbar-"+w,C="undefined"==typeof a.data("searchbar")?l.params.smartSelectSearchbar:"true"===a.data("searchbar")?!0:!1;C&&(x=a.data("searchbar-placeholder")||"Search",y=a.data("searchbar-cancel")||"Cancel");var D='
    ',E=("through"===w?v:"")+'
    '+("fixed"===w?v:"")+(C?D:"")+'
    '+("static"===w?v:"")+'
      '+r+"
    ";n(document).on("pageInit",b),c.loadContent(E)}}}},l.initPullToRefresh=function(a){function b(a){if(g){if("android"!==l.device.os)return;if("targetTouches"in a&&a.targetTouches.length>1)return}h=!1,g=!0,i=void 0,q=void 0,r.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,r.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,k=(new Date).getTime(),m=n(this)}function c(a){if(g){var b="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,c="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY;if("undefined"==typeof i&&(i=!!(i||Math.abs(c-r.y)>Math.abs(b-r.x))),!i)return void(g=!1);if(p=m[0].scrollTop,"undefined"==typeof q&&0!==p&&(q=!0),!h){if(m.removeClass("transitioning"),p>m[0].offsetHeight)return void(g=!1);u=m.hasClass("refreshing")?44:0,t=m[0].scrollHeight===m[0].offsetHeight||"ios"!==l.device.os?!0:!1}return h=!0,j=c-r.y,j>0&&0>=p||0>p?("ios"===l.device.os&&parseInt(l.device.osVersion.split(".")[0],10)>7&&0===p&&!q&&(t=!0),t&&(a.preventDefault(),o=Math.pow(j,.85)+u,m.transform("translate3d(0,"+o+"px,0)")),t&&Math.pow(j,.85)>44||!t&&j>=88?(s=!0,m.addClass("pull-up").removeClass("pull-down")):(s=!1,m.removeClass("pull-up").addClass("pull-down")),void 0):(m.removeClass("pull-up pull-down"),void(s=!1))}}function d(){return g&&h?(o&&(m.addClass("transitioning"),o=0),m.transform(""),s?(m.addClass("refreshing"),m.trigger("refresh",{done:function(){l.pullToRefreshDone(m)}})):m.removeClass("pull-down"),g=!1,void(h=!1)):(g=!1,void(h=!1))}function e(){f.off(l.touchEvents.start,b),f.off(l.touchEvents.move,c),f.off(l.touchEvents.end,d),v.off("pageBeforeRemove",e)}var f=n(a);if(f.hasClass("pull-to-refresh-content")||(f=f.find(".pull-to-refresh-content")),0!==f.length){var g,h,i,j,k,m,o,p,q,r={},s=!1,t=!1,u=0;m=f,f.on(l.touchEvents.start,b),f.on(l.touchEvents.move,c),f.on(l.touchEvents.end,d);var v=f.hasClass("page")?f:f.parents(".page");0!==v.length&&v.on("pageBeforeRemove",e)}},l.pullToRefreshDone=function(a){a=n(a),0===a.length&&(a=n(".pull-to-refresh-content.refreshing")),a.removeClass("refreshing").addClass("transitioning"),a.transitionEnd(function(){a.removeClass("transitioning pull-up pull-down")})},l.pullToRefreshTrigger=function(a){a=n(a),0===a.length&&(a=n(".pull-to-refresh-content")),a.hasClass("refreshing")||(a.addClass("transitioning refreshing"),a.trigger("refresh",{done:function(){l.pullToRefreshDone(a)}}))},l.attachInfiniteScroll=function(a){n(a).on("scroll",j)},l.detachInfiniteScroll=function(a){n(a).off("scroll",j)},l.initInfiniteScroll=function(a){function b(){l.detachInfiniteScroll(c),a.off("pageBeforeRemove",b)}a=n(a);var c=a.find(".infinite-scroll");l.attachInfiniteScroll(c),a.on("pageBeforeRemove",b)},l.showTab=function(a,b){var c=n(a);if(c.hasClass("active"))return!1;if(0===c.length)return!1;var d=c.parent(".tabs");if(0===d.length)return!1;l.allowSwipeout=!0;var e=d.parent().hasClass("tabs-animated-wrap");e&&d.transform("translate3d("+100*-c.index()+"%,0,0)");var f=d.children(".tab.active").removeClass("active");if(c.addClass("active"),c.trigger("show"),!e&&c.find(".navbar").length>0){var g;g=c.hasClass(l.params.viewClass)?c[0]:c.parents("."+l.params.viewClass)[0],l.sizeNavbars(g)}if(b?b=n(b):(b=n("string"==typeof a?'.tab-link[href="'+a+'"]':'.tab-link[href="#'+c.attr("id")+'"]'),0===b.length&&n("[data-tab]").each(function(){c.is(n(this).attr("data-tab"))&&(b=n(this))})),0!==b.length){var h;if(f&&f.length>0){var i=f.attr("id");i&&(h=n('.tab-link[href="#'+i+'"]')),0===h.length&&n("[data-tab]").each(function(){f.is(n(this).attr("data-tab"))&&(h=n(this))})}return b&&b.length>0&&b.addClass("active"),h&&h.length>0&&h.removeClass("active"),!0}},l.accordionToggle=function(a){a=n(a),0!==a.length&&(a.hasClass("accordion-item-expanded")?l.accordionClose(a):l.accordionOpen(a))},l.accordionOpen=function(a){a=n(a);var b=a.parents(".accordion-list"),c=a.find(".accordion-item-content"),d=b.find(".accordion-item-expanded");d.length>0&&l.accordionClose(d),c.css("height",c[0].scrollHeight+"px").transitionEnd(function(){if(a.hasClass("accordion-item-expanded")){c.transition(0),c.css("height","auto");{c[0].clientLeft}c.transition(""),a.trigger("opened")}else c.css("height",""),a.trigger("closed")}),a.trigger("open"),a.addClass("accordion-item-expanded")},l.accordionClose=function(a){a=n(a);var b=a.find(".accordion-item-content");a.removeClass("accordion-item-expanded"),b.transition(0),b.css("height",b[0].scrollHeight+"px");b[0].clientLeft;b.transition(""),b.css("height","").transitionEnd(function(){if(a.hasClass("accordion-item-expanded")){b.transition(0),b.css("height","auto");{b[0].clientLeft}b.transition(""),a.trigger("opened")}else b.css("height",""),a.trigger("closed")}),a.trigger("close")},l.initFastClicks=function(){function a(a){var b=n(a.target),c=b.parents(l.params.activeStateElements);return c.length>0?c:b -}function b(){var a=B.parents(".page-content, .panel");return 0===a.length?!1:("yes"!==a.prop("scrollHandlerSet")&&(a.on("scroll",function(){clearTimeout(C)}),a.prop("scrollHandlerSet","yes")),!0)}function c(){B.addClass("active-state")}function d(){B.removeClass("active-state")}function e(a){var b="button checkbox file image radio submit input textarea".split(" ");return document.activeElement&&a!==document.activeElement&&document.activeElement!==document.body?b.indexOf(a.nodeName.toLowerCase())>=0?!1:!0:!1}function f(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type?!1:a.className.indexOf("no-fastclick")>=0?!1:!0}function g(a){if(document.activeElement===a)return!1;var b=a.nodeName.toLowerCase(),c="button checkbox file image radio submit".split(" ");return a.disabled||a.readOnly?!1:"textarea"===b?!0:"select"===b?"android"===l.device.os?!1:!0:"input"===b&&c.indexOf(a.type)<0?!0:void 0}function h(a){if(a=n(a),a.is("label")||a.parents("label").length>0){if("android"===l.device.os){var b=l.device.osVersion.split(".");return 1*b[0]>4||1*b[0]===4&&1*b[1]>=4?!1:!0}return!1}return!0}function i(b){a(b).addClass("active-state"),"which"in b&&3===b.which&&setTimeout(function(){n(".active-state").removeClass("active-state")},0)}function j(){n(".active-state").removeClass("active-state")}function k(){n(".active-state").removeClass("active-state")}function m(d){if(A=!1,d.targetTouches.length>1)return!0;if(D=f(d.target),!D)return w=!1,!0;if("ios"===l.device.os){var g=window.getSelection();if(g.rangeCount&&(!g.isCollapsed||document.activeElement===g.focusNode))return x=!0,!0;x=!1}"android"===l.device.os&&e(d.target)&&document.activeElement.blur(),w=!0,v=d.target,u=(new Date).getTime(),s=d.targetTouches[0].pageX,t=d.targetTouches[0].pageY,"ios"===l.device.os&&(y=void 0,n(v).parents().each(function(){var a=this;a.scrollHeight>a.offsetHeight&&!y&&(y=a,y.f7ScrollTop=y.scrollTop)})),d.timeStamp-z<200&&d.preventDefault(),l.params.activeState&&(B=a(d),b(d)?C=setTimeout(c,80):c())}function o(a){if(w){var b=!1,c=l.params.fastClicksDistanceThreshold;if(c){var e=a.targetTouches[0].pageX,f=a.targetTouches[0].pageY;(Math.abs(e-s)>c||Math.abs(f-t)>c)&&(b=!0)}else b=!0;b&&(w=!1,v=null,A=!0),l.params.activeState&&(clearTimeout(C),d())}}function p(a){if(clearTimeout(C),!w)return!x&&D&&a.preventDefault(),!0;if(document.activeElement===a.target)return!0;if(x||a.preventDefault(),a.timeStamp-z<200)return!0;if(z=a.timeStamp,u=0,w=!1,"ios"===l.device.os&&y&&y.scrollTop!==y.f7ScrollTop)return!1;l.params.activeState&&(c(),setTimeout(d,0)),g(v)&&v.focus(),a.preventDefault();var b=a.changedTouches[0],e=document.createEvent("MouseEvents"),f="click";return"android"===l.device.os&&"select"===v.nodeName.toLowerCase()&&(f="mousedown"),e.initMouseEvent(f,!0,!0,window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,!1,!1,!1,0,null),e.forwardedTouchEvent=!0,v.dispatchEvent(e),!1}function q(){w=!1,v=null}function r(a){var b=!1;return w?(v=null,w=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(v||(b=!0),document.activeElement===v&&(b=!0),a.forwardedTouchEvent&&(b=!0),a.cancelable||(b=!0),b||(a.stopImmediatePropagation(),a.stopPropagation(),v?(h(v)||A)&&a.preventDefault():a.preventDefault(),v=null),b)}l.params.activeState&&n("html").addClass("watch-active-state");var s,t,u,v,w,x,y,z,A,B,C,D;l.support.touch?(document.addEventListener("click",r,!0),l.addGlobalEventListener("touchstart",m),l.addGlobalEventListener("touchmove",o),l.addGlobalEventListener("touchend",p),l.addGlobalEventListener("touchcancel",q)):l.params.activeState&&(l.addGlobalEventListener("mousedown",i),l.addGlobalEventListener("mousemove",j),l.addGlobalEventListener("mouseup",k))},l.initClickEvents=function(){function a(a){function b(a){return"false"===a?!1:"true"===a?!0:void 0}var c=n(this),d=c.attr("href"),e="a"===c[0].nodeName.toLowerCase();if(e)for(var f=0;f0&&l.params.modalCloseByOutside&&l.closeModal(".modal.modal-in"),n(".actions-modal.modal-in").length>0&&l.params.actionsCloseByOutside&&l.closeModal(".actions-modal.modal-in"),n(".popover.modal-in").length>0&&l.closeModal(".popover.modal-in")),c.hasClass("popup-overlay")&&n(".popup.modal-in").length>0&&l.params.popupCloseByOutside&&l.closeModal(".popup.modal-in"),c.hasClass("tab-link")&&l.showTab(c.attr("data-tab")||c.attr("href"),c),c.hasClass("swipeout-delete"))if(c.attr("data-confirm")){var j=c.attr("data-confirm"),k=c.attr("data-confirm-title");k?l.confirm(j,k,function(){l.swipeoutDelete(c.parents(".swipeout"))}):l.confirm(j,function(){l.swipeoutDelete(c.parents(".swipeout"))})}else l.swipeoutDelete(c.parents(".swipeout"));if(c.hasClass("toggle-sortable")&&l.sortableToggle(c.data("sortable")),c.hasClass("open-sortable")&&l.sortableOpen(c.data("sortable")),c.hasClass("close-sortable")&&l.sortableClose(c.data("sortable")),c.hasClass("accordion-item-toggle")||c.hasClass("item-link")&&c.parent().hasClass("accordion-item")){var m=c.parents(".accordion-item");0===m.length&&(m=c.parents("li")),l.accordionToggle(m)}if((!l.params.ajaxLinks||c.is(l.params.ajaxLinks))&&e){e&&a.preventDefault();var o=d&&d.length>0&&0!==d.indexOf("#");if(o||c.hasClass("back")){var p;if(c.attr("data-view")?p=n(c.attr("data-view"))[0].f7View:(p=c.parents("."+l.params.viewClass)[0]&&c.parents("."+l.params.viewClass)[0].f7View,p&&p.params.linksView&&(p=n(p.params.linksView)[0].f7View)),!p)for(var f=0;f=0||d.indexOf(f)>=0||!f))if("select"===h&&e.attr("multiple"))d.push(f),b[f]=[],a.find('select[name="'+f+'"] option').each(function(){this.selected&&b[f].push(this.value)});else switch(g){case"checkbox":d.push(f),b[f]=[],a.find('input[name="'+f+'"]').each(function(){this.checked&&b[f].push(this.value)});break;case"radio":d.push(f),a.find('input[name="'+f+'"]').each(function(){this.checked&&(b[f]=this.value)});break;default:b[f]=e.val()}}),b},l.formFromJSON=function(a,b){if(a=n(a),1!==a.length)return!1;var c=["submit","image","button","file"],d=[];a.find("input, select, textarea").each(function(){var e=n(this),f=e.attr("name"),g=e.attr("type"),h=this.nodeName.toLowerCase();if(b[f]&&!(c.indexOf(g)>=0||d.indexOf(f)>=0||!f))if("select"===h&&e.attr("multiple"))d.push(f),a.find('select[name="'+f+'"] option').each(function(){this.selected=b[f].indexOf(this.value)>=0?!0:!1});else switch(g){case"checkbox":d.push(f),a.find('input[name="'+f+'"]').each(function(){this.checked=b[f].indexOf(this.value)>=0?!0:!1});break;case"radio":d.push(f),a.find('input[name="'+f+'"]').each(function(){this.checked=b[f]===this.value?!0:!1});break;default:e.val(b[f])}})},l.initFormsStorage=function(a){function b(){var a=n(this),b=a[0].id;if(b){var c=l.formToJSON(a);c&&(l.formStoreData(b,c),a.trigger("store",{data:c}))}}function c(){d.off("change submit",b),a.off("pageBeforeRemove",c)}if(a=n(a),0!==a.length){var d=a.find("form.store-data");0!==d.length&&(d.each(function(){var a=this.getAttribute("id");if(a){var b=l.formGetData(a);b&&l.formFromJSON(this,b)}}),d.on("change submit",b),a.on("pageBeforeRemove",c))}},n(document).on("submit change","form.ajax-submit, form.ajax-submit-onchange",function(a){var b=n(this);if("change"!==a.type||b.hasClass("ajax-submit-onchange")){"submit"===a.type&&a.preventDefault();var c=b.attr("method")||"GET",d=b.attr("enctype"),e=b.attr("action");if(e){var f;f="POST"===c?new FormData(b[0]):n.serializeObject(l.formToJSON(b[0]));var g=n.ajax({method:c,url:e,contentType:d,data:f,success:function(a){b.trigger("submitted",{data:a,xhr:g})}})}}}),l.pushStateQueue=[],l.pushStateClearQueue=function(){if(0!==l.pushStateQueue.length){var a,b=l.pushStateQueue.pop();l.params.pushStateNoAnimation===!0&&(a=!1),"goBack"===b.action&&l.goBack(b.view,{animatePages:a}),"loadPage"===b.action&&l.loadPage(b.view,{url:b.stateUrl,animatePages:a,pushState:!1}),"loadContent"===b.action&&l.loadPage(b.view,{content:b.stateContent,animatePages:a,pushState:!1})}},l.initPushState=function(){function a(a){if(!b){for(var c,d=0;d=0?c.allowPageChange?l.goBack(c,{url:void 0,animatePages:f,pushState:!1,preloadOnly:!1}):l.pushStateQueue.push({action:"goBack",view:c}):g&&!h?c.allowPageChange?l.loadPage(c,{url:g,animatePages:f,pushState:!1}):l.pushStateQueue.unshift({action:"loadPage",stateUrl:g,view:c}):h&&(c.allowPageChange?l.loadPage(c,{content:h,animatePages:f,pushState:!1}):l.pushStateQueue.unshift({action:"loadContent",stateContent:h,view:c})))}}}var b=!0;n(window).on("load",function(){setTimeout(function(){b=!1},0)}),n(window).on("popstate",a)};var t=function(a,b){var c={initialSlide:0,spaceBetween:0,speed:300,slidesPerView:1,direction:"horizontal",paginationHide:!0,slideClass:"slider-slide",slideActiveClass:"slider-slide-active",slideNextClass:"slider-slide-next",slidePrevClass:"slider-slide-prev",wrapperClass:"slider-wrapper",bulletClass:"slider-pagination-bullet",bulletActiveClass:"slider-pagination-active",preventClicks:!0,preventClicksPropagation:!0,autoplay:!1,autoplayDisableOnInteraction:!0};b=b||{};for(var d in c)"undefined"==typeof b[d]&&(b[d]=c[d]);var e=this;if(e.params=b,e.container=n(a),0!==e.container.length){e.container[0].f7Slider=e,e.container.addClass("vertical"===e.params.direction?"slider-container-vertical":"slider-container-horizontal"),e.wrapper=e.container.children("."+e.params.wrapperClass),e.params.pagination&&(e.paginationContainer=n(e.params.pagination)),e.activeSlideIndex=e.previousSlideIndex=e.params.initialSlide||0;var f="horizontal"===e.params.direction,g=f&&l.rtl?-1:1;e.updateSlides=function(){if(e.slides=e.wrapper.children("."+e.params.slideClass),0!==e.params.spaceBetween){var a=l.rtl?"marginLeft":"marginRight";f?e.slides.css(a,e.params.spaceBetween+"px"):e.slides.css({marginBottom:e.params.spaceBetween+"px"})}if(e.params.slidesPerView>1){var c="(100% - "+(e.params.slidesPerView-1)*b.spaceBetween+"px)/"+e.params.slidesPerView;f?(e.slides.css("width","-webkit-calc("+c+")"),e.slides.css("width","-moz-calc("+c+")"),e.slides.css("width","calc("+c+")")):(e.slides.css("height","-webkit-calc("+c+")"),e.slides.css("height","-moz-calc("+c+")"),e.slides.css("height","calc("+c+")"))}},e.updatePagination=function(){if(e.paginationContainer&&e.paginationContainer.length>0){for(var a="",b=0;b';e.paginationContainer.html(a),e.bullets=e.paginationContainer.find("."+e.params.bulletClass)}},e.updateSize=function(){e.width=e.container[0].offsetWidth,e.height=e.container[0].offsetHeight,e.size=f?e.width:e.height},e.attachEvents=function(a){var b=a?"off":"on";e.container[b](l.touchEvents.start,e.onTouchStart),e.container[b](l.touchEvents.move,e.onTouchMove),e.container[b](l.touchEvents.end,e.onTouchEnd),n(window)[b]("resize",e.onResize),e.params.nextButton&&n(e.params.nextButton)[b]("click",e.onClickNext),e.params.prevButton&&n(e.params.prevButton)[b]("click",e.onClickPrev),e.params.indexButton&&n(e.params.indexButton)[b]("click",e.onClickIndex),(e.params.preventClicks||e.params.preventClicksPropagation)&&e.container[b]("click",e.onClick,!0)},e.detachEvents=function(){e.attachEvents(!0)},e.onResize=function(){e.updateSize(),e.slideTo(e.activeSlideIndex,0,!1)};var h,i,j,k,m,o,p={},q={},r=!1,s=Date.now();e.allowClick=!0,e.onClick=function(a){e.params.preventClicks&&!e.allowClick&&(a.preventDefault(),e.params.preventClicksPropagation&&(a.stopPropagation(),a.stopImmediatePropagation()))},e.onTouchStart=function(a){h=!0,i=!1,k=void 0,p.x=q.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,p.y=q.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,j=Date.now(),e.allowClick=!0,e.updateSize(),e.params.onTouchStart&&e.params.onTouchStart(e,a),"mousedown"===a.type&&a.preventDefault()},e.onTouchMove=function(a){if(e.params.onTouchMove&&e.params.onTouchMove(e,a),e.allowClick=!1,!(a.targetTouches&&a.targetTouches.length>1)&&(q.x="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,q.y="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY,"undefined"==typeof k&&(k=!!(k||Math.abs(q.y-p.y)>Math.abs(q.x-p.x))),(f&&k||!f&&!k)&&e.params.onOppositeTouchMove&&e.params.onOppositeTouchMove(e,a),h)){if(f&&k||!f&&!k)return void(h=!1);e.params.onSliderMove&&e.params.onSliderMove(e,a),a.preventDefault(),a.stopPropagation(),i||(m=n.getTranslate(e.wrapper[0],f?"x":"y")*g,e.wrapper.transition(0),r&&e.onTransitionEnd(),b.autoplay&&u&&(e.params.autoplayDisableOnInteraction?e.stopAutoplay():t&&clearTimeout(t))),i=!0;var c=f?(q.x-p.x)*g:q.y-p.y;c>0&&0===e.activeSlideIndex?c=Math.pow(c,.85):0>c&&e.activeSlideIndex===e.slides.length-e.params.slidesPerView&&(c=-Math.pow(-c,.85));var d=f?(c+m)*g:0,j=f?0:c+m;e.wrapper.transform("translate3d("+d+"px, "+j+"px,0)")}},e.onTouchEnd=function(a){e.params.onTouchEnd&&e.params.onTouchEnd(e,a);var b=Date.now(),c=b-j;if(e.allowClick&&(300>c&&b-s>300&&(o&&clearTimeout(o),o=setTimeout(function(){e&&(e.params.paginationHide&&e.paginationContainer&&e.paginationContainer.toggleClass("slider-pagination-hidden"),e.params.onClick&&e.params.onClick(e,a))},300)),300>c&&300>b-s&&(o&&clearTimeout(o),e.params.onDoubleTap&&e.params.onDoubleTap(e,a)),e.params.onTap&&e.params.onTap(e,a)),s=Date.now(),!h||!i)return void(h=i=!1);h=i=!1;var d=f?(q.x-p.x)*g:q.y-p.y;Math.abs(d)<5&&300>c&&e.allowClick===!1&&(e.allowClick=!0),setTimeout(function(){e&&(e.allowClick=!0)},100);var k=e.params.autoplay&&u&&!e.params.autoplayDisableOnInteraction;if(0===d)return void(k&&e.startAutoplay());var l=1,m=e.size/e.params.slidesPerView;e.params.slidesPerView>1&&(l=Math.abs((Math.abs(d)+m/2)/m)),k&&e.wrapper.transitionEnd(function(){e.startAutoplay()}),c>300?-m/2>=d?e.slideTo(e.activeSlideIndex+Math.floor(l)):d>m/2?e.slideTo(e.activeSlideIndex-Math.floor(l)):e.slideReset():Math.abs(d)<10?e.slideReset():e.slideTo(0>d?e.activeSlideIndex+Math.round(l):e.activeSlideIndex-Math.round(l))},e.slideTo=function(a,b,c){"undefined"==typeof a&&(a=0),0>a&&(a=0),a>e.slides.length-e.params.slidesPerView&&(a=e.slides.length-e.params.slidesPerView);var d=-(e.size+e.params.spaceBetween)*a/e.params.slidesPerView;"undefined"==typeof b&&(b=e.params.speed),e.previousSlideIndex=e.activeSlideIndex,e.activeSlideIndex=Math.round(a),e.isFirst=0===e.activeSlideIndex,e.isLast=e.activeSlideIndex===e.slides.length-e.params.slidesPerView,e.onTransitionStart();var h=f?d*g:0,i=f?0:d;0===b?(e.wrapper.transition(0).transform("translate3d("+h+"px,"+i+"px,0)"),c!==!1&&e.onTransitionEnd()):(r=!0,e.wrapper.transition(b).transform("translate3d("+h+"px,"+i+"px,0)").transitionEnd(function(){c!==!1&&e.onTransitionEnd()}))},e.updateClasses=function(){e.slides.removeClass(e.params.slideActiveClass+" "+e.params.slideNextClass+" "+e.params.slidePrevClass);var a=e.slides.eq(e.activeSlideIndex);a.addClass(e.params.slideActiveClass),a.next().addClass(e.params.slideNextClass),a.prev().addClass(e.params.slidePrevClass),e.bullets&&e.bullets.length>0&&(e.bullets.removeClass(e.params.bulletActiveClass),e.bullets.eq(e.activeSlideIndex).addClass(e.params.bulletActiveClass))},e.onTransitionStart=function(){e.updateClasses(),e.activeSlideIndex!==e.previousSlideIndex&&e.params.onSlideChangeStart&&e.params.onSlideChangeStart(e),e.params.onTransitionStart&&e.params.onTransitionStart(e)},e.onTransitionEnd=function(){r=!1,e.wrapper.transition(0),e.activeSlideIndex!==e.previousSlideIndex&&e.params.onSlideChangeEnd&&e.params.onSlideChangeEnd(e),e.params.onTransitionEnd&&e.params.onTransitionEnd(e)},e.slideNext=function(){e.slideTo(e.activeSlideIndex+1)},e.slidePrev=function(){e.slideTo(e.activeSlideIndex-1)},e.slideReset=function(){e.slideTo(e.activeSlideIndex)},e.onClickNext=function(a){a.preventDefault(),e.slideNext()},e.onClickPrev=function(a){a.preventDefault(),e.slidePrev()},e.onClickIndex=function(a){a.preventDefault(),e.slideTo(n(this).index())};var t,u;return e.startAutoplay=function(){e.params.autoplay&&(u=!0,t&&clearTimeout(t),t=setTimeout(function(){e.wrapper.transitionEnd(function(){e.startAutoplay()});var a=e.activeSlideIndex+1;a>e.slides.length-e.params.slidesPerView&&(a=0),e.slideTo(a)},e.params.autoplay))},e.stopAutoplay=function(){u=!1,t&&clearTimeout(t)},e.resetAutoplay=function(){e.stopAutoplay(),e.startAutoplay()},e.init=function(){e.updateSlides(),e.updatePagination(),e.updateSize(),e.params.initialSlide>0?e.slideTo(e.params.initialSlide,0,!1):e.updateClasses(),e.attachEvents(),e.params.autoplay&&e.startAutoplay()},e.update=function(){e.updateSlides(),e.updatePagination(),e.updateSize(),e.updateClasses()},e.destroy=function(){e.detachEvents(),e.params.onDestroy&&e.params.onDestroy(),e=void 0},e.init(),e}};l.slider=function(a,b){return new t(a,b)},l.initSlider=function(a){function b(a){function b(){a.destroy(),c.off("pageBeforeRemove",b)}c.on("pageBeforeRemove",b)}var c=n(a),d=c.find(".slider-init");if(0!==d.length)for(var e=0;e',i=l.rtl?"next":"prev",j=l.rtl?"prev":"next",k=d.params.toolbarTemplate||'
    ',m=d.params.template||'
    ',o=d.params.photoTemplate||'
    ',p=d.params.captionsTheme||d.params.theme,q=d.params.captionsTemplate||'
    {{captions}}
    ',r=d.params.captionTemplate||'
    {{caption}}
    ',s=d.params.objectTemplate||'
    {{html}}
    ',t="",u="";for(c=0;c=0||v.indexOf(">")>=0?s.replace(/{{html}}/g,v):o.replace(/{{url}}/g,v):"object"==typeof v&&(v.hasOwnProperty("html")&&v.html.length>0?w=s.replace(/{{html}}/g,v.html):v.hasOwnProperty("url")&&v.url.length>0&&(w=o.replace(/{{url}}/g,v.url)),v.hasOwnProperty("caption")&&v.caption.length>0?u+=r.replace(/{{caption}}/g,v.caption).replace(/{{captionIndex}}/g,c):w=w.replace(/{{caption}}/g,"")),t+=w}var x=m.replace("{{navbar}}",d.params.navbar?h:"").replace("{{noNavbar}}",d.params.navbar?"":"no-navbar").replace("{{photos}}",t).replace("{{captions}}",q.replace(/{{captions}}/g,u)).replace("{{toolbar}}",d.params.toolbar?k:"");d.activeSlideIndex=d.params.initialSlide,d.openIndex=d.activeSlideIndex,d.opened=!1,d.open=function(a){return"undefined"==typeof a&&(a=d.activeSlideIndex),a=parseInt(a,10),d.opened&&d.slider?void d.slider.slideTo(a):(d.opened=!0,d.openIndex=a,"standalone"===d.params.type&&n("body").append(x),"popup"===d.params.type&&(d.popup=l.popup('"),n(d.popup).on("closed",d.onPopupClose)),"page"===d.params.type?(n(document).on("pageBeforeInit",d.onPageBeforeInit),n(document).on("pageBeforeRemove",d.onPageBeforeRemove),d.params.view||(d.params.view=b()),void d.params.view.loadContent(x)):(d.layout(d.openIndex),void(d.params.onOpen&&d.params.onOpen(d))))},d.close=function(){d.opened=!1,d.sliderContainer&&0!==d.sliderContainer.length&&(d.params.onClose&&d.params.onClose(d),d.attachEvents(!0),"standalone"===d.params.type&&d.container.removeClass("photo-browser-in").addClass("photo-browser-out").animationEnd(function(){d.container.remove()}),d.slider.destroy(),d.slider=d.sliderContainer=d.sliderWrapper=d.slides=y=z=A=void 0)},d.onPopupClose=function(){d.close(),n(d.popup).off("pageBeforeInit",d.onPopupClose)},d.onPageBeforeInit=function(a){"photo-browser-slides"===a.detail.page.name&&d.layout(d.openIndex),n(document).off("pageBeforeInit",d.onPageBeforeInit)},d.onPageBeforeRemove=function(a){"photo-browser-slides"===a.detail.page.name&&d.close(),n(document).off("pageBeforeRemove",d.onPageBeforeRemove)},d.layout=function(a){d.container="page"===d.params.type?n(".photo-browser-slider-container").parents(".view"):n(".photo-browser"),"standalone"===d.params.type&&(d.container.addClass("photo-browser-in"),l.sizeNavbars(d.container)),d.sliderContainer=d.container.find(".photo-browser-slider-container"),d.sliderWrapper=d.container.find(".photo-browser-slider-wrapper"),d.slides=d.container.find(".photo-browser-slide"),d.captionsContainer=d.container.find(".photo-browser-captions"),d.captions=d.container.find(".photo-browser-caption");var b={nextButton:d.params.nextButton||".photo-browser-next",prevButton:d.params.prevButton||".photo-browser-prev",indexButton:d.params.indexButton,initialSlide:a,spaceBetween:d.params.spaceBetween,speed:d.params.speed,onTap:function(a,b){d.params.onTap&&d.params.onTap(a,b)},onClick:function(a,b){d.params.exposition&&d.toggleExposition(),d.params.onClick&&d.params.onClick(a,b)},onDoubleTap:function(a,b){d.toggleZoom(n(b.target).parents(".photo-browser-slide")),d.params.onDoubleTap&&d.params.onDoubleTap(a,b)},onSlideChangeStart:function(a){d.activeSlideIndex=a.activeSlideIndex,d.container.find(".photo-browser-current").text(a.activeSlideIndex+1),d.container.find(".photo-browser-total").text(a.slides.length),n(".photo-browser-prev, .photo-browser-next").removeClass("photo-browser-link-inactive"),a.isFirst&&n(".photo-browser-prev").addClass("photo-browser-link-inactive"),a.isLast&&n(".photo-browser-next").addClass("photo-browser-link-inactive"),d.captions.length>0&&(d.captionsContainer.find(".photo-browser-caption-active").removeClass("photo-browser-caption-active"),d.captionsContainer.find('[data-caption-index="'+d.activeSlideIndex+'"]').addClass("photo-browser-caption-active"));var b=a.slides.eq(a.previousSlideIndex).find("video");b.length>0&&"pause"in b[0]&&b[0].pause(),d.params.onSlideChangeStart&&d.params.onSlideChangeStart(a)},onSlideChangeEnd:function(a){d.params.zoom&&y&&a.previousSlideIndex!==a.activeSlideIndex&&(z.transform("translate3d(0,0,0) scale(1)"),A.transform("translate3d(0,0,0)"),y=z=A=void 0,B=C=1),d.params.onSlideChangeEnd&&d.params.onSlideChangeEnd(a)}};d.params.swipeToClose&&"page"!==d.params.type&&(b.onTouchStart=d.swipeCloseTouchStart,b.onOppositeTouchMove=d.swipeCloseTouchMove,b.onTouchEnd=d.swipeCloseTouchEnd),d.slider=l.slider(d.sliderContainer,b),d.attachEvents()},d.attachEvents=function(a){var b=a?"off":"on";d.params.zoom&&(d.slides[b]("gesturestart",d.onSlideGestureStart),d.slides[b]("gesturechange",d.onSlideGestureChange),d.slides[b]("gestureend",d.onSlideGestureEnd),d.slides[b](l.touchEvents.start,d.onSlideTouchStart),d.slides[b](l.touchEvents.move,d.onSlideTouchMove),d.slides[b](l.touchEvents.end,d.onSlideTouchEnd)),d.container.find(".photo-browser-close-link")[b]("click",d.close)};d.exposed=!1,d.toggleExposition=function(){d.container&&d.container.toggleClass("photo-browser-exposed"),d.params.expositionHideCaptions&&d.captionsContainer.toggleClass("photo-browser-captions-exposed"),d.exposed=!d.exposed},d.expositionOn=function(){d.container&&d.container.addClass("photo-browser-exposed"),d.params.expositionHideCaptions&&d.captionsContainer.addClass("photo-browser-captions-exposed"),d.exposed=!0},d.expositionOff=function(){d.container&&d.container.removeClass("photo-browser-exposed"),d.params.expositionHideCaptions&&d.captionsContainer.removeClass("photo-browser-captions-exposed"),d.exposed=!1};var y,z,A,B=1,C=1,D=!1;d.onSlideGestureStart=function(){y||(y=n(this),z=y.find("img"),A=z.parent()),z.transition(0),D=!0},d.onSlideGestureChange=function(a){B=a.scale*C,B>d.params.maxZoom&&(B=d.params.maxZoom-1+Math.pow(B-d.params.maxZoom+1,.5)),BV.x))return void(E=!1);a.stopPropagation(),F=!0,G=W.x-V.x+O,H=W.y-V.y+P,I>G&&(G=I+1-Math.pow(I-G+1,.8)),G>K&&(G=K-1+Math.pow(G-K+1,.8)),J>H&&(H=J+1-Math.pow(J-H+1,.8)),H>L&&(H=L-1+Math.pow(H-L+1,.8)),Q||(Q=W.x),T||(T=W.y),R||(R=Date.now()),S=(W.x-Q)/(Date.now()-R)/2,U=(W.y-T)/(Date.now()-R)/2,Math.abs(W.x-Q)<2&&(S=0),Math.abs(W.y-T)<2&&(U=0),Q=W.x,T=W.y,R=Date.now(),A.transform("translate3d("+G+"px, "+H+"px,0)")}}},d.onSlideTouchEnd=function(){if(!E||!F)return E=!1,void(F=!1);E=!1,F=!1;var a=300,b=300,c=S*a,e=G+c,f=U*b,g=H+f;0!==S&&(a=Math.abs((e-G)/S)),0!==U&&(b=Math.abs((g-H)/U));var h=Math.max(a,b);G=e,H=g;var i=M*B,j=N*B;I=Math.min(d.slider.width/2-i/2,0),K=-I,J=Math.min(d.slider.height/2-j/2,0),L=-J,G=Math.max(Math.min(G,K),I),H=Math.max(Math.min(H,L),J),A.transition(h).transform("translate3d("+G+"px, "+H+"px,0)")};var X,Y,Z,$,_,ab=!1,bb=!0,cb=!1;return d.swipeCloseTouchStart=function(){bb&&(ab=!0)},d.swipeCloseTouchMove=function(a,b){if(ab){cb||(cb=!0,Y="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY,$=d.slider.slides.eq(d.slider.activeSlideIndex),_=(new Date).getTime()),b.preventDefault(),Z="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY,X=Y-Z;var c=1-Math.abs(X)/300;$.transform("translate3d(0,"+-X+"px,0)"),d.slider.container.css("opacity",c).transition(0)}},d.swipeCloseTouchEnd=function(){if(ab=!1,!cb)return void(cb=!1);cb=!1,bb=!1;var a=Math.abs(X),b=(new Date).getTime()-_;return 300>b&&a>20||b>=300&&a>100?void setTimeout(function(){"standalone"===d.params.type&&d.close(),"popup"===d.params.type&&l.closeModal(d.popup),d.params.onSwipeToClose&&d.params.onSwipeToClose(d),bb=!0},0):(0!==a?$.addClass("transitioning").transitionEnd(function(){bb=!0,$.removeClass("transitioning")}):bb=!0,d.slider.container.css("opacity","").transition(""),void $.transform(""))},d};l.photoBrowser=function(a){return new u(a)};var v; -l.addNotification=function(a){if(a){"undefined"==typeof a.media&&(a.media=l.params.notificationMedia),"undefined"==typeof a.title&&(a.title=l.params.notificationTitle),"undefined"==typeof a.subtitle&&(a.subtitle=l.params.notificationSubtitle),"undefined"==typeof a.closeIcon&&(a.closeIcon=l.params.notificationCloseIcon),"undefined"==typeof a.hold&&(a.hold=l.params.notificationHold),"undefined"==typeof a.closeOnClick&&(a.closeOnClick=l.params.notificationCloseOnClick),v||(v=document.createElement("div"));var b=n(".notifications");0===b.length&&(n("body").append('
      '),b=n(".notifications"));var c,d=b.children("ul");c=a.custom?"
    • "+a.custom+"
    • ":'
    • '+(a.media?'
      '+a.media+"
      ":"")+'
      '+(a.title?'
      '+a.title+"
      ":"")+(a.closeIcon?'
      ':"")+"
      "+(a.subtitle?'
      '+a.subtitle+"
      ":"")+(a.message?'
      '+a.message+"
      ":"")+"
    • ",v.innerHTML=c;var e=n(v).children();e.on("click",function(b){var c=!1;n(b.target).is(".close-notification")||n(b.target).parents(".close-notification").length>0?c=!0:(a.onClick&&a.onClick(b,e[0]),a.closeOnClick&&(c=!0)),c&&l.closeNotification(e[0])}),a.onClose&&e.data("f7NotificationOnClose",function(){a.onClose(e[0])}),a.additionalClass&&e.addClass(a.additionalClass),a.hold&&setTimeout(function(){e.length>0&&l.closeNotification(e[0])},a.hold),d.prepend(e[0]),b.show();var f=e.height();e.css("marginTop",-f+"px"),e.transition(0);{e[0].clientLeft}return e.transition(""),e.css("marginTop","0px"),b.transform("translate3d(0, 0,0)"),e.removeClass("notification-hidden"),e[0]}},l.closeNotification=function(a){if(a=n(a),0!==a.length&&!a.hasClass("notification-item-removing")){var b=n(".notifications"),c=a.height();a.css("height",c+"px").transition(0);{a[0].clientLeft}a.css("height","0px").transition("").addClass("notification-item-removing"),a.data("f7NotificationOnClose")&&a.data("f7NotificationOnClose")(),0===b.find(".notification-item:not(.notification-item-removing)").length&&b.transform(""),a.addClass("notification-hidden").transitionEnd(function(){a.remove(),0===b.find(".notification-item").length&&b.hide()})}};var w=[];return l.initPlugins=function(){for(var a in l.plugins){var b=l.plugins[a](l,l.params[a]);b&&w.push(b)}},l.pluginHook=function(a){for(var b=0;b0&&b[0].nodeType)for(e=0;e0?parseFloat(this.css("width"))-parseFloat(this.css("padding-left"))-parseFloat(this.css("padding-right")):null},outerWidth:function(a){return this.length>0?a?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null},height:function(){return this[0]===window?window.innerHeight:this.length>0?this[0].offsetHeight-parseFloat(this.css("padding-top"))-parseFloat(this.css("padding-bottom")):null},outerHeight:function(a){return this.length>0?a?this[0].offsetHeight+parseFloat(this.css("margin-top"))+parseFloat(this.css("margin-bottom")):this[0].offsetHeight:null},offset:function(){if(this.length>0){var a=this[0],b=a.getBoundingClientRect(),c=document.body,d=a.clientTop||c.clientTop||0,e=a.clientLeft||c.clientLeft||0,f=window.pageYOffset||a.scrollTop,g=window.pageXOffset||a.scrollLeft;return{top:b.top+f-d,left:b.left+g-e}}return null},hide:function(){for(var a=0;ad-1?new a([]):0>b?(c=d+b,new a(0>c?[]:[this[c]])):new a([this[b]])},append:function(b){var c,d;for(c=0;c=0;d--)this[c].insertBefore(e.childNodes[d],this[c].childNodes[0])}else if(b instanceof a)for(d=0;d1)for(var e=0;e1)for(var e=0;e0?c?this[0].nextElementSibling&&b(this[0].nextElementSibling).is(c)?[this[0].nextElementSibling]:[]:this[0].nextElementSibling?[this[0].nextElementSibling]:[]:[])},nextAll:function(c){var d=[],e=this[0];if(!e)return new a([]);for(;e.nextElementSibling;){var f=e.nextElementSibling;d.push(c&&b(f).is(c)?f:f),e=f}return new a(d)},prev:function(c){return new a(this.length>0?c?this[0].previousElementSibling&&b(this[0].previousElementSibling).is(c)?[this[0].previousElementSibling]:[]:this[0].previousElementSibling?[this[0].previousElementSibling]:[]:[])},prevAll:function(c){var d=[],e=this[0];if(!e)return new a([]);for(;e.previousElementSibling;){var f=e.previousElementSibling;d.push(c&&b(f).is(c)?f:f),e=f}return new a(d)},parent:function(a){for(var c=[],d=0;d=0?a.data.split("?")[1]:a.data:b.serializeObject(a.data),a.url+=a.url.indexOf("?")>=0?"&"+g:"?"+g}if("json"===a.dataType&&a.url.indexOf("callback=")>=0){var h,i,j="f7jsonp_"+Date.now()+c++,k=a.url.split("callback=");if(k[1].indexOf("&")>=0){var l=k[1].split("&").filter(function(a){return a.indexOf("=")>0}).join("&");h=k[0]+"callback="+j+(l.length>0?"&"+l:"")}else h=k[0]+"callback="+j;var m=document.createElement("script");return m.type="text/javascript",m.onerror=function(){clearTimeout(i),a.error&&a.error()},m.src=h,window[j]=function(b){clearTimeout(i),a.success&&a.success(b),m.parentNode.removeChild(m),m=null,delete window[j]},document.querySelector("head").appendChild(m),void(a.timeout>0&&(i=setTimeout(function(){m.parentNode.removeChild(m),m=null,a.error&&a.error()},a.timeout)))}("GET"===f||"HEAD"===f)&&a.cache===!1&&(a.url+="_nocache="+Date.now());var n=new XMLHttpRequest;n.open(f,a.url,a.async,a.user,a.password);var o=null;if(("POST"===f||"PUT"===f)&&a.data)if(a.processData){var p=[ArrayBuffer,Blob,Document,FormData];if(p.indexOf(a.data.constructor)>=0)o=a.data;else{var q="---------------------------"+Date.now().toString(16);"multipart/form-data"===a.contentType?n.setRequestHeader("Content-Type","multipart/form-data; boundary="+q):n.setRequestHeader("Content-Type",a.contentType),o="";var r=b.serializeObject(a.data);if("multipart/form-data"===a.contentType){q="---------------------------"+Date.now().toString(16),r=r.split("&");for(var s=[],t=0;t=0))return e;for(a=a.split("?")[1],c=a.split("&"),b=0;bf&&l>=j&&(n.scrollTop=j,c=!0),o&&f>j&&j>=l&&(n.scrollTop=j,c=!0),p&&k>g&&m>=k&&(n.scrollLeft=k,c=!0),p&&g>k&&k>=m&&(n.scrollLeft=k,c=!0),c||(o&&(n.scrollTop=l),p&&(n.scrollLeft=m),b.requestAnimationFrame(e))}var f,g,h,i,j,k,l,m,n=this,o=c>0||0===c,p=a>0||0===a;if(o&&(f=n.scrollTop,d||(n.scrollTop=c)),p&&(g=n.scrollLeft,d||(n.scrollLeft=a)),d){o&&(h=n.scrollHeight-n.offsetHeight,j=Math.max(Math.min(c,h),0)),p&&(i=n.scrollWidth-n.offsetWidth,k=Math.max(Math.min(a,i),0));var q=null;o&&j===f&&(o=!1),p&&k===g&&(p=!1),b.requestAnimationFrame(e)}})},b.fn.scrollTop=function(a,b){var c=this;return"undefined"==typeof a?c.length>0?c[0].scrollTop:null:c.scrollTo(void 0,a,b)},b.fn.scrollLeft=function(a,b){var c=this;return"undefined"==typeof a?c.length>0?c[0].scrollLeft:null:c.scrollTo(a,void 0,b)},b}();Framework7.$=a;window.Dom7=a,Framework7.prototype.support=function(){var a={touch:!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)};return a}(),Framework7.prototype.device=function(){var b={},c=navigator.userAgent,d=a,e=c.match(/(Android);?[\s\/]+([\d.]+)?/),f=c.match(/(iPad).*OS\s([\d_]+)/),g=c.match(/(iPod)(.*OS\s([\d_]+))?/),h=!f&&c.match(/(iPhone\sOS)\s([\d_]+)/);if(b.ios=b.android=b.iphone=b.ipad=!1,e&&(b.os="android",b.osVersion=e[2],b.android=!0),(f||h||g)&&(b.os="ios",b.ios=!0),h&&!g&&(b.osVersion=h[2].replace(/_/g,"."),b.iphone=!0),f&&(b.osVersion=f[2].replace(/_/g,"."),b.ipad=!0),g&&(b.osVersion=g[3]?g[3].replace(/_/g,"."):null,b.iphone=!0),b.ios&&b.osVersion&&c.indexOf("Version/")>=0&&"10"===b.osVersion.split(".")[0]&&(b.osVersion=c.toLowerCase().split("version/")[1].split(" ")[0]),b.webView=(h||f||g)&&c.match(/.*AppleWebKit(?!.*Safari)/i),b.os&&"ios"===b.os){var i=b.osVersion.split(".");b.minimalUi=!b.webView&&(g||h)&&(1*i[0]===7?1*i[1]>=1:1*i[0]>7)&&d('meta[name="viewport"]').length>0&&d('meta[name="viewport"]').attr("content").indexOf("minimal-ui")>=0}var j=d(window).width(),k=d(window).height();b.statusBar=!1,b.statusBar=b.webView&&j*k===screen.width*screen.height?!0:!1;var l=[];if(b.pixelRatio=window.devicePixelRatio||1,b.pixelRatio>=2&&l.push("retina"),b.os&&(l.push(b.os,b.os+"-"+b.osVersion.split(".")[0],b.os+"-"+b.osVersion.replace(/\./g,"-")),"ios"===b.os))for(var m=parseInt(b.osVersion.split(".")[0],10),n=m-1;n>=6;n--)l.push("ios-gt-"+n);return b.statusBar?l.push("with-statusbar-overlay"):d("html").removeClass("with-statusbar-overlay"),l.length>0&&d("html").addClass(l.join(" ")),b}(),Framework7.prototype.plugins={}}(),window.Template7=function(){"use strict";function a(a){return"[object Array]"===Object.prototype.toString.apply(a)}function b(a){return"function"==typeof a}function c(a){var b,c,d,e=a.replace(/[{}#}]/g,"").split(" "),f=[];for(c=0;c=0){b=d,f.push(g);break}b&&(c=b)}else if(g.indexOf("=")>0){var h=g.split("="),i=h[0],j=h[1];if(2!==j.match(/"/g).length){for(b=0,d=c+1;d=0){b=d;break}b&&(c=b)}var k=[i,j.replace(/"/g,"")];f.push(k)}else f.push(g)}return f}function d(b){var d,e,f=[];if(!b)return[];var g=b.split(/({{[^{^}]*}})/);for(d=0;d=0)continue;if(h.indexOf("{#")<0&&h.indexOf(" ")<0&&h.indexOf("else")<0){f.push({type:"variable",contextName:h.replace(/[{}]/g,"")});continue}var i=c(h),j=i[0],k=[],l={};for(e=1;e=0){var n,o="",p="",q=0,r=!1,s=!1,t=0;for(e=d+1;e=0&&t++,g[e].indexOf("{{/")>=0&&t--,g[e].indexOf("{{#"+j)>=0)o+=g[e],s&&(p+=g[e]),q++;else if(g[e].indexOf("{{/"+j)>=0){if(!(q>0)){n=e,r=!0;break}q--,o+=g[e],s&&(p+=g[e])}else g[e].indexOf("else")>=0&&0===t?s=!0:(s||(o+=g[e]),s&&(p+=g[e]));r&&(n&&(d=n),f.push({type:"helper",helperName:j,contextName:k,content:o,inverseContent:p,hash:l}))}else h.indexOf(" ")>0&&f.push({type:"helper",helperName:j,contextName:k,hash:l})}}return f}var e=function(a,b){function c(a,b){return a.content?h(a.content,b):function(){return""}}function e(a,b){return a.inverseContent?h(a.inverseContent,b):function(){return""}}function f(a,b){var c;if(a.indexOf(".")>0)c=0===a.indexOf("this")?a.replace("this",b):b+"."+a;else if(0===a.indexOf("../")){var d=a.split("../").length-1,e=a.split("../")[a.split("../").length-1],f=b.split("_")[1]-d;c="ctx_"+(f>=1?f:1)+"."+e}else c="this"===a?b:b+"."+a;return a&&a.indexOf("@")>=0&&(c="(data && data."+a.replace("@","")+")"),c}function g(a,b){for(var c=[],d=0;d0)throw new Error('Template7: Missing helper: "'+m.helperName+'"');n=f(m.helperName,j),k+="if ("+n+") {",k+="if (isArray("+n+")) {",k+="r += (Template7.helpers.each).call("+j+", "+n+", {hash:"+JSON.stringify(m.hash)+", data: data || {}, fn: "+c(m,b+1)+", inverse: "+e(m,b+1)+"});",k+="}else {",k+="r += (Template7.helpers.with).call("+j+", "+n+", {hash:"+JSON.stringify(m.hash)+", data: data || {}, fn: "+c(m,b+1)+", inverse: "+e(m,b+1)+"});",k+="}}"}}else k+="r +='"+m.content.replace(/\n/g,"\\n").replace(/'/g,"\\'")+"';"}return k+="\nreturn r;})",eval.call(window,k)}var i=this;i.template=a,i.context=b,i.compile=function(a){return i.compiled||(i.compiled=h(a)),i.compiled}};e.prototype={options:{},helpers:{"if":function(a,c){return b(a)&&(a=a.call(this)),a?c.fn(this,c.data):c.inverse(this,c.data)},unless:function(a,c){return b(a)&&(a=a.call(this)),a?c.inverse(this,c.data):c.fn(this,c.data)},each:function(c,d){var e="",f=0;if(b(c)&&(c=c.call(this)),a(c)){for(d.hash.reverse&&(c=c.reverse()),f=0;f0?e:d.inverse(this)},"with":function(a,c){return b(a)&&(a=a.call(this)),c.fn(a)},join:function(a,c){return b(a)&&(a=a.call(this)),a.join(c.hash.delimeter)}}};var f=function(a,b){if(2===arguments.length){var c=new e(a),d=c.compile()(b);return c=null,d}return new e(a)};return f.registerHelper=function(a,b){e.prototype.helpers[a]=b},f.compile=function(a){var b=new e(a);return b.compile()},f.options=e.prototype.options,f.helpers=e.prototype.helpers,f}(); \ No newline at end of file diff --git a/examples/raspberry_pi_mjpeg_led/web_root/index.html b/examples/raspberry_pi_mjpeg_led/web_root/index.html deleted file mode 100644 index 0d257a32..00000000 --- a/examples/raspberry_pi_mjpeg_led/web_root/index.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - Smart.c mjpg example - - - - - -
      - - -
      - -
      - - - - -
      -
      - - - - - diff --git a/mongoose.c b/mongoose.c index 8c251148..377bea14 100644 --- a/mongoose.c +++ b/mongoose.c @@ -610,603 +610,6 @@ double cs_time() { return now; } #ifdef MG_MODULE_LINES -#line 1 "./src/../deps/frozen/frozen.c" -#endif -/* - * Copyright (c) 2004-2013 Sergey Lyubka - * Copyright (c) 2013 Cesanta Software Limited - * All rights reserved - * - * This library is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see . - * - * You are free to use this library under the terms of the GNU General - * Public License, 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. - * - * Alternatively, you can license this library under a commercial - * license, as set out in . - */ - -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005+ */ -#endif - -#include -#include -#include -#include -/* Amalgamated: #include "frozen.h" */ - -#ifdef _WIN32 -#define snprintf _snprintf -#endif - -#ifndef FROZEN_REALLOC -#define FROZEN_REALLOC realloc -#endif - -#ifndef FROZEN_FREE -#define FROZEN_FREE free -#endif - -struct frozen { - const char *end; - const char *cur; - struct json_token *tokens; - int max_tokens; - int num_tokens; - int do_realloc; -}; - -static int parse_object(struct frozen *f); -static int parse_value(struct frozen *f); - -#define EXPECT(cond, err_code) \ - do { \ - if (!(cond)) return (err_code); \ - } while (0) -#define TRY(expr) \ - do { \ - int _n = expr; \ - if (_n < 0) return _n; \ - } while (0) -#define END_OF_STRING (-1) - -static int left(const struct frozen *f) { - return f->end - f->cur; -} - -static int is_space(int ch) { - return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'; -} - -static void skip_whitespaces(struct frozen *f) { - while (f->cur < f->end && is_space(*f->cur)) f->cur++; -} - -static int cur(struct frozen *f) { - skip_whitespaces(f); - return f->cur >= f->end ? END_OF_STRING : *(unsigned char *) f->cur; -} - -static int test_and_skip(struct frozen *f, int expected) { - int ch = cur(f); - if (ch == expected) { - f->cur++; - return 0; - } - return ch == END_OF_STRING ? JSON_STRING_INCOMPLETE : JSON_STRING_INVALID; -} - -static int test_no_skip(struct frozen *f, int expected) { - int ch = cur(f); - if (ch == expected) { - return 0; - } - return ch == END_OF_STRING ? JSON_STRING_INCOMPLETE : JSON_STRING_INVALID; -} - -static int is_alpha(int ch) { - return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); -} - -static int is_digit(int ch) { - return ch >= '0' && ch <= '9'; -} - -static int is_hex_digit(int ch) { - return is_digit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'); -} - -static int get_escape_len(const char *s, int len) { - switch (*s) { - case 'u': - return len < 6 ? JSON_STRING_INCOMPLETE - : is_hex_digit(s[1]) && is_hex_digit(s[2]) && - is_hex_digit(s[3]) && is_hex_digit(s[4]) - ? 5 - : JSON_STRING_INVALID; - case '"': - case '\\': - case '/': - case 'b': - case 'f': - case 'n': - case 'r': - case 't': - return len < 2 ? JSON_STRING_INCOMPLETE : 1; - default: - return JSON_STRING_INVALID; - } -} - -static int capture_ptr(struct frozen *f, const char *ptr, enum json_type type) { - if (f->do_realloc && f->num_tokens >= f->max_tokens) { - int new_size = f->max_tokens == 0 ? 100 : f->max_tokens * 2; - void *p = FROZEN_REALLOC(f->tokens, new_size * sizeof(f->tokens[0])); - if (p == NULL) return JSON_TOKEN_ARRAY_TOO_SMALL; - f->max_tokens = new_size; - f->tokens = (struct json_token *) p; - } - if (f->tokens == NULL || f->max_tokens == 0) return 0; - if (f->num_tokens >= f->max_tokens) return JSON_TOKEN_ARRAY_TOO_SMALL; - f->tokens[f->num_tokens].ptr = ptr; - f->tokens[f->num_tokens].type = type; - f->num_tokens++; - return 0; -} - -static int capture_len(struct frozen *f, int token_index, const char *ptr) { - if (f->tokens == 0 || f->max_tokens == 0) return 0; - EXPECT(token_index >= 0 && token_index < f->max_tokens, JSON_STRING_INVALID); - f->tokens[token_index].len = ptr - f->tokens[token_index].ptr; - f->tokens[token_index].num_desc = (f->num_tokens - 1) - token_index; - return 0; -} - -/* identifier = letter { letter | digit | '_' } */ -static int parse_identifier(struct frozen *f) { - EXPECT(is_alpha(cur(f)), JSON_STRING_INVALID); - TRY(capture_ptr(f, f->cur, JSON_TYPE_STRING)); - while (f->cur < f->end && - (*f->cur == '_' || is_alpha(*f->cur) || is_digit(*f->cur))) { - f->cur++; - } - capture_len(f, f->num_tokens - 1, f->cur); - return 0; -} - -static int get_utf8_char_len(unsigned char ch) { - if ((ch & 0x80) == 0) return 1; - switch (ch & 0xf0) { - case 0xf0: - return 4; - case 0xe0: - return 3; - default: - return 2; - } -} - -/* string = '"' { quoted_printable_chars } '"' */ -static int parse_string(struct frozen *f) { - int n, ch = 0, len = 0; - TRY(test_and_skip(f, '"')); - TRY(capture_ptr(f, f->cur, JSON_TYPE_STRING)); - for (; f->cur < f->end; f->cur += len) { - ch = *(unsigned char *) f->cur; - len = get_utf8_char_len((unsigned char) ch); - EXPECT(ch >= 32 && len > 0, JSON_STRING_INVALID); /* No control chars */ - EXPECT(len < left(f), JSON_STRING_INCOMPLETE); - if (ch == '\\') { - EXPECT((n = get_escape_len(f->cur + 1, left(f))) > 0, n); - len += n; - } else if (ch == '"') { - capture_len(f, f->num_tokens - 1, f->cur); - f->cur++; - break; - }; - } - return ch == '"' ? 0 : JSON_STRING_INCOMPLETE; -} - -/* number = [ '-' ] digit+ [ '.' digit+ ] [ ['e'|'E'] ['+'|'-'] digit+ ] */ -static int parse_number(struct frozen *f) { - int ch = cur(f); - TRY(capture_ptr(f, f->cur, JSON_TYPE_NUMBER)); - if (ch == '-') f->cur++; - EXPECT(f->cur < f->end, JSON_STRING_INCOMPLETE); - EXPECT(is_digit(f->cur[0]), JSON_STRING_INVALID); - while (f->cur < f->end && is_digit(f->cur[0])) f->cur++; - if (f->cur < f->end && f->cur[0] == '.') { - f->cur++; - EXPECT(f->cur < f->end, JSON_STRING_INCOMPLETE); - EXPECT(is_digit(f->cur[0]), JSON_STRING_INVALID); - while (f->cur < f->end && is_digit(f->cur[0])) f->cur++; - } - if (f->cur < f->end && (f->cur[0] == 'e' || f->cur[0] == 'E')) { - f->cur++; - EXPECT(f->cur < f->end, JSON_STRING_INCOMPLETE); - if ((f->cur[0] == '+' || f->cur[0] == '-')) f->cur++; - EXPECT(f->cur < f->end, JSON_STRING_INCOMPLETE); - EXPECT(is_digit(f->cur[0]), JSON_STRING_INVALID); - while (f->cur < f->end && is_digit(f->cur[0])) f->cur++; - } - capture_len(f, f->num_tokens - 1, f->cur); - return 0; -} - -/* array = '[' [ value { ',' value } ] ']' */ -static int parse_array(struct frozen *f) { - int ind; - TRY(test_and_skip(f, '[')); - TRY(capture_ptr(f, f->cur - 1, JSON_TYPE_ARRAY)); - ind = f->num_tokens - 1; - while (cur(f) != ']') { - TRY(parse_value(f)); - if (cur(f) == ',') f->cur++; - } - TRY(test_and_skip(f, ']')); - capture_len(f, ind, f->cur); - return 0; -} - -static int compare(const char *s, const char *str, int len) { - int i = 0; - while (i < len && s[i] == str[i]) i++; - return i == len ? 1 : 0; -} - -static int expect(struct frozen *f, const char *s, int len, enum json_type t) { - int i, n = left(f); - - TRY(capture_ptr(f, f->cur, t)); - for (i = 0; i < len; i++) { - if (i >= n) return JSON_STRING_INCOMPLETE; - if (f->cur[i] != s[i]) return JSON_STRING_INVALID; - } - f->cur += len; - TRY(capture_len(f, f->num_tokens - 1, f->cur)); - - return 0; -} - -/* value = 'null' | 'true' | 'false' | number | string | array | object */ -static int parse_value(struct frozen *f) { - int ch = cur(f); - - switch (ch) { - case '"': - TRY(parse_string(f)); - break; - case '{': - TRY(parse_object(f)); - break; - case '[': - TRY(parse_array(f)); - break; - case 'n': - TRY(expect(f, "null", 4, JSON_TYPE_NULL)); - break; - case 't': - TRY(expect(f, "true", 4, JSON_TYPE_TRUE)); - break; - case 'f': - TRY(expect(f, "false", 5, JSON_TYPE_FALSE)); - break; - case '-': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - TRY(parse_number(f)); - break; - default: - return ch == END_OF_STRING ? JSON_STRING_INCOMPLETE : JSON_STRING_INVALID; - } - - return 0; -} - -/* key = identifier | string */ -static int parse_key(struct frozen *f) { - int ch = cur(f); -#if 0 - printf("%s 1 [%.*s]\n", __func__, (int) (f->end - f->cur), f->cur); -#endif - if (is_alpha(ch)) { - TRY(parse_identifier(f)); - } else if (ch == '"') { - TRY(parse_string(f)); - } else { - return ch == END_OF_STRING ? JSON_STRING_INCOMPLETE : JSON_STRING_INVALID; - } - return 0; -} - -/* pair = key ':' value */ -static int parse_pair(struct frozen *f) { - TRY(parse_key(f)); - TRY(test_and_skip(f, ':')); - TRY(parse_value(f)); - return 0; -} - -/* object = '{' pair { ',' pair } '}' */ -static int parse_object(struct frozen *f) { - int ind; - TRY(test_and_skip(f, '{')); - TRY(capture_ptr(f, f->cur - 1, JSON_TYPE_OBJECT)); - ind = f->num_tokens - 1; - while (cur(f) != '}') { - TRY(parse_pair(f)); - if (cur(f) == ',') f->cur++; - } - TRY(test_and_skip(f, '}')); - capture_len(f, ind, f->cur); - return 0; -} - -static int doit(struct frozen *f) { - int ret = 0; - - if (f->cur == 0 || f->end < f->cur) return JSON_STRING_INVALID; - if (f->end == f->cur) return JSON_STRING_INCOMPLETE; - - if (0 == (ret = test_no_skip(f, '{'))) { - TRY(parse_object(f)); - } else if (0 == (ret = test_no_skip(f, '['))) { - TRY(parse_array(f)); - } else { - return ret; - } - - TRY(capture_ptr(f, f->cur, JSON_TYPE_EOF)); - capture_len(f, f->num_tokens, f->cur); - return 0; -} - -/* json = object */ -int parse_json(const char *s, int s_len, struct json_token *arr, int arr_len) { - struct frozen frozen; - - memset(&frozen, 0, sizeof(frozen)); - frozen.end = s + s_len; - frozen.cur = s; - frozen.tokens = arr; - frozen.max_tokens = arr_len; - - TRY(doit(&frozen)); - - return frozen.cur - s; -} - -struct json_token *parse_json2(const char *s, int s_len) { - struct frozen frozen; - - memset(&frozen, 0, sizeof(frozen)); - frozen.end = s + s_len; - frozen.cur = s; - frozen.do_realloc = 1; - - if (doit(&frozen) < 0) { - FROZEN_FREE((void *) frozen.tokens); - frozen.tokens = NULL; - } - return frozen.tokens; -} - -static int path_part_len(const char *p) { - int i = 0; - while (p[i] != '\0' && p[i] != '[' && p[i] != '.') i++; - return i; -} - -struct json_token *find_json_token(struct json_token *toks, const char *path) { - while (path != 0 && path[0] != '\0') { - int i, ind2 = 0, ind = -1, skip = 2, n = path_part_len(path); - if (path[0] == '[') { - if (toks->type != JSON_TYPE_ARRAY || !is_digit(path[1])) return 0; - for (ind = 0, n = 1; path[n] != ']' && path[n] != '\0'; n++) { - if (!is_digit(path[n])) return 0; - ind *= 10; - ind += path[n] - '0'; - } - if (path[n++] != ']') return 0; - skip = 1; /* In objects, we skip 2 elems while iterating, in arrays 1. */ - } else if (toks->type != JSON_TYPE_OBJECT) - return 0; - toks++; - for (i = 0; i < toks[-1].num_desc; i += skip, ind2++) { - /* ind == -1 indicated that we're iterating an array, not object */ - if (ind == -1 && toks[i].type != JSON_TYPE_STRING) return 0; - if (ind2 == ind || - (ind == -1 && toks[i].len == n && compare(path, toks[i].ptr, n))) { - i += skip - 1; - break; - }; - if (toks[i - 1 + skip].type == JSON_TYPE_ARRAY || - toks[i - 1 + skip].type == JSON_TYPE_OBJECT) { - i += toks[i - 1 + skip].num_desc; - } - } - if (i == toks[-1].num_desc) return 0; - path += n; - if (path[0] == '.') path++; - if (path[0] == '\0') return &toks[i]; - toks += i; - } - return 0; -} - -int json_emit_long(char *buf, int buf_len, long int value) { - char tmp[20]; - int n = snprintf(tmp, sizeof(tmp), "%ld", value); - strncpy(buf, tmp, buf_len > 0 ? buf_len : 0); - return n; -} - -int json_emit_double(char *buf, int buf_len, double value) { - char tmp[20]; - int n = snprintf(tmp, sizeof(tmp), "%g", value); - strncpy(buf, tmp, buf_len > 0 ? buf_len : 0); - return n; -} - -int json_emit_quoted_str(char *s, int s_len, const char *str, int len) { - const char *begin = s, *end = s + s_len, *str_end = str + len; - char ch; - -#define EMIT(x) \ - do { \ - if (s < end) *s = x; \ - s++; \ - } while (0) - - EMIT('"'); - while (str < str_end) { - ch = *str++; - switch (ch) { - case '"': - EMIT('\\'); - EMIT('"'); - break; - case '\\': - EMIT('\\'); - EMIT('\\'); - break; - case '\b': - EMIT('\\'); - EMIT('b'); - break; - case '\f': - EMIT('\\'); - EMIT('f'); - break; - case '\n': - EMIT('\\'); - EMIT('n'); - break; - case '\r': - EMIT('\\'); - EMIT('r'); - break; - case '\t': - EMIT('\\'); - EMIT('t'); - break; - default: - EMIT(ch); - } - } - EMIT('"'); - if (s < end) { - *s = '\0'; - } - - return s - begin; -} - -int json_emit_unquoted_str(char *buf, int buf_len, const char *str, int len) { - if (buf_len > 0 && len > 0) { - int n = len < buf_len ? len : buf_len; - memcpy(buf, str, n); - if (n < buf_len) { - buf[n] = '\0'; - } - } - return len; -} - -int json_emit_va(char *s, int s_len, const char *fmt, va_list ap) { - const char *end = s + s_len, *str, *orig = s; - size_t len; - - while (*fmt != '\0') { - switch (*fmt) { - case '[': - case ']': - case '{': - case '}': - case ',': - case ':': - case ' ': - case '\r': - case '\n': - case '\t': - if (s < end) { - *s = *fmt; - } - s++; - break; - case 'i': - s += json_emit_long(s, end - s, va_arg(ap, long) ); - break; - case 'f': - s += json_emit_double(s, end - s, va_arg(ap, double) ); - break; - case 'v': - str = va_arg(ap, char *); - len = va_arg(ap, size_t); - s += json_emit_quoted_str(s, end - s, str, len); - break; - case 'V': - str = va_arg(ap, char *); - len = va_arg(ap, size_t); - s += json_emit_unquoted_str(s, end - s, str, len); - break; - case 's': - str = va_arg(ap, char *); - s += json_emit_quoted_str(s, end - s, str, strlen(str)); - break; - case 'S': - str = va_arg(ap, char *); - s += json_emit_unquoted_str(s, end - s, str, strlen(str)); - break; - case 'T': - s += json_emit_unquoted_str(s, end - s, "true", 4); - break; - case 'F': - s += json_emit_unquoted_str(s, end - s, "false", 5); - break; - case 'N': - s += json_emit_unquoted_str(s, end - s, "null", 4); - break; - default: - return 0; - } - fmt++; - } - - /* Best-effort to 0-terminate generated string */ - if (s < end) { - *s = '\0'; - } - - return s - orig; -} - -int json_emit(char *buf, int buf_len, const char *fmt, ...) { - int len; - va_list ap; - - va_start(ap, fmt); - len = json_emit_va(buf, buf_len, fmt, ap); - va_end(ap); - - return len; -} -#ifdef MG_MODULE_LINES #line 1 "./src/../../common/md5.c" #endif /* @@ -8245,167 +7648,6 @@ struct mg_str mg_mk_str(const char *s) { return ret; } #ifdef MG_MODULE_LINES -#line 1 "./src/json-rpc.c" -#endif -/* Copyright (c) 2014 Cesanta Software Limited */ -/* All rights reserved */ - -#ifndef MG_DISABLE_JSON_RPC - -/* Amalgamated: #include "mongoose/src/internal.h" */ -/* Amalgamated: #include "mongoose/src/json-rpc.h" */ -/* Amalgamated: #include "mongoose/deps/frozen/frozen.h" */ - -int mg_rpc_create_reply(char *buf, int len, const struct mg_rpc_request *req, - const char *result_fmt, ...) { - static const struct json_token null_tok = {"null", 4, 0, JSON_TYPE_NULL}; - const struct json_token *id = req->id == NULL ? &null_tok : req->id; - va_list ap; - int n = 0; - - n += json_emit(buf + n, len - n, "{s:s,s:", "jsonrpc", "2.0", "id"); - if (id->type == JSON_TYPE_STRING) { - n += json_emit_quoted_str(buf + n, len - n, id->ptr, id->len); - } else { - n += json_emit_unquoted_str(buf + n, len - n, id->ptr, id->len); - } - n += json_emit(buf + n, len - n, ",s:", "result"); - - va_start(ap, result_fmt); - n += json_emit_va(buf + n, len - n, result_fmt, ap); - va_end(ap); - - n += json_emit(buf + n, len - n, "}"); - - return n; -} - -int mg_rpc_create_request(char *buf, int len, const char *method, - const char *id, const char *params_fmt, ...) { - va_list ap; - int n = 0; - - n += json_emit(buf + n, len - n, "{s:s,s:s,s:s,s:", "jsonrpc", "2.0", "id", - id, "method", method, "params"); - va_start(ap, params_fmt); - n += json_emit_va(buf + n, len - n, params_fmt, ap); - va_end(ap); - - n += json_emit(buf + n, len - n, "}"); - - return n; -} - -int mg_rpc_create_error(char *buf, int len, struct mg_rpc_request *req, - int code, const char *message, const char *fmt, ...) { - va_list ap; - int n = 0; - - n += json_emit(buf + n, len - n, "{s:s,s:V,s:{s:i,s:s,s:", "jsonrpc", "2.0", - "id", req->id == NULL ? "null" : req->id->ptr, - req->id == NULL ? 4 : req->id->len, "error", "code", - (long) code, "message", message, "data"); - va_start(ap, fmt); - n += json_emit_va(buf + n, len - n, fmt, ap); - va_end(ap); - - n += json_emit(buf + n, len - n, "}}"); - - return n; -} - -int mg_rpc_create_std_error(char *buf, int len, struct mg_rpc_request *req, - int code) { - const char *message = NULL; - - switch (code) { - case JSON_RPC_PARSE_ERROR: - message = "parse error"; - break; - case JSON_RPC_INVALID_REQUEST_ERROR: - message = "invalid request"; - break; - case JSON_RPC_METHOD_NOT_FOUND_ERROR: - message = "method not found"; - break; - case JSON_RPC_INVALID_PARAMS_ERROR: - message = "invalid parameters"; - break; - case JSON_RPC_SERVER_ERROR: - message = "server error"; - break; - default: - message = "unspecified error"; - break; - } - - return mg_rpc_create_error(buf, len, req, code, message, "N"); -} - -int mg_rpc_dispatch(const char *buf, int len, char *dst, int dst_len, - const char **methods, mg_rpc_handler_t *handlers) { - struct json_token tokens[200]; - struct mg_rpc_request req; - int i, n; - - memset(&req, 0, sizeof(req)); - n = parse_json(buf, len, tokens, sizeof(tokens) / sizeof(tokens[0])); - if (n <= 0) { - int err_code = (n == JSON_STRING_INVALID) ? JSON_RPC_PARSE_ERROR - : JSON_RPC_SERVER_ERROR; - return mg_rpc_create_std_error(dst, dst_len, &req, err_code); - } - - req.message = tokens; - req.id = find_json_token(tokens, "id"); - req.method = find_json_token(tokens, "method"); - req.params = find_json_token(tokens, "params"); - - if (req.id == NULL || req.method == NULL) { - return mg_rpc_create_std_error(dst, dst_len, &req, - JSON_RPC_INVALID_REQUEST_ERROR); - } - - for (i = 0; methods[i] != NULL; i++) { - int mlen = strlen(methods[i]); - if (mlen == req.method->len && - memcmp(methods[i], req.method->ptr, mlen) == 0) - break; - } - - if (methods[i] == NULL) { - return mg_rpc_create_std_error(dst, dst_len, &req, - JSON_RPC_METHOD_NOT_FOUND_ERROR); - } - - return handlers[i](dst, dst_len, &req); -} - -int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks, - int max_toks, struct mg_rpc_reply *rep, - struct mg_rpc_error *er) { - int n = parse_json(buf, len, toks, max_toks); - - memset(rep, 0, sizeof(*rep)); - memset(er, 0, sizeof(*er)); - - if (n > 0) { - if ((rep->result = find_json_token(toks, "result")) != NULL) { - rep->message = toks; - rep->id = find_json_token(toks, "id"); - } else { - er->message = toks; - er->id = find_json_token(toks, "id"); - er->error_code = find_json_token(toks, "error.code"); - er->error_message = find_json_token(toks, "error.message"); - er->error_data = find_json_token(toks, "error.data"); - } - } - return n; -} - -#endif /* MG_DISABLE_JSON_RPC */ -#ifdef MG_MODULE_LINES #line 1 "./src/mqtt.c" #endif /* diff --git a/mongoose.h b/mongoose.h index 7ecccc13..00799f50 100644 --- a/mongoose.h +++ b/mongoose.h @@ -1067,74 +1067,6 @@ const char *c_strnstr(const char *s, const char *find, size_t slen); #endif #endif /* CS_COMMON_STR_UTIL_H_ */ -/* - * Copyright (c) 2004-2013 Sergey Lyubka - * Copyright (c) 2013 Cesanta Software Limited - * All rights reserved - * - * This library is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see . - * - * You are free to use this library under the terms of the GNU General - * Public License, 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. - * - * Alternatively, you can license this library under a commercial - * license, as set out in . - */ - -#ifndef CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_ -#define CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -enum json_type { - JSON_TYPE_EOF = 0, /* End of parsed tokens marker */ - JSON_TYPE_STRING = 1, - JSON_TYPE_NUMBER = 2, - JSON_TYPE_OBJECT = 3, - JSON_TYPE_TRUE = 4, - JSON_TYPE_FALSE = 5, - JSON_TYPE_NULL = 6, - JSON_TYPE_ARRAY = 7 -}; - -struct json_token { - const char *ptr; /* Points to the beginning of the token */ - int len; /* Token length */ - int num_desc; /* For arrays and object, total number of descendants */ - enum json_type type; /* Type of the token, possible values above */ -}; - -/* Error codes */ -#define JSON_STRING_INVALID -1 -#define JSON_STRING_INCOMPLETE -2 -#define JSON_TOKEN_ARRAY_TOO_SMALL -3 - -int parse_json(const char *json_string, int json_string_length, - struct json_token *tokens_array, int size_of_tokens_array); -struct json_token *parse_json2(const char *json_string, int string_length); -struct json_token *find_json_token(struct json_token *toks, const char *path); - -int json_emit_long(char *buf, int buf_len, long value); -int json_emit_double(char *buf, int buf_len, double value); -int json_emit_quoted_str(char *buf, int buf_len, const char *str, int len); -int json_emit_unquoted_str(char *buf, int buf_len, const char *str, int len); -int json_emit(char *buf, int buf_len, const char *fmt, ...); -int json_emit_va(char *buf, int buf_len, const char *fmt, va_list); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_ */ /* * Copyright (c) 2014 Cesanta Software Limited * All rights reserved @@ -2754,144 +2686,6 @@ int mg_http_check_digest_auth(struct http_message *hm, const char *auth_domain, } #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_HTTP_H_ */ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ - -/* - * === JSON-RPC - */ - -#ifndef CS_MONGOOSE_SRC_JSON_RPC_H_ -#define CS_MONGOOSE_SRC_JSON_RPC_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* JSON-RPC request */ -struct mg_rpc_request { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *method; /* Method name */ - struct json_token *params; /* Method params */ -}; - -/* JSON-RPC response */ -struct mg_rpc_reply { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *result; /* Remote call result */ -}; - -/* JSON-RPC error */ -struct mg_rpc_error { - struct json_token *message; /* Whole RPC message */ - struct json_token *id; /* Message ID */ - struct json_token *error_code; /* error.code */ - struct json_token *error_message; /* error.message */ - struct json_token *error_data; /* error.data, can be NULL */ -}; - -/* - * Parse JSON-RPC reply contained in `buf`, `len` into JSON tokens array - * `toks`, `max_toks`. If buffer contains valid reply, `reply` structure is - * populated. The result of RPC call is located in `reply.result`. On error, - * `error` structure is populated. Returns: the result of calling - * `parse_json(buf, len, toks, max_toks)`: - * - * On success, an offset inside `json_string` is returned - * where parsing has finished. On failure, a negative number is - * returned, one of: - * - * - `#define JSON_STRING_INVALID -1` - * - `#define JSON_STRING_INCOMPLETE -2` - * - `#define JSON_TOKEN_ARRAY_TOO_SMALL -3` - */ -int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks, - int max_toks, struct mg_rpc_reply *, - struct mg_rpc_error *); - -/* - * Create JSON-RPC request in a given buffer. - * - * Return length of the request, which - * can be larger then `len` that indicates an overflow. - * `params_fmt` format string should conform to `json_emit()` API, - * see https://github.com/cesanta/frozen - */ -int mg_rpc_create_request(char *buf, int len, const char *method, - const char *id, const char *params_fmt, ...); - -/* - * Create JSON-RPC reply in a given buffer. - * - * Return length of the reply, which - * can be larger then `len` that indicates an overflow. - * `result_fmt` format string should conform to `json_emit()` API, - * see https://github.com/cesanta/frozen - */ -int mg_rpc_create_reply(char *buf, int len, const struct mg_rpc_request *req, - const char *result_fmt, ...); - -/* - * Create JSON-RPC error reply in a given buffer. - * - * Return length of the error, which - * can be larger then `len` that indicates an overflow. - * `fmt` format string should conform to `json_emit()` API, - * see https://github.com/cesanta/frozen - */ -int mg_rpc_create_error(char *buf, int len, struct mg_rpc_request *req, - int code, const char *message, const char *fmt, ...); - -/* JSON-RPC standard error codes */ -#define JSON_RPC_PARSE_ERROR (-32700) -#define JSON_RPC_INVALID_REQUEST_ERROR (-32600) -#define JSON_RPC_METHOD_NOT_FOUND_ERROR (-32601) -#define JSON_RPC_INVALID_PARAMS_ERROR (-32602) -#define JSON_RPC_INTERNAL_ERROR (-32603) -#define JSON_RPC_SERVER_ERROR (-32000) - -/* - * Create JSON-RPC error in a given buffer. - * - * Return length of the error, which - * can be larger then `len` that indicates an overflow. See - * JSON_RPC_*_ERROR definitions for standard error values: - * - * - `#define JSON_RPC_PARSE_ERROR (-32700)` - * - `#define JSON_RPC_INVALID_REQUEST_ERROR (-32600)` - * - `#define JSON_RPC_METHOD_NOT_FOUND_ERROR (-32601)` - * - `#define JSON_RPC_INVALID_PARAMS_ERROR (-32602)` - * - `#define JSON_RPC_INTERNAL_ERROR (-32603)` - * - `#define JSON_RPC_SERVER_ERROR (-32000)` - */ -int mg_rpc_create_std_error(char *buf, int len, struct mg_rpc_request *req, - int code); - -typedef int (*mg_rpc_handler_t)(char *buf, int len, struct mg_rpc_request *req); - -/* - * Dispatches a JSON-RPC request. - * - * Parses JSON-RPC request contained in `buf`, `len`. - * Then, dispatches the request to the correct handler method. - * Valid method names should be specified in NULL - * terminated array `methods`, and corresponding handlers in `handlers`. - * Result is put in `dst`, `dst_len`. Return: length of the result, which - * can be larger then `dst_len` that indicates an overflow. - * Overflown bytes are not written to the buffer. - * If method is not found, an error is automatically generated. - */ -int mg_rpc_dispatch(const char *buf, int, char *dst, int dst_len, - const char **methods, mg_rpc_handler_t *handlers); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CS_MONGOOSE_SRC_JSON_RPC_H_ */ /* * Copyright (c) 2014 Cesanta Software Limited * All rights reserved