From 849d406b376d0c153bc3bbe9803d43781fda448f Mon Sep 17 00:00:00 2001 From: Felipe Orellana Date: Wed, 9 Oct 2019 16:26:26 +0000 Subject: [PATCH 1/7] fix: Old sushant css color f*ck up --- awesome_cart/public/css/awc_cart.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awesome_cart/public/css/awc_cart.css b/awesome_cart/public/css/awc_cart.css index aedc2f2..ea506ad 100644 --- a/awesome_cart/public/css/awc_cart.css +++ b/awesome_cart/public/css/awc_cart.css @@ -571,11 +571,11 @@ body.is_logged_in .coupon_input.no-login { } input:checked + .slide { - background-color: #000000;/*#2196F3;*/ + background-color: #2196F3; } input:focus + .slide { - box-shadow: 0 0 1px #000000;/*#2196F3;*/ + box-shadow: 0 0 1px#2196F3; } input:checked + .slide:before { @@ -591,6 +591,7 @@ input:checked + .slide:before { .slide.round:before { border-radius: 50%; + background: white; } /* Use customer Fedex toggle End */ From 7a5d034e0c429311ab9f68c7d312ce5c9c6e40a4 Mon Sep 17 00:00:00 2001 From: Felipe Orellana Date: Thu, 10 Oct 2019 01:31:26 +0000 Subject: [PATCH 2/7] chore: spacing --- awesome_cart/public/css/awc_cart.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesome_cart/public/css/awc_cart.css b/awesome_cart/public/css/awc_cart.css index ea506ad..6cad68a 100644 --- a/awesome_cart/public/css/awc_cart.css +++ b/awesome_cart/public/css/awc_cart.css @@ -575,7 +575,7 @@ input:checked + .slide { } input:focus + .slide { - box-shadow: 0 0 1px#2196F3; + box-shadow: 0 0 1px #2196F3; } input:checked + .slide:before { From 6e57796231d1b005b71f4b3f104345544febcbf8 Mon Sep 17 00:00:00 2001 From: Felipe Orellana Date: Sat, 23 Nov 2019 07:26:19 -0500 Subject: [PATCH 3/7] feat: Adds insert item logic throuth simple zscript (#337) --- awesome_cart/awc.py | 250 +++++++++++--- .../doctype/awc_coupon/awc_coupon.py | 54 +++- .../awc_coupon_insert_item.json | 305 +++++++++++++++++- .../public/js/client/awc.standalone.js | 4 +- awesome_cart/utils.py | 2 +- awesome_cart/zscript.py | 73 +++++ 6 files changed, 630 insertions(+), 58 deletions(-) create mode 100644 awesome_cart/zscript.py diff --git a/awesome_cart/awc.py b/awesome_cart/awc.py index 04c2a5d..53e7d0a 100755 --- a/awesome_cart/awc.py +++ b/awesome_cart/awc.py @@ -4,6 +4,7 @@ import traceback import frappe import datetime +import json import uuid from frappe import _dict, _ @@ -17,6 +18,7 @@ from .session import * from .utils import is_coupon_valid from .awesome_cart.doctype.awc_coupon.awc_coupon import calculate_coupon_discount +import zscript from dti_devtools.debug import pretty_json, log @@ -657,6 +659,23 @@ def collect_totals(quotation, awc, awc_session): awc["totals"]["other"] = [] awc["totals"]["grand_total"] = awc["totals"]["sub_total"] + awc["totals"].get("shipping_total", 0) +def insert_context(awc, quotation, extra=None): + insert_ids = {} + for q in quotation.get("items", []): + if q.awc_insert_id: + insert_ids[q.awc_insert_id] = insert_ids.get(q.awc_insert_id, 0) + 1 + + context = { + "order_total": awc["totals"]["grand_total"], + "coupon_code": quotation.coupon_code if quotation else "", + "insert_ids": json.dumps(insert_ids) + } + + if extra: + context.update(extra) + + return context + def sync_awc_and_quotation(awc_session, quotation, quotation_is_dirty=False, save_quotation=False): # convert quotation to awc object # and merge items in the case where items are added before logging in. @@ -731,10 +750,16 @@ def sync_awc_and_quotation(awc_session, quotation, quotation_is_dirty=False, sav if awc_item.get("id"): idx = find_index(quotation.get("items", []), lambda itm: itm.get("name") == awc_item.get("id")) + insert_logic = awc_item.get('options', {}).get('insert_logic', False) + keep_item = True + if insert_logic: + keep_item = zscript.run(insert_logic, insert_context(awc, quotation)) + if idx > -1: item = quotation.items[idx] + # make sure product exists - if product_found: + if product_found and keep_item: if item.awc_lock_qty != awc_item.get("lock_qty", 0): item.awc_lock_qty = awc_item.get("lock_qty", 0) @@ -768,6 +793,14 @@ def sync_awc_and_quotation(awc_session, quotation, quotation_is_dirty=False, sav item.image = awc_item["options"]["image"] quotation_is_dirty = True + if item.awc_insert_logic != insert_logic: + item.awc_insert_logic = insert_logic + quotation_is_dirty = True + + if item.awc_insert_id != awc_item.get('options', {}).get('insert_id', None): + item.awc_insert_id = awc_item.get('options', {}).get('insert_id', None) + quotation_is_dirty = True + item.warehouse = product.get("warehouse") update_quotation_item_awc_fields(item, awc_item) @@ -787,7 +820,7 @@ def sync_awc_and_quotation(awc_session, quotation, quotation_is_dirty=False, sav # remove orphaned items awc_items_to_remove.append(awc_item) else: - if product_found: + if product_found and keep_item: # no quotation item matched, so lets create one item_data = { @@ -803,6 +836,9 @@ def sync_awc_and_quotation(awc_session, quotation, quotation_is_dirty=False, sav if awc_item.get("options", {}).get("image"): item_data["image"] = awc_item["options"]["image"] + if insert_logic: + item_data["awc_insert_logic"] = insert_logic + update_quotation_item_awc_fields(item_data, awc_item) new_quotation_item = quotation.append("items", item_data) @@ -1273,8 +1309,15 @@ def add_to_cart(data, awc_session, quotation, allow_qty_lock=False): quotation_is_dirty = False awc = awc_session.get("cart") to_remove = [] + icontext = insert_context(awc, quotation) for item in data: + + insert_logic = item.get("options", {}).get("insert_logic") + if insert_logic: + if not zscript.run(insert_logic, icontext): + continue # skip adding items that don't pass logic test + if item.get("id", None) is None: item["id"] = str(uuid.uuid4()) @@ -1313,6 +1356,12 @@ def add_to_cart(data, awc_session, quotation, allow_qty_lock=False): "lock_qty": item.get("lock_qty", 0) if allow_qty_lock else 0 } + if insert_logic: + item_data.update({ + "awc_insert_logic": insert_logic, + "awc_insert_id": item.get("options", {}).get("insert_id", None) + }) + update_quotation_item_awc_fields(item_data, item) quotation_item = quotation.append("items", item_data) @@ -1512,6 +1561,10 @@ def cart(data=None, action=None): if quotation: quotation_is_dirty=True + if quotation.coupon_code: + coupon_success, coupon_msg, quotation_is_dirty, coupon_is_valid, coupon_removed_ids = apply_coupon(awc, awc_session, quotation, quotation.coupon_code, quotation_is_dirty) + removed_ids = removed_ids + list(set(coupon_removed_ids) - set(removed_ids)) + save_and_commit_quotation(quotation, quotation_is_dirty, awc_session, commit=True) @@ -1524,6 +1577,10 @@ def cart(data=None, action=None): elif action == "addToCart": quotation_is_dirty, removed_ids = add_to_cart(data, awc_session, quotation) + if quotation.coupon_code: + coupon_success, coupon_msg, quotation_is_dirty, coupon_is_valid, coupon_removed_ids = apply_coupon(awc, awc_session, quotation, quotation.coupon_code, quotation_is_dirty) + removed_ids = removed_ids + list(set(coupon_removed_ids) - set(removed_ids)) + save_and_commit_quotation(quotation, quotation_is_dirty, awc_session, commit=True) return session_response({ @@ -1537,6 +1594,9 @@ def cart(data=None, action=None): removed_ids = [] success, removed_ids, awc_items = remove_from_cart(data, awc["items"]) + if quotation.coupon_code: + coupon_success, coupon_msg, quotation_is_dirty, coupon_is_valid, coupon_removed_ids = apply_coupon(awc, awc_session, quotation, quotation.coupon_code, quotation_is_dirty) + removed_ids = removed_ids + list(set(coupon_removed_ids) - set(removed_ids)) if success: @@ -1569,50 +1629,11 @@ def cart(data=None, action=None): msg = "Coupon not found" if quotation: - # validate coupon - msg = is_coupon_valid(coupon) - is_valid = frappe.response.get("is_coupon_valid") - - if is_valid: - shipping_method = awc_session.get("shipping_method", {}).get("name") or (quotation.get("fedex_shipping_method") or "").upper() - discount, msg, apply_discount_on, coupon_state, has_services, has_total_limit = calculate_coupon_discount({ - "items": quotation.items, - "code": coupon, - "accounts": quotation.taxes, - "grand_total": quotation.base_grand_total, - "net_total": quotation.base_net_total, - "is_ground_shipping": True if "GROUND" in shipping_method else False - }) - - if has_total_limit or (discount == 0 and not frappe.response.get("coupon_insert_items", False) and not has_services): - is_valid = False - success = False - awc["discounts"] = None - if not has_total_limit: - msg = "Coupon is invalid for the current cart." - else: - awc["discounts"] = coupon_state - - insert_items = frappe.response.get("coupon_insert_items", False) + success, msg, quotation_is_dirty, is_valid, removed_ids = apply_coupon(awc, awc_session, quotation, coupon, quotation_is_dirty) - if insert_items: - - insert_items = [ \ - x for x in insert_items \ - if cart_sku_qty(x.get("sku"), awc_session) < x.get("qty", 0) and \ - quotation.base_grand_total >= x.get("total_is_greater_than", 0) \ - ] - if len(insert_items) > 0: - quotation_is_dirty, removed_ids = add_to_cart(insert_items, awc_session, quotation, True) - result["removed_ids"] = removed_ids + if success: + result["removed"] = removed_ids - quotation.coupon_code = coupon - quotation_is_dirty = True - success = True - else: - awc["discounts"] = None - if "coupon" in awc["totals"]: - del awc["totals"]["coupon"] else: # must be logged in to use cupon success = False @@ -1621,7 +1642,7 @@ def cart(data=None, action=None): if "coupon" in awc["totals"]: del awc["totals"]["coupon"] - save_and_commit_quotation(quotation, quotation_is_dirty, awc_session, commit=True) + save_and_commit_quotation(quotation, quotation_is_dirty, awc_session, commit=True, save_session=True) if not success: result["message"] = _(msg) @@ -1631,19 +1652,23 @@ def cart(data=None, action=None): return session_response(result, awc_session, quotation) elif action == "removeCoupon": + removed_ids = [] + awc["discounts"] = None if "coupon" in awc["totals"]: del awc["totals"]["coupon"] if quotation: quotation.discount_amount = 0 - quotation.coupon_code = None - quotation_is_dirty = True + quotation.coupon_code = "" + coupon_success, coupon_msg, quotation_is_dirty, coupon_is_valid, coupon_removed_ids = run_insert_logic(awc, awc_session, quotation, quotation_is_dirty) + removed_ids = removed_ids + list(set(coupon_removed_ids) - set(removed_ids)) - save_and_commit_quotation(quotation, quotation_is_dirty, awc_session, commit=True) + save_and_commit_quotation(quotation, True, awc_session, commit=True) return session_response({ - "success": True + "success": True, + "removed": removed_ids, }, awc_session, quotation) else: @@ -1652,6 +1677,133 @@ def cart(data=None, action=None): "message": "Unknown Command." }, awc_session, quotation) +def apply_coupon(awc, awc_session, quotation, coupon, quotation_is_dirty): + if not coupon: + is_valid = False + msg = None + else: + msg = is_coupon_valid(coupon) + is_valid = frappe.response.get("is_coupon_valid") + + removed_ids = [] + icontext = insert_context(awc, quotation, { + "coupon_code": coupon + }) + + if is_valid: + shipping_method = awc_session.get("shipping_method", {}).get("name") or (quotation.get("fedex_shipping_method") or "").upper() + discount, msg, apply_discount_on, coupon_state, has_services, has_total_limit = calculate_coupon_discount({ + "items": quotation.items, + "code": coupon, + "accounts": quotation.taxes, + "grand_total": quotation.base_grand_total, + "net_total": quotation.base_net_total, + "is_ground_shipping": True if "GROUND" in shipping_method else False + }) + + if has_total_limit or \ + (discount == 0 and ( \ + len(frappe.response.get("coupon_insert_items", [])) == 0 and \ + not has_services + )): + + remove_items = find_items_with_insert_id(awc["items"]) + remove_success, removed_quotation_item_ids, awc_items = remove_from_cart( + remove_items, awc["items"]) + + if remove_success: + # replace items with filtered version + awc["items"] = awc_items + removed_ids = removed_ids + list(set(removed_quotation_item_ids) - set(removed_ids)) + + is_valid = False + success = False + awc["discounts"] = None + quotation.coupon_code = "" + if not has_total_limit: + msg = "Coupon is invalid for the current cart." + else: + awc["discounts"] = coupon_state + + insert_items = frappe.response.get("coupon_insert_items", []) + + add_items = [] + remove_items = [] + + for x in insert_items: + insert_logic = x.get("options", {}).get("insert_logic", False) + if insert_logic: + is_truthy = zscript.run(insert_logic, icontext) + else: + is_truthy = False + + if is_truthy: + if not find_item_by_insert_id(awc["items"], x.get("options").get("insert_id")): + add_items.append(x) + else: + remove_insert_id = find_item_by_insert_id(awc["items"], x.get("options").get("insert_id")) + if remove_insert_id: + remove_items.append(remove_insert_id) + + quotation.coupon_code = coupon + quotation_is_dirty = True + + # add passing logic items + if len(add_items) > 0: + quotation_is_dirty, removed_ids = add_to_cart(add_items, awc_session, quotation, True) + + # remove non passing logic items + if len(remove_items) > 0: + remove_success, removed_quotation_item_ids, awc_items = remove_from_cart( + remove_items, awc["items"]) + if remove_success: + # replace items with filtered version + awc["items"] = awc_items + removed_ids += list(set(removed_quotation_item_ids) - set(removed_ids)) + + sucess = True + else: + sucess = False + awc["discounts"] = None + quotation.coupon_code = None + if "coupon" in awc["totals"]: + del awc["totals"]["coupon"] + + remove_items = find_items_with_insert_id(awc["items"]) + remove_success, removed_quotation_item_ids, awc_items = remove_from_cart( + remove_items, awc["items"]) + + if remove_success: + # replace items with filtered version + awc["items"] = awc_items + removed_ids += list(set(removed_quotation_item_ids) - set(removed_ids)) + + if len(removed_ids) > 0: + quotation_items = [ \ + itm for itm in quotation.get("items", []) \ + if itm.name not in removed_ids \ + ] + awc["items"] = [ i for i in awc.get("items", []) if i.get("id") not in removed_ids ] + quotation.set("items", quotation_items) + + return (sucess, msg, quotation_is_dirty, is_valid, removed_ids) + +def find_item_by_insert_id(awc_items, id): + for item in awc_items: + if item.get("options", {}).get("insert_id") == id: + return item + return False + +def find_items_with_insert_id(awc_items): + result = [] + for item in awc_items: + if item.get("options", {}).get("insert_id"): + result.append(item) + return result + +def run_insert_logic(awc, awc_session, quotation, quotation_is_dirty): + return apply_coupon(awc, awc_session, quotation, quotation.coupon_code, quotation_is_dirty) + @frappe.whitelist() def get_shipping_rate(address): diff --git a/awesome_cart/awesome_cart/doctype/awc_coupon/awc_coupon.py b/awesome_cart/awesome_cart/doctype/awc_coupon/awc_coupon.py index 217fb2a..0155cf8 100644 --- a/awesome_cart/awesome_cart/doctype/awc_coupon/awc_coupon.py +++ b/awesome_cart/awesome_cart/doctype/awc_coupon/awc_coupon.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe +import json from frappe import _ from frappe.model.document import Document @@ -348,12 +349,55 @@ def is_coupon_valid(coupon_code, customer, now=None): items_to_insert = [] for insert_item in coupon_doc.insert_items: - items_to_insert.append({ - "sku": frappe.db.get_value("Item", insert_item.item_name, "item_code"), + insert_logic = False + sku = frappe.db.get_value("Item", insert_item.item_name, "item_code") + insert_id= "%s|%s|%s" % (coupon_code, sku, insert_item.qty) + options = { + "insert_id": insert_id + } + insert_data = { + "sku": sku, "qty": insert_item.qty, - "lock_qty": insert_item.get("lock_qty", False), - "total_is_greater_than": insert_item.get("total_is_greater_than", 0) - }) + "lock_qty": insert_item.get("lock_qty", False) + } + + # Defines a custom insert logic to later test and remove item depending on this logic result. + if insert_item.get("insert_logic") == "Between": + insert_logic = [ + "and", + ["==", "{coupon_code}", coupon_code], + [">=", ["float", "{order_total}"], insert_item.get("insert_min")], + ["<=", ["float", "{order_total}"], insert_item.get("insert_max")] + ] + elif insert_item.get("insert_logic") == "Minimum": + insert_logic = [ + "and", + ["==", "{coupon_code}", coupon_code], + [">=", ["float", "{order_total}"], insert_item.get("insert_min")] + ] + elif insert_item.get("insert_logic") == "Maximum": + insert_logic = [ + "and", + ["==", "{coupon_code}", coupon_code], + ["<=", ["float", "{order_total}"], insert_item.get("insert_max")] + ] + + if insert_logic: + options.update({ + "insert_logic": json.dumps(insert_logic) + }) + + if insert_item.get("price_override"): + options.update({ + "custom": { + "rate": insert_item.get("insert_price") + } + }) + + if len(options.keys()) > 0: + insert_data.update({ "options": options }) + + items_to_insert.append(insert_data) return { "is_valid": True, diff --git a/awesome_cart/awesome_cart/doctype/awc_coupon_insert_item/awc_coupon_insert_item.json b/awesome_cart/awesome_cart/doctype/awc_coupon_insert_item/awc_coupon_insert_item.json index a0b3e0b..08d7cc8 100644 --- a/awesome_cart/awesome_cart/doctype/awc_coupon_insert_item/awc_coupon_insert_item.json +++ b/awesome_cart/awesome_cart/doctype/awc_coupon_insert_item/awc_coupon_insert_item.json @@ -105,6 +105,309 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sb_logic", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Logic", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Any Value", + "fieldname": "insert_logic", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Insert when total is", + "length": 0, + "no_copy": 0, + "options": "Any Value\nMinimum\nMaximum\nBetween\n", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb_logic1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "depends_on": "eval:(doc.insert_logic==\"Minimum\" || doc.insert_logic==\"Between\")", + "fieldname": "insert_min", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Minimum", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb_logic2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:(doc.insert_logic==\"Maximum\" || doc.insert_logic==\"Between\")", + "fieldname": "insert_max", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Maximum", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sb_price", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "price_override", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Override Price?", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cb_price1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:doc.price_override==1", + "fieldname": "insert_price", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Price", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -117,7 +420,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-12-11 12:42:14.256081", + "modified": "2019-11-22 12:35:45.253984", "modified_by": "Administrator", "module": "Awesome Cart", "name": "AWC Coupon Insert Item", diff --git a/awesome_cart/public/js/client/awc.standalone.js b/awesome_cart/public/js/client/awc.standalone.js index e7b6bd8..7924e7d 100644 --- a/awesome_cart/public/js/client/awc.standalone.js +++ b/awesome_cart/public/js/client/awc.standalone.js @@ -1,2 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).awc=t()}}(function(){return function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){return i(e[a][1][t]||t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0;)p(t)}function p(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var n=t.shift(),r=t.shift();e.call(n,r)}}u.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(e,n){n?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},u.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(u.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?c.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},u.prototype.invoke=function(t,e,n){this._trampolineEnabled?l.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},u.prototype.settlePromises=function(t){this._trampolineEnabled?f.call(this,t):this._schedule(function(){t._settlePromises()})}):(u.prototype.invokeLater=c,u.prototype.invoke=l,u.prototype.settlePromises=f),u.prototype._drainQueues=function(){h(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,h(this._lateQueue)},u.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},u.prototype._reset=function(){this._isTickUsed=!1},n.exports=u,n.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var c=n(o),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,a,void 0,l,h),c._then(s,u,void 0,l,h),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";var r;"undefined"!=typeof Promise&&(r=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=r)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){var n=t("./util"),r=n.canEvaluate;function i(t){return function(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}(t,this.pop()).apply(t,this)}function o(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}n.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(i,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=a;else if(r){var n=(void 0)(t);e=null!==n?n:o}else e=o;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0)return n[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},r.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},r.prototype._popContext=function(){if(void 0!==this._trace){var t=n.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},r.CapturedTrace=null,r.create=function(){if(e)return new r},r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;r.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=r.prototype._pushContext,t.prototype._popContext=r.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},r}},{}],9:[function(e,n,r){"use strict";n.exports=function(n,r){var i,o,a,s=n._getDomain,u=n._async,c=e("./errors").Warning,l=e("./util"),f=e("./es5"),h=l.canAttachTrace,p=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,v=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,_=null,y=!1,m=!(0==l.env("BLUEBIRD_DEBUG")),b=!(0==l.env("BLUEBIRD_WARNINGS")||!m&&!l.env("BLUEBIRD_WARNINGS")),w=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!m&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},n.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},n.prototype._notifyUnhandledRejectionIsHandled=function(){W("rejectionHandled",i,void 0,this)},n.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},n.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),W("unhandledRejection",o,t,this)}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},n.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},n.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},n.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},n.prototype._warn=function(t,e,n){return H(t,e,n||this)},n.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:l.domainBind(e,t):void 0},n.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:l.domainBind(e,t):void 0};var x=function(){};n.longStackTraces=function(){if(u.haveItemsQueued()&&!Z.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Z.longStackTraces&&G()){var t=n.prototype._captureStackTrace,e=n.prototype._attachExtraTrace,i=n.prototype._dereferenceTrace;Z.longStackTraces=!0,x=function(){if(u.haveItemsQueued()&&!Z.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");n.prototype._captureStackTrace=t,n.prototype._attachExtraTrace=e,n.prototype._dereferenceTrace=i,r.deactivateLongStackTraces(),u.enableTrampoline(),Z.longStackTraces=!1},n.prototype._captureStackTrace=D,n.prototype._attachExtraTrace=B,n.prototype._dereferenceTrace=U,r.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},n.hasLongStackTraces=function(){return Z.longStackTraces&&G()};var k=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return l.global.dispatchEvent(t),function(t,e){var n={detail:e,cancelable:!0};f.defineProperty(n,"promise",{value:e.promise}),f.defineProperty(n,"reason",{value:e.reason});var r=new CustomEvent(t.toLowerCase(),n);return!l.global.dispatchEvent(r)}}return"function"==typeof Event?(t=new Event("CustomEvent"),l.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,f.defineProperty(n,"promise",{value:e.promise}),f.defineProperty(n,"reason",{value:e.reason}),!l.global.dispatchEvent(n)}):((t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!l.global.dispatchEvent(n)})}catch(t){}return function(){return!1}}(),E=l.isNode?function(){return t.emit.apply(t,arguments)}:l.global?function(t){var e="on"+t.toLowerCase(),n=l.global[e];return!!n&&(n.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function C(t,e){return{promise:e}}var P={promiseCreated:C,promiseFulfilled:C,promiseRejected:C,promiseResolved:C,promiseCancelled:C,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:C},O=function(t){var e=!1;try{e=E.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var n=!1;try{n=k(t,P[t].apply(null,arguments))}catch(t){u.throwLater(t),n=!0}return n||e};function A(){return!1}function j(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+l.toString(t));r._attachCancellationCallback(t)})}catch(t){return t}}function L(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?l.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function F(){return this._onCancelField}function R(t){this._onCancelField=t}function T(){this._cancellationParent=void 0,this._onCancelField=void 0}function I(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}n.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?n.longStackTraces():!t.longStackTraces&&n.hasLongStackTraces()&&x()),"warnings"in t){var e=t.warnings;Z.warnings=!!e,S=Z.warnings,l.isObject(e)&&"wForgottenReturn"in e&&(S=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Z.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=T,n.prototype._propagateFrom=I,n.prototype._onCancel=F,n.prototype._setOnCancel=R,n.prototype._attachCancellationCallback=L,n.prototype._execute=j,M=I,Z.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Z.monitoring?(Z.monitoring=!0,n.prototype._fireEvent=O):!t.monitoring&&Z.monitoring&&(Z.monitoring=!1,n.prototype._fireEvent=A)),n},n.prototype._fireEvent=A,n.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(t){},n.prototype._attachCancellationCallback=function(t){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._dereferenceTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(t,e){};var M=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function N(){var t=this._boundTo;return void 0!==t&&t instanceof n?t.isFulfilled()?t.value():void 0:t}function D(){this._trace=new X(this._peekContext())}function B(t,e){if(h(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=V(t);l.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),l.notEnumerableProp(t,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function H(t,e,r){if(Z.warnings){var i,o=new c(t);if(e)r._attachExtraTrace(o);else if(Z.longStackTraces&&(i=n._peekContext()))i.attachExtraTrace(o);else{var a=V(o);o.stack=a.message+"\n"+a.stack.join("\n")}O("warning",o)||q(o,"",!0)}}function $(t){for(var e=[],n=0;n0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:$(e)}}function q(t,e,n){if("undefined"!=typeof console){var r;if(l.isObject(t)){var i=t.stack;r=e+_(i,t)}else r=e+String(t);"function"==typeof a?a(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function W(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){u.throwLater(t)}"unhandledRejection"===t?O(t,n,r)||i||q(n,"Unhandled rejection "):O(t,r)}function z(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{if(e=t&&"function"==typeof t.toString?t.toString():l.toString(t),/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){return t.length<41?t:t.substr(0,38)+"..."}(e)+">, no stack trace)"}function G(){return"function"==typeof Y}var K=function(){return!1},Q=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function J(t){var e=t.match(Q);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function X(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);Y(this,X),e>32&&this.uncycle()}l.inherits(X,Error),r.CapturedTrace=X,X.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;for(r=(t=this._length=r)-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(r=0;r0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var s=r>0?e[r-1]:this;a=0;--c)e[c]._length=u,u++;return}}}},X.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=V(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push($(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],n=1;n=0;--s)if(r[s]===o){a=s;break}for(s=a;s>=0;--s){var u=r[s];if(e[i]!==u)break;e.pop(),i--}e=r}}(r),function(t){for(var e=0;e=0)return g=/@/,_=e,y=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){r="stack"in t}return"stack"in i||!r||"number"!=typeof Error.stackTraceLimit?(_=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?z(e):e.toString()},null):(g=t,_=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},l.isNode&&t.stderr.isTTY?a=function(t,e){var n=e?"\x1b[33m":"\x1b[31m";console.warn(n+t+"\x1b[0m\n")}:l.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var Z={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&n.longStackTraces(),{longStackTraces:function(){return Z.longStackTraces},warnings:function(){return Z.warnings},cancellation:function(){return Z.cancellation},monitoring:function(){return Z.monitoring},propagateFromFunction:function(){return M},boundValueFunction:function(){return N},checkForgottenReturns:function(t,e,n,r,i){if(void 0===t&&null!==e&&S){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=$(s),c=u.length-1;c>=0;--c){var l=u[c];if(!d.test(l)){var f=l.match(v);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0){var h=u[0];for(c=0;c0&&(a="\n"+s[c-1]);break}}}var p="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(p,!0,e)}},setBounds:function(t,e){if(G()){for(var n,r,i=(t.stack||"").split("\n"),o=(e.stack||"").split("\n"),a=-1,s=-1,u=0;u=s||(K=function(t){if(p.test(t))return!0;var e=J(t);return!!(e&&e.fileName===n&&a<=e.line&&e.line<=s)})}},warn:H,deprecated:function(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),H(n)},CapturedTrace:X,fireDomEvent:k,fireGlobalEvent:E}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];return r instanceof t&&r.suppressUnhandledRejections(),this.caught(n,function(){return r})}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.reduce,r=t.all;function i(){return r(this)}t.prototype.each=function(t){return n(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return n(this,t,e,e)},t.each=function(t,r){return n(t,r,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,r){return n(t,r,e,e)}}},{}],12:[function(t,e,n){"use strict";var r,i,o=t("./es5"),a=o.freeze,s=t("./util"),u=s.inherits,c=s.notEnumerableProp;function l(t,e){function n(r){if(!(this instanceof n))return new n(r);c(this,"message","string"==typeof r?r:e),c(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(n,Error),n}var f=l("Warning","warning"),h=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{r=TypeError,i=RangeError}catch(t){r=l("TypeError","type error"),i=l("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(t){if(!l(this,t))return a.e=t,a}function p(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var p=n(u,i);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new c(this))}return p._then(f,h,void 0,this,void 0)}}}return i.isRejected()?(l(this),a.e=t,a):(l(this),t)}return u.prototype.isFinallyHandler=function(){return 0===this.type},c.prototype._resultCancelled=function(){l(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new u(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,p,p)},e.prototype.tap=function(t){return this._passThrough(t,1,p)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,p);var r,o=new Array(n-1),a=0;for(r=0;r0&&"function"==typeof arguments[e]&&(t=arguments[e]);var r=[].slice.call(arguments);t&&r.pop();var i=new n(r).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,a){var s=e._getDomain,u=t("./util"),c=u.tryCatch,l=u.errorObj,f=e._async;function h(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function p(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));a=i.concurrency}return new h(t,n,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}u.inherits(h,n),h.prototype._asyncInit=function(){this._init$(void 0,-2)},h.prototype._init=function(){},h.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(n<0){if(r[n=-1*n-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return r[n]=t,this._queue.push(n),!1;null!==s&&(s[n]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,t,n,o),v=f._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",f),d===l)return this._reject(d.e),!0;var g=i(d,this._promise);if(g instanceof e){var _=(g=g._target())._bitField;if(0==(50397184&_))return u>=1&&this._inFlight++,r[n]=g,g._proxy(this,-1*(n+1)),!1;if(0==(33554432&_))return 0!=(16777216&_)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}r[n]=d}return++this._totalResolved>=o&&(null!==s?this._filter(r,s):this._resolve(r),!0)},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];r=a.isArray(c)?s(t).apply(l,c):s(t).call(l,c)}else r=s(t)();var f=u._popContext();return o.checkForgottenReturns(r,f,"Promise.try",u),u._resolveFromSyncValue(r),u},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";var r=t("./util"),i=r.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5"),s=/^(?:name|message|stack|cause)$/;e.exports=function(t,e){return function(n,u){if(null!==t){if(n){var c=function(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var n=a.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;n0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+c.classString(t);arguments.length>1&&(n+=", "+c.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},A.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},A.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+c.classString(t)):this.all()._then(t,void 0,void 0,_,void 0)},A.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},A.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},A.prototype.error=function(t){return this.caught(c.originatesFromRejection,t)},A.getNewLibraryCopy=n.exports,A.is=function(t){return t instanceof A},A.fromNode=A.fromCallback=function(t){var e=new A(g);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(t)(C(e,n));return r===P&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},A.all=function(t){return new b(t).promise()},A.cast=function(t){var e=m(t);return e instanceof A||((e=new A(g))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},A.resolve=A.fulfilled=A.cast,A.reject=A.rejected=function(t){var e=new A(g);return e._captureStackTrace(),e._rejectCallback(t,!0),e},A.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+c.classString(t));return h.setScheduler(t)},A.prototype._then=function(t,e,n,r,i){var o=void 0!==i,a=o?i:new A(g),u=this._target(),l=u._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=s();if(0!=(50397184&l)){var p,d,_=u._settlePromiseCtx;0!=(33554432&l)?(d=u._rejectionHandler0,p=t):0!=(16777216&l)?(d=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(_=u._settlePromiseLateCancellationObserver,d=new v("late cancellation observer"),u._attachExtraTrace(d),p=e),h.invoke(_,u,{handler:null===f?p:"function"==typeof p&&c.domainBind(f,p),promise:a,receiver:r,value:d})}else u._addCallbacks(t,e,a,r,f);return a},A.prototype._length=function(){return 65535&this._bitField},A.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},A.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},A.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},A.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},A.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},A.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},A.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},A.prototype._isFinal=function(){return(4194304&this._bitField)>0},A.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},A.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},A.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},A.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},A.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==u)return void 0===e&&this._isBound()?this._boundValue():e},A.prototype._promiseAt=function(t){return this[4*t-4+2]},A.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},A.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},A.prototype._boundValue=function(){},A.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(e,n,r,i,null)},A.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=u),this._addCallbacks(n,r,i,o,null)},A.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:c.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:c.domainBind(i,e));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:c.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:c.domainBind(i,e))}return this._setLength(o+1),o},A.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},A.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(r(),!1);var n=m(t,this);if(!(n instanceof A))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var n=r();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():h.settlePromises(this),this._dereferenceTrace())}},A.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return h.fatalError(t,c.isNode);(65535&e)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},A.prototype._fulfillPromises=function(t,e){for(var n=1;n0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},A.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&l.defineProperty(A.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),A.defer=A.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new A(g),resolve:j,reject:L}},c.notEnumerableProp(A,"_makeSelfResolutionError",r),e("./method")(A,g,m,o,x),e("./bind")(A,g,m,x),e("./cancel")(A,b,o,x),e("./direct_resolve")(A),e("./synchronous_inspection")(A),e("./join")(A,b,m,g,h,s),A.Promise=A,A.version="3.5.5",e("./call_get.js")(A),e("./generators.js")(A,o,g,m,a,x),e("./map.js")(A,b,o,m,g,x),e("./nodeify.js")(A),e("./promisify.js")(A,g),e("./props.js")(A,b,m,o),e("./race.js")(A,g,m,o),e("./reduce.js")(A,b,o,m,g,x),e("./settle.js")(A,b,x),e("./some.js")(A,b,o),e("./timers.js")(A,g,x),e("./using.js")(A,o,m,S,g,x),e("./any.js")(A),e("./each.js")(A,g),e("./filter.js")(A,g),c.toFastProperties(A),c.toFastProperties(A.prototype),F({a:1}),F({b:2}),F({c:3}),F(1),F(function(){}),F(void 0),F(!1),F(new A(g)),x.setBounds(f.firstLineError,c.lastLineError),A}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var a=t("./util");function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.isArray,a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(n,o){var s=r(this._values,this._promise);if(s instanceof e){var u=(s=s._target())._bitField;if(this._values=s,0==(50397184&u))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(o){case-2:return[];case-3:return{};case-6:return new Map}}());else{var c=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(c,!1)}},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n=this._length){var n;if(this._isMap)n=function(t){for(var e=new o,n=t.length/2|0,r=0;r>1},e.prototype.props=function(){return f(this)},e.props=function(t){return f(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t){this._capacity=t,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var n=new i;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},o.prototype._promiseRejected=function(t,e){var n=new i;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,u={};function c(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(t,e){if((0|e)!==e||e<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new c(t),i=n.promise();return n.setHowMany(e),n.init(),i}i.inherits(c,n),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(t){this._howMany=t},c.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(t){this._values.push(t)},c.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return l(t,e)},e.prototype.some=function(t){return l(this,t)},e._SomePromiseArray=c}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){var r=t("./util"),i=r.errorObj,o=r.isObject,a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(u===i){s&&s._pushContext();var c=e.reject(u.e);return s&&s._popContext(),c}if("function"==typeof u)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(c=new e(n),t._then(c._fulfill,c._reject,void 0,c,null),c):function(t,o,a){var s=new e(n),u=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var c=!0,l=r.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,c,!0),s=null)});return c=!1,s&&l===i&&(s._rejectCallback(l.e,!0,!0),s=null),u}(t,u,s)}return t}}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,i){var o,u;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),r.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(n),u=setTimeout(function(){o._fulfill()},+t),r.cancellation()&&o._setOnCancel(new a(u)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};function c(t){return clearTimeout(this.handle),t}function l(t){throw clearTimeout(this.handle),t}e.prototype.delay=function(t){return u(t,this)},e.prototype.timeout=function(t,e){var n,s;t=+t;var u=new a(setTimeout(function(){n.isPending()&&function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()}(n,e,s)},t));return r.cancellation()?(s=this.then(),(n=s._then(c,l,void 0,u,void 0))._setOnCancel(u)):n=this._then(c,l,void 0,u,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,a){var s=t("./util"),u=t("./errors").TypeError,c=t("./util").inherits,l=s.errorObj,f=s.tryCatch,h={};function p(t){setTimeout(function(){throw t},0)}function d(t,e,n){this._data=t,this._promise=e,this._context=n}function v(t,e,n){this.constructor$(t,e,n)}function g(t){return d.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-1]=null}d.prototype.data=function(){return this._data},d.prototype.promise=function(){return this._promise},d.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},d.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==h?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},d.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},c(v,d),v.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,n=0;n=a)return s._fulfill();var u=function(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(u instanceof e&&u._isDisposable()){try{u=r(u._getDisposer().tryDispose(n),t.promise)}catch(t){return p(t)}if(u instanceof e)return u._then(o,p,null,null,null)}o()}(),s}(h,t)});return h.promise=x,x._setOnCancel(h),x},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new v(t,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(e,n,i){"use strict";var o,a=e("./es5"),s="undefined"==typeof navigator,u={e:{}},c="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==this?this:null;function l(){try{var t=o;return o=null,t.apply(this,arguments)}catch(t){return u.e=t,u}}function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function h(t,e,n){if(f(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return a.defineProperty(t,e,r),t}var p=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=d.test(t+"")&&a.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}},isIdentifier:function(t){return v.test(t)},inheritedDataKeys:p,getDataPropertyOrDefault:function(t,e,n){if(!a.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0},thrower:function(t){throw t},isArray:a.isArray,asArray:w,notEnumerableProp:h,isPrimitive:f,isObject:function(t){return"function"==typeof t||"object"==typeof t&&null!==t},isError:_,canEvaluate:s,errorObj:u,tryCatch:function(t){return o=t,l},inherits:function(t,e){var n={}.hasOwnProperty;function r(){for(var r in this.constructor=t,this.constructor$=e,e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}return r.prototype=e.prototype,t.prototype=new r,t.prototype},withAppended:function(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;n10||x[0]>0),C.isNode&&C.toFastProperties(t);try{throw new Error}catch(e){C.lastLineError=e}n.exports=C},{"./es5":13}]},{},[4])(4)},"object"==typeof n&&void 0!==e?e.exports=o():("undefined"!=typeof window?a=window:void 0!==r?a=r:"undefined"!=typeof self&&(a=self),a.Promise=o()),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t(376),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t(381).setImmediate)},{376:376,381:381}],376:[function(t,e,n){var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var t=u(p);f=!0;for(var e=l.length;e;){for(c=l,l=[];++h1)for(var n=1;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function b(t,e,n,r){var i=e&&e.prototype instanceof S?e:S,o=Object.create(i.prototype),a=new j(r||[]);return o._invoke=function(t,e,n){var r=f;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return F()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=P(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=w(t,e,n);if("normal"===u.type){if(r=n.done?d:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function w(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function S(){}function x(){}function k(){}function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function C(e){function n(t,r,o,a){var s=w(e[t],e,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then(function(t){n("next",t,o,a)},function(t){n("throw",t,o,a)}):Promise.resolve(c).then(function(t){u.value=t,o(u)},a)}a(s.arg)}var r;"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n)),this._invoke=function(t,e){function i(){return new Promise(function(r,i){n(t,e,r,i)})}return r=r?r.then(i,i):i()}}function P(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,P(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=w(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,v;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=c?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},{118:118,31:31}],9:[function(t,e,n){e.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},{}],10:[function(t,e,n){var r=t(54);e.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},{54:54}],54:[function(t,e,n){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],11:[function(t,e,n){"use strict";var r=t(121),i=t(116),o=t(120);e.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),s=i(t,a),u=i(e,a),c=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===c?a:i(c,a))-u,a-s),f=1;for(u0;)u in n?n[s]=n[u]:delete n[s],s+=f,u+=f;return n}},{116:116,120:120,121:121}],121:[function(t,e,n){var r=t(31);e.exports=function(t){return Object(r(t))}},{31:31}],116:[function(t,e,n){var r=t(118),i=Math.max,o=Math.min;e.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},{118:118}],120:[function(t,e,n){var r=t(118),i=Math.min;e.exports=function(t){return t>0?i(r(t),9007199254740991):0}},{118:118}],12:[function(t,e,n){"use strict";var r=t(121),i=t(116),o=t(120);e.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)e[s++]=t;return e}},{116:116,120:120,121:121}],13:[function(t,e,n){var r=t(42);e.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n}},{42:42}],42:[function(t,e,n){var r=t(28),i=t(56),o=t(51),a=t(10),s=t(120),u=t(132),c={},l={};(n=e.exports=function(t,e,n,f,h){var p,d,v,g,_=h?function(){return t}:u(t),y=r(n,f,e?2:1),m=0;if("function"!=typeof _)throw TypeError(t+" is not iterable!");if(o(_)){for(p=s(t.length);p>m;m++)if((g=e?y(a(d=t[m])[0],d[1]):y(t[m]))===c||g===l)return g}else for(v=_.call(t);!(d=v.next()).done;)if((g=i(v,y,d.value,e))===c||g===l)return g}).BREAK=c,n.RETURN=l},{10:10,120:120,132:132,28:28,51:51,56:56}],14:[function(t,e,n){var r=t(119),i=t(120),o=t(116);e.exports=function(t){return function(e,n,a){var s,u=r(e),c=i(u.length),l=o(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},{116:116,119:119,120:120}],119:[function(t,e,n){var r=t(50),i=t(31);e.exports=function(t){return r(i(t))}},{31:31,50:50}],15:[function(t,e,n){var r=t(28),i=t(50),o=t(121),a=t(120),s=t(18);e.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,f=6==t,h=5==t||f,p=e||s;return function(e,s,d){for(var v,g,_=o(e),y=i(_),m=r(s,d,3),b=a(y.length),w=0,S=n?p(e,b):u?p(e,0):void 0;b>w;w++)if((h||w in y)&&(g=m(v=y[w],w,_),t))if(n)S[w]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:S.push(v)}else if(l)return!1;return f?-1:c||l?l:S}}},{120:120,121:121,18:18,28:28,50:50}],28:[function(t,e,n){var r=t(5);e.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},{5:5}],50:[function(t,e,n){var r=t(21);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},{21:21}],18:[function(t,e,n){var r=t(17);e.exports=function(t,e){return new(r(t))(e)}},{17:17}],16:[function(t,e,n){var r=t(5),i=t(121),o=t(50),a=t(120);e.exports=function(t,e,n,s,u){r(e);var c=i(t),l=o(c),f=a(c.length),h=u?f-1:0,p=u?-1:1;if(n<2)for(;;){if(h in l){s=l[h],h+=p;break}if(h+=p,u?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;u?h>=0:f>h;h+=p)h in l&&(s=e(s,l[h],h,c));return s}},{120:120,121:121,5:5,50:50}],17:[function(t,e,n){var r=t(54),i=t(52),o=t(131)("species");e.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},{131:131,52:52,54:54}],52:[function(t,e,n){var r=t(21);e.exports=Array.isArray||function(t){return"Array"==r(t)}},{21:21}],19:[function(t,e,n){"use strict";var r=t(5),i=t(54),o=t(49),a=[].slice,s={};e.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?function(t,e,n){if(!(e in s)){for(var r=[],i=0;i1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(d(this,e),t)}}),h&&r(l.prototype,"size",{get:function(){return d(this,e)[v]}}),l},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=p(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,function(t,n){this._t=d(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?l(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,l(1))},n?"entries":"values",!n,!0),f(e)}}},{102:102,128:128,28:28,32:32,42:42,58:58,60:60,68:68,73:73,74:74,9:9,93:93}],74:[function(t,e,n){var r=t(10),i=t(47),o=t(122),a=Object.defineProperty;n.f=t(32)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},{10:10,122:122,32:32,47:47}],73:[function(t,e,n){var r=t(10),i=t(75),o=t(34),a=t(104)("IE_PROTO"),s=function(){},u=function(){var e,n=t(33)("iframe"),r=o.length;for(n.style.display="none",t(46).appendChild(n),n.src="javascript:",(e=n.contentWindow.document).open(),e.write("