// source --> https://staklorezac.com/wp-content/plugins/wt-smart-coupons-for-woocommerce/public/js/wt-smart-coupon-public.js?ver=2.3.0 
jQuery(function ($) {
    "use strict";
    $('form.checkout').on('change.wt_sc_payment_method_change', 'input[name="payment_method"]', function () {

        let t = {updateTimer: !1, dirtyInput: !1,
            reset_update_checkout_timer: function () {
                clearTimeout(t.updateTimer)
            }, trigger_update_checkout: function () {
                t.reset_update_checkout_timer(), t.dirtyInput = !1,
                        $(document.body).trigger("update_checkout")
            }
        };
        t.trigger_update_checkout();
        
    });


    $('document').ready(function(){
        
        /* After the coupon box click event was done */
        $(document).on("wt_sc_api_coupon_click_done", function(e){
            wt_unblock_node($( 'div.wt_coupon_wrapper'));
            wt_unblock_node($("div.wt-mycoupons"));
            wt_unblock_node($("div.wt_store_credit"));
        });

        /** Handle keyboard Enter press on coupons */
        $( document ).on("keypress", '.wt-single-coupon.active-coupon', function(e){
            if( 13 === e.which ) { // Enter key
                $( this ).trigger( 'click' );
            }
        } );

        $(document).on("click", '.wt-single-coupon.active-coupon', function(){        
            
            if(!$('.woocommerce-notices-wrapper').length){
                $('#main').prepend('<div class="woocommerce-notices-wrapper"></div>');
            }
            
            const coupon_code = ( typeof $(this).attr('data-code') === 'undefined' ? $(this).find('code').text() : $(this).attr('data-code') );
            const coupon_id = $(this).attr('data-id');

            $('div.wt_coupon_wrapper, div.wt_store_credit').each(function(){
                if($(this).find('.wt-single-coupon').length)
                {
                    wt_block_node($(this));
                }
            });

            /* For checkout block compatibility */
            if( $('.wc-block-checkout, .wc-block-cart').length ) {
                
                const coupon_click_event = new CustomEvent("wt_sc_api_coupon_clicked", {
                    detail:{ 'coupon_code' : coupon_code, 'coupon_id': coupon_id}
                });
                document.dispatchEvent(coupon_click_event);
                return false;
            }
            
            const data = {
                'coupon_code'   : coupon_code,
                'coupon_id'     : coupon_id,
                '_wpnonce'      : WTSmartCouponOBJ.nonces.apply_coupon
            };

            $.ajax({
                type: "POST",
                async: true,
                url: WTSmartCouponOBJ.wc_ajax_url + 'apply_coupon_on_click',
                data: data,
                success: function (response) {
                    if ( $( '.woocommerce-cart-form' ).length) {
                        update_cart(true);  // need only for cart page
                    }
                    
                    wt_unblock_node( $( 'div.wt_coupon_wrapper' ) );
                    wt_unblock_node($("div.wt-mycoupons"));
                    wt_unblock_node($("div.wt_store_credit"));

                    $( '.woocommerce-error, .woocommerce-message, .woocommerce-info' ).remove();
                    show_notice( response );
                    $(document.body).trigger("update_checkout");
                    $( document.body ).trigger("applied_coupon");

                    $('html, body').animate({
                        scrollTop: $(".woocommerce").offset().top
                    }, 1000);
                }
            });

        });

        /* For checkout block */
        if( $('.wc-block-checkout').length ) {
            $( document ).on("click", '[name="radio-control-wc-payment-method-options"]', function(){
                WTSmartCouponOBJ.payment_method = $('[name="radio-control-wc-payment-method-options"]:checked').val();
                let parent_div = $('[name="radio-control-wc-payment-method-options"]').parents('.wc-block-components-radio-control');
                parent_div.find('.wc-block-components-radio-control__option').removeClass('wc-block-components-radio-control__option-checked');
                wbte_set_block_checkout_values();
            });

            setTimeout( wbte_set_block_checkout_values, 200);
        }
    
    });

    /** Update payment method on session, if coupons are changed update checkout */
    $( document.body ).on( 'payment_method_selected', 
        function() {
            jQuery( document ).on( "updated_checkout", 
                function(){
                    const selectedPaymentMethod = $( 'form.checkout' ).find( 'input[name="payment_method"]:checked' ).val();
                    $.ajax({
                        type: "POST",
                        url: WTSmartCouponOBJ.wc_ajax_url + 'wbte_sc_update_payment_method_on_session',
                        data: {
                            'payment_method': selectedPaymentMethod,
                            '_wpnonce': WTSmartCouponOBJ.nonces.public
                        },
                        success: function( response ) {
                            if ( response ) {
                                $( 'form.checkout' ).trigger( 'update' );
                            }
                        }
                    });
                }
            );
        }
    );

    const wbte_set_block_checkout_values = function() {

        let payment_method = '';
        const shipping_method = {};
      
        if( $('[name="radio-control-wc-payment-method-options"]').length ) {
            
            /* Prepare payment method from radio button */
            payment_method = $('[name="radio-control-wc-payment-method-options"]:checked').val();           

        }
        
        /* Prepare shipping method from radio button */
        if( $('.wc-block-components-shipping-rates-control input[type="radio"]').length ) {         
            $('.wc-block-components-shipping-rates-control input[type="radio"]:checked').each(function(index){
                shipping_method[index] = $(this).val(); 
            });
        }

        /* Store the value to global variable to prevent future auto refresh blocking */
        WTSmartCouponOBJ.shipping_method = shipping_method;
        WTSmartCouponOBJ.payment_method = payment_method;

        
        /* Send ajax request to set the value */
        let order_summary_block = $('.wp-block-woocommerce-checkout-order-summary-block');
        wt_block_node( order_summary_block );
        
        $.ajax({
            type: "POST",
            async: true,
            url: WTSmartCouponOBJ.wc_ajax_url + 'wbte_sc_set_block_checkout_values',
            data: { '_wpnonce': WTSmartCouponOBJ.nonces.public, 'payment_method': payment_method, 'shipping_method': shipping_method },
            dataType: 'json',
            success:function( data ) {
                wt_unblock_node( order_summary_block );
            },
            error:function() {
               wt_unblock_node( order_summary_block ); 
            }
        });

        /* Trigger checkout block refresh */
        setTimeout(function(){ 
            const checkout_value_updated_event = new CustomEvent("wbte_sc_checkout_value_updated", {
                detail:{ 'payment_method' : payment_method, 'shipping_method': shipping_method }
            });
            document.dispatchEvent(checkout_value_updated_event);
        }, 1000);
        
    }

    
    /**
     * Function from cart.js by woocommmerce
     * @param {bool} preserve_notices 
     */
    const update_cart = function( preserve_notices ) {
        const $form = $( '.woocommerce-cart-form' );
        wt_block_node( $form );
        wt_block_node( $( 'div.cart_totals' ) );
        
        

        // Make call to actual form post URL.
        $.ajax( {
            type:     $form.attr( 'method' ),
            url:      $form.attr( 'action' ),
            data:     $form.serialize(),
            dataType: 'html',
            success:  function( response ) {
                update_wc_div( response, preserve_notices );
            },
            complete: function() {
                wt_unblock_node( $form );
                wt_unblock_node( $( 'div.cart_totals' ) );
            }
        } );
    }


    /**
     * 
     * @param {string} html_str 
     * @param {bool} preserve_notices 
     */
    const update_wc_div = function( html_str, preserve_notices ) {
        const $html       = $.parseHTML( html_str );
        const $new_form   = $( '.woocommerce-cart-form', $html );
        const $new_totals = $( '.cart_totals', $html );
        const $notices    = $( '.woocommerce-error, .woocommerce-message, .woocommerce-info', $html );

        // No form, cannot do this.
        if ( $( '.woocommerce-cart-form' ).length === 0 ) {
            window.location.href = window.location.href;
            return;
        }

        // Remove errors
        if ( ! preserve_notices ) {
            $( '.woocommerce-error, .woocommerce-message, .woocommerce-info' ).remove();
        }

        if ( $new_form.length === 0 ) {
            // If the checkout is also displayed on this page, trigger reload instead.
            if ( $( '.woocommerce-checkout' ).length ) {
                window.location.href = window.location.href;
                return;
            }

            // No items to display now! Replace all cart content.
            const $cart_html = $( '.cart-empty', $html ).closest( '.woocommerce' );
            $( '.woocommerce-cart-form__contents' ).closest( '.woocommerce' ).replaceWith( $cart_html );

            // Display errors
            if ( $notices.length > 0 ) {
                show_notice( $notices );
            }
        } else {
            // If the checkout is also displayed on this page, trigger update event.
            if ( $( '.woocommerce-checkout' ).length ) {
                $( document.body ).trigger( 'update_checkout' );
            }

            $( '.woocommerce-cart-form' ).replaceWith( $new_form );
            $( '.woocommerce-cart-form' ).find( ':input[name="update_cart"]' ).prop( 'disabled', true );

            if ( $notices.length > 0 ) {
                show_notice( $notices );
            }

            update_cart_totals_div( $new_totals );
        }

        $( document.body ).trigger( 'updated_wc_div' );
    };
    

    /**
     * Function from woocmmerce cart.js
     * @param {string} html_str 
     */
    const update_cart_totals_div = function( html_str ) {
        $( '.cart_totals' ).replaceWith( html_str );
        $( document.body ).trigger( 'updated_cart_totals' );
    };



    /**
     * function from cart.js by wooocommerce
     * @param { jQuery object } node 
     */
    const wt_block_node = function( node ) {

        node.addClass( 'processing' );

        if(typeof $.fn.block === 'function')
        {
            node.block({
                message: null,
                overlayCSS: {
                    background: '#fff',
                    opacity: 0.6
                }
            });
        }
    }
    window.wbte_sc_block_node = wt_block_node;
    
    /**
     * function from cart.js by wooocommerce
     * @param {jQuery object} $node 
     */
    const wt_unblock_node = function( node ) {
        
        node.removeClass( 'processing' );
        
        if(typeof $.fn.unblock === 'function')
        {
            node.unblock();
        }      
    };
    window.wbte_sc_unblock_node = wt_unblock_node;


    const show_notice = function( html_element, $target ) {
        if ( ! $target ) {
            $target = $( '.woocommerce-notices-wrapper:first' ) || $( '.cart-empty' ).closest( '.woocommerce' ) || $( '.woocommerce-cart-form' );
        }
        $target.prepend( html_element );
    };

});
// source --> https://staklorezac.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.4.1-wc.10.9.4 
/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){var n=/\+/g;function o(e){return r.raw?e:encodeURIComponent(e)}function i(e,o){var i=r.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(n," ")),r.json?JSON.parse(e):e}catch(o){}}(e);return"function"==typeof o?o(i):i}var r=e.cookie=function(n,t,u){if(t!==undefined&&"function"!=typeof t){if("number"==typeof(u=e.extend({},r.defaults,u)).expires){var c=u.expires,f=u.expires=new Date;f.setTime(+f+864e5*c)}return document.cookie=[o(n),"=",function(e){return o(r.json?JSON.stringify(e):String(e))}(t),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}for(var d,a=n?undefined:{},p=document.cookie?document.cookie.split("; "):[],s=0,m=p.length;s<m;s++){var x=p[s].split("="),y=(d=x.shift(),r.raw?d:decodeURIComponent(d)),k=x.join("=");if(n&&n===y){a=i(k,t);break}n||(k=i(k))===undefined||(a[y]=k)}return a};r.defaults={},e.removeCookie=function(n,o){return e.cookie(n)!==undefined&&(e.cookie(n,"",e.extend({},o,{expires:-1})),!e.cookie(n))}});
// source --> https://staklorezac.com/wp-content/plugins/woocommerce/assets/js/dompurify/purify.min.js?ver=10.9.4 
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),f=R(Array.prototype.pop),p=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),N=R(RegExp.prototype.test),b=(S=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(S,t)});var S;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function x(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=x(r):n[o]=r)}return n}function L(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const D=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),I=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),k=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),v=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),P=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),z=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Q=function(){return"undefined"==typeof window?null:window},ee=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;t&&t.hasAttribute("data-tt-policy-suffix")&&(n=t.getAttribute("data-tt-policy-suffix"));const o="woocommerce-dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(r){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},te=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};return function ne(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Q();const n=e=>ne(e);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==J.document||!t.Element)return n.isSupported=!1,n;let{document:o}=t;const r=o,a=r.currentScript,{DocumentFragment:c,HTMLTemplateElement:s,Node:S,Element:R,NodeFilter:O,NamedNodeMap:B=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:W,DOMParser:G,trustedTypes:Y}=t,j=R.prototype,q=L(j,"cloneNode"),$=L(j,"remove"),V=L(j,"nextSibling"),oe=L(j,"childNodes"),re=L(j,"parentNode");if("function"==typeof s){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let ie,ae="";const{implementation:le,createNodeIterator:ce,createDocumentFragment:se,getElementsByTagName:ue}=o,{importNode:me}=r;let fe=te();n.isSupported="function"==typeof e&&"function"==typeof re&&le&&le.createHTMLDocument!==undefined;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:he,DATA_ATTR:ge,ARIA_ATTR:Te,IS_SCRIPT_OR_DATA:ye,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:Ae}=Z;let{IS_ALLOWED_URI:_e}=Z,Ne=null;const be=w({},[...D,...C,...I,...v,...U]);let Se=null;const Re=w({},[...P,...z,...H,...F]);let we=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,xe=null,Le=!0,De=!0,Ce=!1,Ie=!0,ke=!1,ve=!0,Me=!1,Ue=!1,Pe=!1,ze=!1,He=!1,Fe=!1,Be=!0,We=!1;let Ge=!0,Ye=!1,je={},Xe=null;const qe=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const Ke=w({},["audio","video","img","source","image","track"]);let Ve=null;const Ze=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,ot=null;const rt=w({},[Je,Qe,et],g);let it=w({},["mi","mo","mn","ms","mtext"]),at=w({},["annotation-xml"]);const lt=w({},["title","style","font","a","script"]);let ct=null;const st=["application/xhtml+xml","text/html"];let ut=null,mt=null;const ft=o.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!mt||mt!==e){if(e&&"object"==typeof e||(e={}),e=x(e),ct=-1===st.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ut="application/xhtml+xml"===ct?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,ut):be,Se=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,ut):Re,ot=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):rt,Ve=_(e,"ADD_URI_SAFE_ATTR")?w(x(Ze),e.ADD_URI_SAFE_ATTR,ut):Ze,$e=_(e,"ADD_DATA_URI_TAGS")?w(x(Ke),e.ADD_DATA_URI_TAGS,ut):Ke,Xe=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,ut):qe,Oe=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,ut):x({}),xe=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,ut):x({}),je=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Le=!1!==e.ALLOW_ARIA_ATTR,De=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,ve=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,Ge=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||X,tt=e.NAMESPACE||et,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,at=e.HTML_INTEGRATION_POINTS||at,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&pt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&pt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(De=!1),He&&(ze=!0),je&&(Ne=w({},U),Se=[],!0===je.html&&(w(Ne,D),w(Se,P)),!0===je.svg&&(w(Ne,C),w(Se,z),w(Se,F)),!0===je.svgFilters&&(w(Ne,I),w(Se,z),w(Se,F)),!0===je.mathMl&&(w(Ne,v),w(Se,H),w(Se,F))),e.ADD_TAGS&&(Ne===be&&(Ne=x(Ne)),w(Ne,e.ADD_TAGS,ut)),e.ADD_ATTR&&(Se===Re&&(Se=x(Se)),w(Se,e.ADD_ATTR,ut)),e.ADD_URI_SAFE_ATTR&&w(Ve,e.ADD_URI_SAFE_ATTR,ut),e.FORBID_CONTENTS&&(Xe===qe&&(Xe=x(Xe)),w(Xe,e.FORBID_CONTENTS,ut)),Ge&&(Ne["#text"]=!0),Me&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ie=e.TRUSTED_TYPES_POLICY,ae=ie.createHTML("")}else ie===undefined&&(ie=ee(Y,a)),null!==ie&&"string"==typeof ae&&(ae=ie.createHTML(""));i&&i(e),mt=e}},ht=w({},[...C,...I,...k]),gt=w({},[...v,...M]),Tt=function(e){p(n.removed,{element:e});try{re(e).removeChild(e)}catch(t){$(e)}},yt=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(o){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ze||He)try{Tt(t)}catch(o){}else try{t.setAttribute(e,"")}catch(o){}},Et=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ct&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ie?ie.createHTML(e):e;if(tt===et)try{t=(new G).parseFromString(r,ct)}catch(a){}if(!t||!t.documentElement){t=le.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:r}catch(a){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),tt===et?ue.call(t,Me?"html":"body")[0]:Me?t.documentElement:i},At=function(e){return ce.call(e.ownerDocument||e,e,O.SHOW_ELEMENT|O.SHOW_COMMENT|O.SHOW_TEXT|O.SHOW_PROCESSING_INSTRUCTION|O.SHOW_CDATA_SECTION,null)},_t=function(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof B)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof S&&e instanceof S};function bt(e,t,o){u(e,e=>{e.call(n,t,o,mt)})}const St=function(e){let t=null;if(bt(fe.beforeSanitizeElements,e,null),_t(e))return Tt(e),!0;const o=ut(e.nodeName);if(bt(fe.uponSanitizeElement,e,{tagName:o,allowedTags:Ne}),ve&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&N(/<[/\w!]/g,e.innerHTML)&&N(/<[/\w!]/g,e.textContent))return Tt(e),!0;if(e.nodeType===J.progressingInstruction)return Tt(e),!0;if(ve&&e.nodeType===J.comment&&N(/<[/\w]/g,e.data))return Tt(e),!0;if(!Ne[o]||Oe[o]){if(!Oe[o]&&wt(o)){if(we.tagNameCheck instanceof RegExp&&N(we.tagNameCheck,o))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(o))return!1}if(Ge&&!Xe[o]){const t=re(e)||e.parentNode,n=oe(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o){const r=q(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,V(e))}}return Tt(e),!0}return e instanceof R&&!function(e){let t=re(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===o||it[o]):Boolean(ht[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&at[o]:Boolean(gt[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!at[o])&&!(t.namespaceURI===Je&&!it[o])&&!gt[n]&&(lt[n]||!ht[n]):!("application/xhtml+xml"!==ct||!ot[e.namespaceURI]))}(e)?(Tt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!N(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===J.text&&(t=e.textContent,u([pe,de,he],e=>{t=y(t,e," ")}),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt(fe.afterSanitizeElements,e,null),!1):(Tt(e),!0)},Rt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in o||n in ft))return!1;if(De&&!xe[t]&&N(ge,t));else if(Le&&N(Te,t));else if(!Se[t]||xe[t]){if(!(wt(e)&&(we.tagNameCheck instanceof RegExp&&N(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&N(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&N(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ve[t]);else if(N(_e,y(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!$e[e])if(Ce&&!N(ye,y(n,Ee,"")));else if(n)return!1;return!0},wt=function(e){return"annotation-xml"!==e&&T(e,Ae)},Ot=function(e){bt(fe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||_t(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:undefined};let r=t.length;for(;r--;){const a=t[r],{name:l,namespaceURI:c,value:s}=a,m=ut(l),p=s;let d="value"===l?p:A(p);if(o.attrName=m,o.attrValue=d,o.keepAttr=!0,o.forceKeepAttr=undefined,bt(fe.uponSanitizeAttribute,e,o),d=o.attrValue,!We||"id"!==m&&"name"!==m||(yt(l,e),d="user-content-"+d),ve&&N(/((--!?|])>)|<\/(style|title)/i,d)){yt(l,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){yt(l,e);continue}if(!Ie&&N(/\/>/i,d)){yt(l,e);continue}ke&&u([pe,de,he],e=>{d=y(d,e," ")});const h=ut(e.nodeName);if(Rt(h,m,d)){if(ie&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(c);else switch(Y.getAttributeType(h,m)){case"TrustedHTML":d=ie.createHTML(d);break;case"TrustedScriptURL":d=ie.createScriptURL(d)}if(d!==p)try{c?e.setAttributeNS(c,l,d):e.setAttribute(l,d),_t(e)?Tt(e):f(n.removed)}catch(i){yt(l,e)}}else yt(l,e)}bt(fe.afterSanitizeAttributes,e,null)},xt=function Lt(e){let t=null;const n=At(e);for(bt(fe.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)bt(fe.uponSanitizeShadowNode,t,null),St(t),Ot(t),t.content instanceof c&&Lt(t.content);bt(fe.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},o=null,i=null,a=null,l=null;if((nt=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||dt(t),n.removed=[],"string"==typeof e&&(Ye=!1),Ye){if(e.nodeName){const t=ut(e.nodeName);if(!Ne[t]||Oe[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof S)(i=(o=Et("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType===J.element&&"BODY"===i.nodeName?o=i:"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!ze&&!ke&&!Me&&-1===e.indexOf("<"))return ie&&Fe?ie.createHTML(e):e;if(!(o=Et(e)))return ze?null:Fe?ae:""}o&&Pe&&Tt(o.firstChild);const s=At(Ye?e:o);for(;a=s.nextNode();)St(a),Ot(a),a.content instanceof c&&xt(a.content);if(Ye)return e;if(ze){if(He)for(l=se.call(o.ownerDocument);o.firstChild;)l.appendChild(o.firstChild);else l=o;return(Se.shadowroot||Se.shadowrootmode)&&(l=me.call(r,l,!0)),l}let m=Me?o.outerHTML:o.innerHTML;return Me&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&N(K,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),ke&&u([pe,de,he],e=>{m=y(m,e," ")}),ie&&Fe?ie.createHTML(m):m},n.setConfig=function(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};dt(e),Ue=!0},n.clearConfig=function(){mt=null,Ue=!1},n.isValidAttribute=function(e,t,n){mt||dt({});const o=ut(e),r=ut(t);return Rt(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&p(fe[e],t)},n.removeHook=function(e,t){if(t!==undefined){const n=m(fe[e],t);return-1===n?undefined:d(fe[e],n,1)[0]}return f(fe[e])},n.removeHooks=function(e){fe[e]=[]},n.removeAllHooks=function(){fe=te()},n}()});
// source --> https://staklorezac.com/wp-content/plugins/woocommerce/assets/js/jquery-tiptip/jquery.tipTip.min.js?ver=10.9.4 
!function(t){t.fn.tipTip=function(e){var o=t.extend({activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},e);if(t("#tiptip_holder").length<=0){var n=t('<div id="tiptip_holder" style="max-width:'+o.maxWidth+';"></div>'),i=t('<div id="tiptip_content"></div>'),r=t('<div id="tiptip_arrow"></div>');t("body").append(n.html(i).prepend(r.html('<div id="tiptip_arrow_inner"></div>')))}else n=t("#tiptip_holder"),i=t("#tiptip_content"),r=t("#tiptip_arrow");return this.each(function(){var e=t(this);if(o.content)var a=o.content;else a=DOMPurify.sanitize(e.attr(o.attribute),{ALLOWED_TAGS:["a","b","em","i","strong","p","br","pre","span","img"],ALLOWED_ATTR:["target","href","rel","name","download","title","src","alt","class","style"]});if(""!=a){o.content||e.removeAttr(o.attribute);var f=!1;function d(){var d="function"==typeof o.content?o.content():a;if(d){o.enter.call(this),i.html(d),n.hide().css("margin","0"),n.removeAttr("class"),r.removeAttr("style");var u=parseInt(e.offset().top),s=parseInt(e.offset().left),l=parseInt(e.outerWidth()),p=parseInt(e.outerHeight()),c=n.outerWidth(),h=n.outerHeight(),_=Math.round((l-c)/2),m=Math.round((p-h)/2),v=Math.round(s+_),g=Math.round(u+p+o.edgeOffset),b="",M="",O=Math.round(c-12)/2;"bottom"==o.defaultPosition?b="_bottom":"top"==o.defaultPosition?b="_top":"left"==o.defaultPosition?b="_left":"right"==o.defaultPosition&&(b="_right");var w=_+s<parseInt(t(window).scrollLeft()),A=c+s>parseInt(t(window).width());w&&_<0||"_right"==b&&!A||"_left"==b&&s<c+o.edgeOffset+5?(b="_right",M=Math.round(h-13)/2,O=-12,v=Math.round(s+l+o.edgeOffset),g=Math.round(u+m)):(A&&_<0||"_left"==b&&!w)&&(b="_left",M=Math.round(h-13)/2,O=Math.round(c),v=Math.round(s-(c+o.edgeOffset+5)),g=Math.round(u+m));var x=u+p+o.edgeOffset+h+8>parseInt(t(window).height()+t(window).scrollTop()),I=u+p-(o.edgeOffset+h+8)<0;x||"_bottom"==b&&x||"_top"==b&&!I?("_top"==b||"_bottom"==b?b="_top":b+="_top",M=h,g=Math.round(u-(h+5+o.edgeOffset))):(I|("_top"==b&&I)||"_bottom"==b&&!x)&&("_top"==b||"_bottom"==b?b="_bottom":b+="_bottom",M=-12,g=Math.round(u+p+o.edgeOffset)),"_right_top"==b||"_left_top"==b?g+=5:"_right_bottom"!=b&&"_left_bottom"!=b||(g-=5),"_left_top"!=b&&"_left_bottom"!=b||(v+=5),r.css({"margin-left":O+"px","margin-top":M+"px"}),n.css({"margin-left":v+"px","margin-top":g+"px"}).attr("class","tip"+b),f&&clearTimeout(f),f=setTimeout(function(){n.stop(!0,!0).fadeIn(o.fadeIn)},o.delay)}}function u(){o.exit.call(this),f&&clearTimeout(f),n.fadeOut(o.fadeOut)}"hover"==o.activation?(e.on("mouseenter",function(){d()}).on("mouseleave",function(){o.keepAlive&&n.is(":hover")||u()}),o.keepAlive&&n.on("mouseenter",function(){}).on("mouseleave",function(){u()})):"focus"==o.activation?e.on("focus",function(){d()}).on("blur",function(){u()}):"click"==o.activation&&(e.on("click",function(){return d(),!1}).on("mouseenter",function(){}).on("mouseleave",function(){o.keepAlive||u()}),o.keepAlive&&n.on("mouseenter",function(){}).on("mouseleave",function(){u()}))}})}}(jQuery);
// source --> https://staklorezac.com/wp-content/plugins/woocommerce-measurement-price-calculator/assets/js/vendor/bignumber.min.js?ver=9.0.1 
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){var r,C=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,M=Math.ceil,G=Math.floor,F="[BigNumber Error] ",k=F+"Number primitive has more than 15 significant digits: ",q=1e14,j=14,$=9007199254740991,z=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],H=1e7,V=1e9;function W(e){var r=0|e;return 0<e||e===r?r:r-1}function X(e){for(var r,n,t=1,i=e.length,o=e[0]+"";t<i;){for(r=e[t++]+"",n=j-r.length;n--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function Y(e,r){var n,t,i=e.c,o=r.c,f=e.s,s=r.s,e=e.e,r=r.e;if(!f||!s)return null;if(n=i&&!i[0],t=o&&!o[0],n||t)return n?t?0:-s:f;if(f!=s)return f;if(n=f<0,t=e==r,!i||!o)return t?0:!i^n?1:-1;if(!t)return r<e^n?1:-1;for(s=(e=i.length)<(r=o.length)?e:r,f=0;f<s;f++)if(i[f]!=o[f])return i[f]>o[f]^n?1:-1;return e==r?0:r<e^n?1:-1}function J(e,r,n,t){if(e<r||n<e||e!==G(e))throw Error(F+(t||"Argument")+("number"==typeof e?e<r||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Z(e){var r=e.c.length-1;return W(e.e/j)==r&&e.c[r]%2!=0}function K(e,r){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function Q(e,r,n){var t,i;if(r<0){for(i=n+".";++r;i+=n);e=i+e}else if(++r>(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else r<t&&(e=e.slice(0,r)+"."+e.slice(r));return e}(r=function e(r){var m,a,h,n,l,d,f,s,u,c,p,t=R.prototype={constructor:R,toString:null,valueOf:null},g=new R(1),y=20,v=4,w=-7,N=21,b=-1e7,O=1e7,E=!1,i=1,A=0,_={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz";function R(e,r){var n,t,i,o,f,s,u,l,c=this;if(!(c instanceof R))return new R(e,r);if(null==r){if(e&&!0===e._isBigNumber)return c.s=e.s,void(!e.c||e.e>O?c.c=c.e=null:e.e<b?c.c=[c.e=0]:(c.e=e.e,c.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(c.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,f=e;10<=f;f/=10,o++);return void(O<o?c.c=c.e=null:(c.e=o,c.c=[e]))}l=String(e)}else{if(!C.test(l=String(e)))return h(c,l,s);c.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}0<(f=(l=-1<(o=l.indexOf("."))?l.replace(".",""):l).search(/e/i))?(o<0&&(o=f),o+=+l.slice(f+1),l=l.substring(0,f)):o<0&&(o=l.length)}else{if(J(r,2,S.length,"Base"),10==r)return I(c=new R(e),y+c.e+1,v);if(l=String(e),s="number"==typeof e){if(0*e!=0)return h(c,l,s,r);if(c.s=1/e<0?(l=l.slice(1),-1):1,R.DEBUG&&15<l.replace(/^0\.0*|\./,"").length)throw Error(k+e)}else c.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(n=S.slice(0,r),o=f=0,u=l.length;f<u;f++)if(n.indexOf(t=l.charAt(f))<0){if("."==t){if(o<f){o=u;continue}}else if(!i&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){i=!0,f=-1,o=0;continue}return h(c,String(e),s,r)}s=!1,-1<(o=(l=a(l,r,10,c.s)).indexOf("."))?l=l.replace(".",""):o=l.length}for(f=0;48===l.charCodeAt(f);f++);for(u=l.length;48===l.charCodeAt(--u););if(l=l.slice(f,++u)){if(u-=f,s&&R.DEBUG&&15<u&&($<e||e!==G(e)))throw Error(k+c.s*e);if((o=o-f-1)>O)c.c=c.e=null;else if(o<b)c.c=[c.e=0];else{if(c.e=o,c.c=[],f=(o+1)%j,o<0&&(f+=j),f<u){for(f&&c.c.push(+l.slice(0,f)),u-=j;f<u;)c.c.push(+l.slice(f,f+=j));f=j-(l=l.slice(f)).length}else f-=u;for(;f--;l+="0");c.c.push(+l)}}else c.c=[c.e=0]}function B(e,r,n,t){for(var i,o,f=[0],s=0,u=e.length;s<u;){for(o=f.length;o--;f[o]*=r);for(f[0]+=t.indexOf(e.charAt(s++)),i=0;i<f.length;i++)n-1<f[i]&&(null==f[i+1]&&(f[i+1]=0),f[i+1]+=f[i]/n|0,f[i]%=n)}return f.reverse()}function D(e,r,n){var t,i,o,f=0,s=e.length,u=r%H,l=r/H|0;for(e=e.slice();s--;)f=((i=u*(o=e[s]%H)+(t=l*o+(o=e[s]/H|0)*u)%H*H+f)/n|0)+(t/H|0)+l*o,e[s]=i%n;return e=f?[f].concat(e):e}function P(e,r,n,t){var i,o;if(n!=t)o=t<n?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function x(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n]<r[n]?1:0,e[n]=i*t+e[n]-r[n];for(;!e[0]&&1<e.length;e.splice(0,1));}function o(e,r,n,t){var i,o,f,s;if(null==n?n=v:J(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==r)s=X(e.c),s=1==t||2==t&&(o<=w||N<=o)?K(s,o):Q(s,o,"0");else if(n=(e=I(new R(e),r,n)).e,f=(s=X(e.c)).length,1==t||2==t&&(r<=n||n<=w)){for(;f<r;s+="0",f++);s=K(s,n)}else if(r-=o,s=Q(s,n,"0"),f<n+1){if(0<--r)for(s+=".";r--;s+="0");}else if(0<(r+=n-f))for(n+1==f&&(s+=".");r--;s+="0");return e.s<0&&i?"-"+s:s}function L(e,r){for(var n,t=1,i=new R(e[0]);t<e.length;t++){if(!(n=new R(e[t])).s){i=n;break}r.call(i,n)&&(i=n)}return i}function U(e,r,n){for(var t=1,i=r.length;!r[--i];r.pop());for(i=r[0];10<=i;i/=10,t++);return(n=t+n*j-1)>O?e.c=e.e=null:n<b?e.c=[e.e=0]:(e.e=n,e.c=r),e}function I(e,r,n,t){var i,o,f,s,u,l,c,a=e.c,h=z;if(a){e:{for(i=1,s=a[0];10<=s;s/=10,i++);if((o=r-i)<0)o+=j,f=r,c=(u=a[l=0])/h[i-f-1]%10|0;else if((l=M((o+1)/j))>=a.length){if(!t)break e;for(;a.length<=l;a.push(0));u=c=0,f=(o%=j)-j+(i=1)}else{for(u=s=a[l],i=1;10<=s;s/=10,i++);c=(f=(o%=j)-j+i)<0?0:u/h[i-f-1]%10|0}if(t=t||r<0||null!=a[l+1]||(f<0?u:u%h[i-f-1]),t=n<4?(c||t)&&(0==n||n==(e.s<0?3:2)):5<c||5==c&&(4==n||t||6==n&&(0<o?0<f?u/h[i-f]:0:a[l-1])%10&1||n==(e.s<0?8:7)),r<1||!a[0])return a.length=0,t?(r-=e.e+1,a[0]=h[(j-r%j)%j],e.e=-r||0):a[0]=e.e=0,e;if(0==o?(a.length=l,s=1,l--):(a.length=l+1,s=h[j-o],a[l]=0<f?G(u/h[i-f]%h[f])*s:0),t)for(;;){if(0==l){for(o=1,f=a[0];10<=f;f/=10,o++);for(f=a[0]+=s,s=1;10<=f;f/=10,s++);o!=s&&(e.e++,a[0]==q)&&(a[0]=1);break}if(a[l]+=s,a[l]!=q)break;a[l--]=0,s=1}for(o=a.length;0===a[--o];a.pop());}e.e>O?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function T(e){var r,n=e.e;return null===n?e.toString():(r=X(e.c),r=n<=w||N<=n?K(r,n):Q(r,n,"0"),e.s<0?"-"+r:r)}return R.clone=e,R.ROUND_UP=0,R.ROUND_DOWN=1,R.ROUND_CEIL=2,R.ROUND_FLOOR=3,R.ROUND_HALF_UP=4,R.ROUND_HALF_DOWN=5,R.ROUND_HALF_EVEN=6,R.ROUND_HALF_CEIL=7,R.ROUND_HALF_FLOOR=8,R.EUCLID=9,R.config=R.set=function(e){var r,n;if(null!=e){if("object"!=_typeof(e))throw Error(F+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(J(n=e[r],0,V,r),y=n),e.hasOwnProperty(r="ROUNDING_MODE")&&(J(n=e[r],0,8,r),v=n),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((n=e[r])&&n.pop?(J(n[0],-V,0,r),J(n[1],0,V,r),w=n[0],N=n[1]):(J(n,-V,V,r),w=-(N=n<0?-n:n))),e.hasOwnProperty(r="RANGE"))if((n=e[r])&&n.pop)J(n[0],-V,-1,r),J(n[1],1,V,r),b=n[0],O=n[1];else{if(J(n,-V,V,r),!n)throw Error(F+r+" cannot be zero: "+n);b=-(O=n<0?-n:n)}if(e.hasOwnProperty(r="CRYPTO")){if((n=e[r])!==!!n)throw Error(F+r+" not true or false: "+n);if(n&&("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes))throw E=!n,Error(F+"crypto unavailable");E=n}if(e.hasOwnProperty(r="MODULO_MODE")&&(J(n=e[r],0,9,r),i=n),e.hasOwnProperty(r="POW_PRECISION")&&(J(n=e[r],0,V,r),A=n),e.hasOwnProperty(r="FORMAT")){if("object"!=_typeof(n=e[r]))throw Error(F+r+" not an object: "+n);_=n}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(n=e[r])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(F+r+" invalid: "+n);S=n}}return{DECIMAL_PLACES:y,ROUNDING_MODE:v,EXPONENTIAL_AT:[w,N],RANGE:[b,O],CRYPTO:E,MODULO_MODE:i,POW_PRECISION:A,FORMAT:_,ALPHABET:S}},R.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!R.DEBUG)return!0;var r,n,t=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(t)){if((1===o||-1===o)&&-V<=i&&i<=V&&i===G(i))if(0===t[0]){if(0===i&&1===t.length)return!0}else if((r=(i+1)%j)<1&&(r+=j),String(t[0]).length==r){for(r=0;r<t.length;r++)if((n=t[r])<0||q<=n||n!==G(n))break e;if(0!==n)return!0}}else if(null===t&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(F+"Invalid BigNumber: "+e)},R.maximum=R.max=function(){return L(arguments,t.lt)},R.minimum=R.min=function(){return L(arguments,t.gt)},R.random=(n=9007199254740992,l=Math.random()*n&2097151?function(){return G(Math.random()*n)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,n,t,i,o,f=0,s=[],u=new R(g);if(null==e?e=y:J(e,0,V),i=M(e/j),E)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)9e15<=(o=131072*r[f]+(r[f+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),r[f]=n[0],r[f+1]=n[1]):(s.push(o%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw E=!1,Error(F+"crypto unavailable");for(r=crypto.randomBytes(i*=7);f<i;)9e15<=(o=281474976710656*(31&r[f])+1099511627776*r[f+1]+4294967296*r[f+2]+16777216*r[f+3]+(r[f+4]<<16)+(r[f+5]<<8)+r[f+6])?crypto.randomBytes(7).copy(r,f):(s.push(o%1e14),f+=7);f=i/7}if(!E)for(;f<i;)(o=l())<9e15&&(s[f++]=o%1e14);for(i=s[--f],e%=j,i&&e&&(s[f]=G(i/(o=z[j-e]))*o);0===s[f];s.pop(),f--);if(f<0)s=[t=0];else{for(t=-1;0===s[0];s.splice(0,1),t-=j);for(f=1,o=s[0];10<=o;o/=10,f++);f<j&&(t-=j-f)}return u.e=t,u.c=s,u}),R.sum=function(){for(var e=1,r=arguments,n=new R(r[0]);e<r.length;)n=n.plus(r[e++]);return n},d="0123456789",a=function(e,r,n,t,i){var o,f,s,u,l,c,a,h,p=e.indexOf("."),g=y,w=v;for(0<=p&&(u=A,A=0,e=e.replace(".",""),c=(h=new R(r)).pow(e.length-p),A=u,h.c=B(Q(X(c.c),c.e,"0"),10,n,d),h.e=h.c.length),s=u=(a=B(e,r,n,i?(o=S,d):(o=d,S))).length;0==a[--u];a.pop());if(!a[0])return o.charAt(0);if(p<0?--s:(c.c=a,c.e=s,c.s=t,a=(c=m(c,h,g,w,n)).c,l=c.r,s=c.e),p=a[f=s+g+1],u=n/2,l=l||f<0||null!=a[f+1],l=w<4?(null!=p||l)&&(0==w||w==(c.s<0?3:2)):u<p||p==u&&(4==w||l||6==w&&1&a[f-1]||w==(c.s<0?8:7)),f<1||!a[0])e=l?Q(o.charAt(1),-g,o.charAt(0)):o.charAt(0);else{if(a.length=f,l)for(--n;++a[--f]>n;)a[f]=0,f||(++s,a=[1].concat(a));for(u=a.length;!a[--u];);for(p=0,e="";p<=u;e+=o.charAt(a[p++]));e=Q(e,s,o.charAt(0))}return e},m=function(e,r,n,t,i){var o,f,s,u,l,c,a,h,p,g,w,m,d,y,v,N,b,O=e.s==r.s?1:-1,E=e.c,A=r.c;if(!(E&&E[0]&&A&&A[0]))return new R(e.s&&r.s&&(E?!A||E[0]!=A[0]:A)?E&&0==E[0]||!A?0*O:O/0:NaN);for(p=(h=new R(O)).c=[],O=n+(f=e.e-r.e)+1,i||(i=q,f=W(e.e/j)-W(r.e/j),O=O/j|0),s=0;A[s]==(E[s]||0);s++);if(A[s]>(E[s]||0)&&f--,O<0)p.push(1),u=!0;else{for(y=E.length,N=A.length,O+=2,1<(l=G(i/(A[s=0]+1)))&&(A=D(A,l,i),E=D(E,l,i),N=A.length,y=E.length),d=N,w=(g=E.slice(0,N)).length;w<N;g[w++]=0);b=A.slice(),b=[0].concat(b),v=A[0],A[1]>=i/2&&v++;do{if(l=0,(o=P(A,g,N,w))<0){if(m=g[0],N!=w&&(m=m*i+(g[1]||0)),1<(l=G(m/v)))for(a=(c=D(A,l=i<=l?i-1:l,i)).length,w=g.length;1==P(c,g,a,w);)l--,x(c,N<a?b:A,a,i),a=c.length,o=1;else 0==l&&(o=l=1),a=(c=A.slice()).length;if(x(g,c=a<w?[0].concat(c):c,w,i),w=g.length,-1==o)for(;P(A,g,N,w)<1;)l++,x(g,N<w?b:A,w,i),w=g.length}else 0===o&&(l++,g=[0])}while(p[s++]=l,g[0]?g[w++]=E[d]||0:(g=[E[d]],w=1),(d++<y||null!=g[0])&&O--);u=null!=g[0],p[0]||p.splice(0,1)}if(i==q){for(s=1,O=p[0];10<=O;O/=10,s++);I(h,n+(h.e=s+f*j-1)+1,t,u)}else h.e=f,h.r=+u;return h},f=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,u=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g,h=function(e,r,n,t){var i,o=n?r:r.replace(p,"");if(c.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(f,function(e,r,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,t&&t!=i?e:r}),t&&(i=t,o=o.replace(s,"$1").replace(u,"0.$1")),r!=o))return new R(o,i);if(R.DEBUG)throw Error(F+"Not a"+(t?" base "+t:"")+" number: "+r);e.s=null}e.c=e.e=null},t.absoluteValue=t.abs=function(){var e=new R(this);return e.s<0&&(e.s=1),e},t.comparedTo=function(e,r){return Y(this,new R(e,r))},t.decimalPlaces=t.dp=function(e,r){var n,t;if(null!=e)return J(e,0,V),null==r?r=v:J(r,0,8),I(new R(this),e+this.e+1,r);if(!(e=this.c))return null;if(n=((t=e.length-1)-W(this.e/j))*j,t=e[t])for(;t%10==0;t/=10,n--);return n=n<0?0:n},t.dividedBy=t.div=function(e,r){return m(this,new R(e,r),y,v)},t.dividedToIntegerBy=t.idiv=function(e,r){return m(this,new R(e,r),0,1)},t.exponentiatedBy=t.pow=function(e,r){var n,t,i,o,f,s,u,l,c=this;if((e=new R(e)).c&&!e.isInteger())throw Error(F+"Exponent not an integer: "+T(e));if(null!=r&&(r=new R(r)),f=14<e.e,!c.c||!c.c[0]||1==c.c[0]&&!c.e&&1==c.c.length||!e.c||!e.c[0])return l=new R(Math.pow(+T(c),f?2-Z(e):+T(e))),r?l.mod(r):l;if(s=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new R(NaN);(t=!s&&c.isInteger()&&r.isInteger())&&(c=c.mod(r))}else{if(9<e.e&&(0<c.e||c.e<-1||(0==c.e?1<c.c[0]||f&&24e7<=c.c[1]:c.c[0]<8e13||f&&c.c[0]<=9999975e7)))return o=c.s<0&&Z(e)?-0:0,-1<c.e&&(o=1/o),new R(s?1/o:o);A&&(o=M(A/j+2))}for(u=f?(n=new R(.5),s&&(e.s=1),Z(e)):(i=Math.abs(+T(e)))%2,l=new R(g);;){if(u){if(!(l=l.times(c)).c)break;o?l.c.length>o&&(l.c.length=o):t&&(l=l.mod(r))}if(i){if(0===(i=G(i/2)))break;u=i%2}else if(I(e=e.times(n),e.e+1,1),14<e.e)u=Z(e);else{if(0==(i=+T(e)))break;u=i%2}c=c.times(c),o?c.c&&c.c.length>o&&(c.c.length=o):t&&(c=c.mod(r))}return t?l:(s&&(l=g.div(l)),r?l.mod(r):o?I(l,A,v,void 0):l)},t.integerValue=function(e){var r=new R(this);return null==e?e=v:J(e,0,8),I(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===Y(this,new R(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0<Y(this,new R(e,r))},t.isGreaterThanOrEqualTo=t.gte=function(e,r){return 1===(r=Y(this,new R(e,r)))||0===r},t.isInteger=function(){return!!this.c&&W(this.e/j)>this.c.length-2},t.isLessThan=t.lt=function(e,r){return Y(this,new R(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=Y(this,new R(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0<this.s},t.isZero=function(){return!!this.c&&0==this.c[0]},t.minus=function(e,r){var n,t,i,o,f=this,s=f.s;if(r=(e=new R(e,r)).s,!s||!r)return new R(NaN);if(s!=r)return e.s=-r,f.plus(e);var u=f.e/j,l=e.e/j,c=f.c,a=e.c;if(!u||!l){if(!c||!a)return c?(e.s=-r,e):new R(a?f:NaN);if(!c[0]||!a[0])return a[0]?(e.s=-r,e):new R(c[0]?f:3==v?-0:0)}if(u=W(u),l=W(l),c=c.slice(),s=u-l){for((i=(o=s<0)?(s=-s,c):(l=u,a)).reverse(),r=s;r--;i.push(0));i.reverse()}else for(t=(o=(s=c.length)<(r=a.length))?s:r,s=r=0;r<t;r++)if(c[r]!=a[r]){o=c[r]<a[r];break}if(o&&(i=c,c=a,a=i,e.s=-e.s),0<(r=(t=a.length)-(n=c.length)))for(;r--;c[n++]=0);for(r=q-1;s<t;){if(c[--t]<a[t]){for(n=t;n&&!c[--n];c[n]=r);--c[n],c[t]+=q}c[t]-=a[t]}for(;0==c[0];c.splice(0,1),--l);return c[0]?U(e,c,l):(e.s=3==v?-1:1,e.c=[e.e=0],e)},t.modulo=t.mod=function(e,r){var n,t=this;return e=new R(e,r),!t.c||!e.s||e.c&&!e.c[0]?new R(NaN):!e.c||t.c&&!t.c[0]?new R(t):(9==i?(r=e.s,e.s=1,n=m(t,e,0,3),e.s=r,n.s*=r):n=m(t,e,0,i),(e=t.minus(n.times(e))).c[0]||1!=i||(e.s=t.s),e)},t.multipliedBy=t.times=function(e,r){var n,t,i,o,f,s,u,l,c,a,h,p=this,g=p.c,w=(e=new R(e,r)).c;if(!(g&&w&&g[0]&&w[0]))return!p.s||!e.s||g&&!g[0]&&!w||w&&!w[0]&&!g?e.c=e.e=e.s=null:(e.s*=p.s,g&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=W(p.e/j)+W(e.e/j),e.s*=p.s,(s=g.length)<(p=w.length)&&(h=g,g=w,w=h,t=s,s=p,p=t),t=s+p,h=[];t--;h.push(0));for(t=p;0<=--t;){for(c=w[t]%1e7,a=w[t]/1e7|(n=0),i=t+(o=s);t<i;)n=((u=c*(u=g[--o]%1e7)+(f=a*u+(l=g[o]/1e7|0)*c)%1e7*1e7+h[i]+n)/1e14|0)+(f/1e7|0)+a*l,h[i--]=u%1e14;h[i]=n}return n?++r:h.splice(0,1),U(e,h,r)},t.negated=function(){var e=new R(this);return e.s=-e.s||null,e},t.plus=function(e,r){var n,t=this,i=t.s;if(r=(e=new R(e,r)).s,!i||!r)return new R(NaN);if(i!=r)return e.s=-r,t.minus(e);var o=t.e/j,f=e.e/j,s=t.c,u=e.c;if(!o||!f){if(!s||!u)return new R(i/0);if(!s[0]||!u[0])return u[0]?e:new R(s[0]?t:0*i)}if(o=W(o),f=W(f),s=s.slice(),i=o-f){for((n=0<i?(f=o,u):(i=-i,s)).reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(r=u.length)<0&&(n=u,u=s,s=n,r=i),i=0;r;)i=(s[--r]=s[r]+u[r]+i)/q|0,s[r]=q===s[r]?0:s[r]%q;return i&&(s=[i].concat(s),++f),U(e,s,f)},t.precision=t.sd=function(e,r){var n,t;if(null!=e&&e!==!!e)return J(e,1,V),null==r?r=v:J(r,0,8),I(new R(this),e,r);if(!(r=this.c))return null;if(n=(t=r.length-1)*j+1,t=r[t]){for(;t%10==0;t/=10,n--);for(t=r[0];10<=t;t/=10,n++);}return n=e&&this.e+1>n?this.e+1:n},t.shiftedBy=function(e){return J(e,-$,$),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,n,t,i,o=this,f=o.c,s=o.s,u=o.e,l=y+4,c=new R("0.5");if(1!==s||!f||!f[0])return new R(!s||s<0&&(!f||f[0])?NaN:f?o:1/0);if((n=0==(s=Math.sqrt(+T(o)))||s==1/0?(((r=X(f)).length+u)%2==0&&(r+="0"),s=Math.sqrt(+r),u=W((u+1)/2)-(u<0||u%2),new R(r=s==1/0?"5e"+u:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+u)):new R(s+"")).c[0])for((s=(u=n.e)+l)<3&&(s=0);;)if(i=n,n=c.times(i.plus(m(o,i,l,1))),X(i.c).slice(0,s)===(r=X(n.c)).slice(0,s)){if(n.e<u&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(t||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(I(n,n.e+y+2,1),e=!n.times(n).eq(o));break}if(!t&&(I(i,i.e+y+2,0),i.times(i).eq(o))){n=i;break}l+=4,s+=4,t=1}return I(n,n.e+y+1,v,e)},t.toExponential=function(e,r){return null!=e&&(J(e,0,V),e++),o(this,e,r,1)},t.toFixed=function(e,r){return null!=e&&(J(e,0,V),e=e+this.e+1),o(this,e,r)},t.toFormat=function(e,r,n){if(null==n)null!=e&&r&&"object"==_typeof(r)?(n=r,r=null):e&&"object"==_typeof(e)?(n=e,e=r=null):n=_;else if("object"!=_typeof(n))throw Error(F+"Argument not an object: "+n);if(e=this.toFixed(e,r),this.c){var t,r=e.split("."),i=+n.groupSize,o=+n.secondaryGroupSize,f=n.groupSeparator||"",s=r[0],r=r[1],u=this.s<0,l=u?s.slice(1):s,c=l.length;if(o&&(t=i,i=o,c-=o=t),0<i&&0<c){for(s=l.substr(0,t=c%i||i);t<c;t+=i)s+=f+l.substr(t,i);0<o&&(s+=f+l.slice(t)),u&&(s="-"+s)}e=r?s+(n.decimalSeparator||"")+((o=+n.fractionGroupSize)?r.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):r):s}return(n.prefix||"")+e+(n.suffix||"")},t.toFraction=function(e){var r,n,t,i,o,f,s,u,l,c,a=this,h=a.c;if(null!=e&&(!(s=new R(e)).isInteger()&&(s.c||1!==s.s)||s.lt(g)))throw Error(F+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+T(s));if(!h)return new R(a);for(r=new R(g),l=n=new R(g),t=u=new R(g),h=X(h),o=r.e=h.length-a.e-1,r.c[0]=z[(f=o%j)<0?j+f:f],e=!e||0<s.comparedTo(r)?0<o?r:l:s,f=O,O=1/0,s=new R(h),u.c[0]=0;c=m(s,r,0,1),1!=(i=n.plus(c.times(t))).comparedTo(e);)n=t,t=i,l=u.plus(c.times(i=l)),u=i,r=s.minus(c.times(i=r)),s=i;return i=m(e.minus(n),t,0,1),u=u.plus(i.times(l)),n=n.plus(i.times(t)),u.s=l.s=a.s,h=m(l,t,o*=2,v).minus(a).abs().comparedTo(m(u,n,o,v).minus(a).abs())<1?[l,t]:[u,n],O=f,h},t.toNumber=function(){return+T(this)},t.toPrecision=function(e,r){return null!=e&&J(e,1,V),o(this,e,r,2)},t.toString=function(e){var r,n=this,t=n.s,i=n.e;return null===i?t?(r="Infinity",t<0&&(r="-"+r)):r="NaN":(r=null==e?i<=w||N<=i?K(X(n.c),i):Q(X(n.c),i,"0"):10===e?Q(X((n=I(new R(n),y+i+1,v)).c),n.e,"0"):(J(e,2,S.length,"Base"),a(Q(X(n.c),i,"0"),10,e,t,!0)),t<0&&n.c[0]&&(r="-"+r)),r},t.valueOf=t.toJSON=function(){return T(this)},t._isBigNumber=!0,null!=r&&R.set(r),R}()).default=r.BigNumber=r,"function"==typeof define&&define.amd?define(function(){return r}):"undefined"!=typeof module&&module.exports?module.exports=r:(e=e||("undefined"!=typeof self&&self?self:window)).BigNumber=r}(void 0);
//# sourceMappingURL=bignumber.min.js.map;