PageSourceSearch

https://www.authy.com/etc.clientlibs/twilio-foundation/clientlibs/…/resources/4027.09db31c1d781c5710bb6.js

js authy.com collected 2026-09-24 08:24:27 UTC 12,322 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktwilio_foundation_frontend=self.webpackChunktwilio_foundation_frontend||[]).push([[3261,4027],{23261:function(t,e,r){r.r(e),r.d(e,{accordionExternalMethods:function(){return E},registerSlidersWrapper:function(){return g}});var n,a,i=r(97519),o=r(94598),s=r(68229);!function(t){t.DEFAULT="default",t.INSIDE_CUSTOMER_WINDOW="inside-customer-window"}(n||(n={})),function(t){t.SELF=".cmp-sliders-wrapper",t.MAIN_CONTENT=".cmp-sliders-wrapper__main",t.UNAVAILABLE_CONTENT=".cmp-sliders-wrapper__unavailable",t.EXPAND_BUTTON=".cmp-sliders-wrapper__main__button",t.ACCORDION_CONTENT=".cmp-sliders-wrapper__main__content",t.PARENT=".cmp-whatsapp-calculator",t.PARENT_COUNTRY_SELECTOR=".cmp-whatsapp-country-selector__wrapper__select",t.CALCULATION_TOTAL=".cmp-sliders-wrapper__main__button__price__value",t.META_FEES=".cmp-sliders-wrapper__main__content__fees__meta__paragraph__fee",t.META_FEES_TOTAL=".cmp-sliders-wrapper__main__content__fees__meta__paragraph__total",t.TWILIO_FEES=".cmp-sliders-wrapper__main__content__fees__twilio__paragraph__fee",t.TWILIO_FEES_TOTAL=".cmp-sliders-wrapper__main__content__fees__twilio__paragraph__total",t.TIER_DISCLAIMER_ELEMENT=".cmp-sliders-wrapper__main__content__fees__meta__paragraph__disclaimer[data-type='tier']",t.AUTH_DISCLAIMER_ELEMENT=".cmp-sliders-wrapper__main__content__fees__meta__paragraph__disclaimer[data-type='international-rates']",t.SLIDERS=".cmp-sliders-wrapper__main__content__slider__input-wrapper__input",t.SLIDER_WRAPPER=".cmp-sliders-wrapper__main__content__slider__input-wrapper",t.SLIDER_MESSAGE_COUNT=".cmp-sliders-wrapper__main__content__slider__title__messages",t.SLIDER_MAX_RANGE_TEXT=".cmp-sliders-wrapper__main__content__slider__input-wrapper__range__max",t.SLIDERS_DEFAULT='.cmp-sliders-wrapper__main__content__slider__input-wrapper__input[data-type="default"]',t.SLIDERS_INSIDE_CUSTOMER_WINDOW='.cmp-sliders-wrapper__main__content__slider__input-wrapper__input[data-type="inside-customer-window"]'}(a||(a={}));const c=new Map([["utility-accordion","utilityRates"],["authentication-accordion","authenticationRates"],["marketing-accordion","marketingRates"],["freeform-accordion","serviceRates"]]),l=new Intl.NumberFormat,u=(t,e)=>{const r=c.get(e??""),n=t?.dataset[r??""]??"[]",[a,i,o]=JSON.parse(n);return{messageFee:a??0,limit:i??0,available:o??!1}},_=t=>t?.querySelector(a.PARENT_COUNTRY_SELECTOR)?.selectedOptions.item(0),p=(t,e)=>{t&&(t.textContent=i.default.sanitize(e))},d=(t,e,r)=>{const n=_(e),{accordionType:i,calculationType:s}=t.dataset,{messageFee:c}=u(n,i),l=n?.dataset.fixedTwilioRate??e?.dataset.twilioRate,d={meta:c,twilio:Number(l??.005)},{customerWindowCalculator:m,defaultMessagesCalculator:h}=(t=>({defaultMessagesCalculator:e=>{const r=()=>e*t.twilio,n=()=>e*(t.meta??0);return{getTwilioTotal:r,getMetaTotal:n,getTotal:()=>r()+n()}},customerWindowCalculator:({insideCustomerWindow:e,outsideCustomerWindow:r})=>{const n=()=>(e+r)*t.twilio,a=()=>r*(t.meta??0);return{getTwilioTotal:n,getMetaTotal:a,getTotal:()=>n()+a()}}}))(d),E=(0,o.YW)(s).with("customer-window",()=>{const e=Number(t.querySelector(a.SLIDERS_INSIDE_CUSTOMER_WINDOW)?.value??"0"),r=Number(t.querySelector(a.SLIDERS_DEFAULT)?.value??"0");return m({insideCustomerWindow:e,outsideCustomerWindow:r})}).otherwise(()=>h(Number(t.querySelector(a.SLIDERS_DEFAULT)?.value??"0"))),g=t.querySelector(a.META_FEES_TOTAL),T=t.querySelector(a.TWILIO_FEES_TOTAL),S=t.querySelector(a.CALCULATION_TOTAL);p(g,r.twoDigit.format(E.getMetaTotal())),p(T,r.twoDigit.format(E.getTwilioTotal())),p(S,r.twoDigit.format(E.getTotal())),t.setAttribute("data-total",E.getTotal().toString())},m=(t,e)=>{const r=e.closest("label")?.querySelector(a.SLIDER_MESSAGE_COUNT),i=Number(e.value),o=Number(e.max);p(r,l.format(i)),e.dataset.type===n.DEFAULT&&(i>=o?t?.querySelector(a.TIER_DISCLAIMER_ELEMENT)?.toggleAttribute("hidden",!1):t?.querySelector(a.TIER_DISCLAIMER_ELEMENT)?.toggleAttribute("hidden",!0)),(t=>{const e=Number(t.min),r=Number(t.max),n=Number(t.value),a=Math.round(100*(n-e)/(r-e));t.style.cssText=`--track-position: ${a}%`})(e)},h=()=>
1{document.querySelectorAll(a.SELF).forEach(t=>{const e=t.closest(a.PARENT),r=e?.dataset.currencyFormat??s.O,n=(0,s.A)(r);$(t).on("input",a.SLIDERS,r=>{const a=r.target;m(t,a),d(t,e,n),t.dispatchEvent(new CustomEvent("calculationChange",{bubbles:!0}))}),t.querySelector(a.EXPAND_BUTTON)?.addEventListener("click",e=>{const r=e.currentTarget,n=t.querySelector(a.ACCORDION_CONTENT);if(n){const t="true"===r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",String(!t)),n.toggleAttribute("hidden",t)}})})},E=(t,e)=>({updateRatesInfo:r=>{const n=r.querySelector(a.META_FEES),i=r.querySelector(a.TWILIO_FEES),o=_(t),{accordionType:s,noChargeText:c}=r.dataset,{hasAuthInternationalRates:h,fixedTwilioRate:E}=o?.dataset??{},{messageFee:g,limit:T,available:S}=u(o,s);r.querySelector(a.MAIN_CONTENT)?.toggleAttribute("hidden",!S),r.querySelector(a.UNAVAILABLE_CONTENT)?.toggleAttribute("hidden",S),p(n,g?e.tenDigit.format(g):c??"No charge");const f=Number(E??t.dataset.twilioRate??.005);p(i,e.tenDigit.format(f)),"true"===h?r.querySelector(a.AUTH_DISCLAIMER_ELEMENT)?.toggleAttribute("hidden",!1):r.querySelector(a.AUTH_DISCLAIMER_ELEMENT)?.toggleAttribute("hidden",!0),r.querySelectorAll(a.SLIDERS).forEach(t=>{t.value=S?Math.min(Number(t.value),T).toString():"0",t.max=S?T.toString():"0",m(r,t);const e=t.closest(a.SLIDER_WRAPPER)?.querySelector(a.SLIDER_MAX_RANGE_TEXT);p(e,`${l.format(T)}+`)}),d(r,t,e)},resetAccordion:r=>{r.querySelectorAll(a.SLIDERS).forEach(t=>{t.value="0",m(r,t)}),d(r,t,e)}}),g=()=>{"loading"!==document.readyState?h():window.addEventListener("load",()=>{h()})}},68229:function(t,e,r){r.d(e,{A:function(){return s},O:function(){return n}});const n="${pricing_value}",a=new Intl.NumberFormat("en-us",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}),i=new Intl.NumberFormat("en-us",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:10}),o=(t,e)=>({format:r=>t.replace("{pricing_value}",e.format(r))}),s=t=>({twoDigit:o(t,a),tenDigit:o(t,i)})},74027:function(t,e,r){r.r(e),r.d(e,{registerWhatsAppCalculator:function(){return l}});var n,a=r(97519),i=r(68229),o=r(23261);!function(t){t.SELF=".cmp-whatsapp-calculator",t.COUNTRY_SELECTOR=".cmp-whatsapp-country-selector__wrapper__select",t.TOTAL_DISPLAY=".cmp-whatsapp-calculator__header__results__total",t.BUTTON_RESET=".cmp-whatsapp-calculator__header__reset__button",t.ACCORDIONS=".cmp-sliders-wrapper"}(n||(n={}));const s=(t,e,r)=>{t&&(t.textContent=a.default.sanitize(r.twoDigit.format((t=>t.reduce((t,e)=>t+Number(e.dataset.total??"0"),0))(e))))},c=()=>{document.querySelectorAll(n.SELF).forEach(t=>{const e=(0,i.A)(t.dataset.currencyFormat??i.O),r=t.querySelector(n.TOTAL_DISPLAY),a=Array.from(t.querySelectorAll(n.ACCORDIONS));t.addEventListener("calculationChange",()=>{s(r,a,e)});const c=t.querySelector(n.COUNTRY_SELECTOR),{updateRatesInfo:l,resetAccordion:u}=(0,o.accordionExternalMethods)(t,e);c?.addEventListener("change",()=>{a.forEach(l),s(r,a,e)});const _=t?.querySelector(n.BUTTON_RESET);_?.addEventListener("click",()=>{a.forEach(u),s(r,a,e)}),s(r,a,e)})};function l(){"loading"!==document.readyState?c():window.addEventListener("load",()=>{c()})}},94598:function(t,e,r){r.d(e,{YW:function(){return L}});const n=Symbol.for("@ts-pattern/matcher"),a=Symbol.for("@ts-pattern/isVariadic"),i="@ts-pattern/anonymous-select-key",o=t=>Boolean(t&&"object"==typeof t),s=t=>t&&!!t[n],c=(t,e,r)=>{if(s(t)){const a=t[n](),{matched:i,selections:o}=a.match(e);return i&&o&&Object.keys(o).forEach(t=>r(t,o[t])),i}if(o(t)){if(!o(e))return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let n=[],i=[],o=[];for(const e of t.keys()){const r=t[e];s(r)&&r[a]?o.push(r):o.length?i.push(r):n.push(r)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(e.length<n.length+i.length)return!1;const t=e.slice(0,n.length),a=0===i.length?[]:e.slice(-i.length),s=e.slice(n.length,0===i.length?1/0:-i.length);return n.every((e,n)=>c(e,t[n],r))&&i.every((t,e)=>c(t,a[e],r))&&(0===o.length||c(o[0],s,r))}return t.length===e.length&&t.every((t,n)=>c(t,e[n],r))}return Reflect.ownKeys(t).every(a=>{const i=t[a];return(a in e||s(o=i)&&"optional"===o[n]().matcherType)&&c(i,e[a
1],r);var o})}return Object.is(e,t)},l=t=>{var e,r,a;return o(t)?s(t)?null!=(e=null==(r=(a=t[n]()).getSelectionKeys)?void 0:r.call(a))?e:[]:Array.isArray(t)?u(t,l):u(Object.values(t),l):[]},u=(t,e)=>t.reduce((t,r)=>t.concat(e(r)),[]);function _(t){return Object.assign(t,{optional:()=>p(t),and:e=>d(t,e),or:e=>m(t,e),select:e=>void 0===e?E(t):E(e,t)})}function p(t){return _({[n]:()=>({match:e=>{let r={};const n=(t,e)=>{r[t]=e};return void 0===e?(l(t).forEach(t=>n(t,void 0)),{matched:!0,selections:r}):{matched:c(t,e,n),selections:r}},getSelectionKeys:()=>l(t),matcherType:"optional"})})}function d(...t){return _({[n]:()=>({match:e=>{let r={};const n=(t,e)=>{r[t]=e};return{matched:t.every(t=>c(t,e,n)),selections:r}},getSelectionKeys:()=>u(t,l),matcherType:"and"})})}function m(...t){return _({[n]:()=>({match:e=>{let r={};const n=(t,e)=>{r[t]=e};return u(t,l).forEach(t=>n(t,void 0)),{matched:t.some(t=>c(t,e,n)),selections:r}},getSelectionKeys:()=>u(t,l),matcherType:"or"})})}function h(t){return{[n]:()=>({match:e=>({matched:Boolean(t(e))})})}}function E(...t){const e="string"==typeof t[0]?t[0]:void 0,r=2===t.length?t[1]:"string"==typeof t[0]?void 0:t[0];return _({[n]:()=>({match:t=>{let n={[null!=e?e:i]:t};return{matched:void 0===r||c(r,t,(t,e)=>{n[t]=e}),selections:n}},getSelectionKeys:()=>[null!=e?e:i].concat(void 0===r?[]:l(r))})})}function g(t){return"number"==typeof t}function T(t){return"string"==typeof t}function S(t){return"bigint"==typeof t}_(h(function(t){return!0}));const f=t=>Object.assign(_(t),{startsWith:e=>{return f(d(t,(r=e,h(t=>T(t)&&t.startsWith(r)))));var r},endsWith:e=>{return f(d(t,(r=e,h(t=>T(t)&&t.endsWith(r)))));var r},minLength:e=>f(d(t,(t=>h(e=>T(e)&&e.length>=t))(e))),length:e=>f(d(t,(t=>h(e=>T(e)&&e.length===t))(e))),maxLength:e=>f(d(t,(t=>h(e=>T(e)&&e.length<=t))(e))),includes:e=>{return f(d(t,(r=e,h(t=>T(t)&&t.includes(r)))));var r},regex:e=>{return f(d(t,(r=e,h(t=>T(t)&&Boolean(t.match(r))))));var r}}),w=(f(h(T)),t=>Object.assign(_(t),{between:(e,r)=>w(d(t,((t,e)=>h(r=>g(r)&&t<=r&&e>=r))(e,r))),lt:e=>w(d(t,(t=>h(e=>g(e)&&e<t))(e))),gt:e=>w(d(t,(t=>h(e=>g(e)&&e>t))(e))),lte:e=>w(d(t,(t=>h(e=>g(e)&&e<=t))(e))),gte:e=>w(d(t,(t=>h(e=>g(e)&&e>=t))(e))),int:()=>w(d(t,h(t=>g(t)&&Number.isInteger(t)))),finite:()=>w(d(t,h(t=>g(t)&&Number.isFinite(t)))),positive:()=>w(d(t,h(t=>g(t)&&t>0))),negative:()=>w(d(t,h(t=>g(t)&&t<0)))})),y=(w(h(g)),t=>Object.assign(_(t),{between:(e,r)=>y(d(t,((t,e)=>h(r=>S(r)&&t<=r&&e>=r))(e,r))),lt:e=>y(d(t,(t=>h(e=>S(e)&&e<t))(e))),gt:e=>y(d(t,(t=>h(e=>S(e)&&e>t))(e))),lte:e=>y(d(t,(t=>h(e=>S(e)&&e<=t))(e))),gte:e=>y(d(t,(t=>h(e=>S(e)&&e>=t))(e))),positive:()=>y(d(t,h(t=>S(t)&&t>0))),negative:()=>y(d(t,h(t=>S(t)&&t<0)))}));y(h(S)),_(h(function(t){return"boolean"==typeof t})),_(h(function(t){return"symbol"==typeof t})),_(h(function(t){return null==t})),_(h(function(t){return null!=t}));class A extends Error{constructor(t){let e;try{e=JSON.stringify(t)}catch(r){e=t}super(`Pattern matching error: no pattern matches value ${e}`),this.input=void 0,this.input=t}}const N={matched:!1,value:void 0};function L(t){return new I(t,N)}class I{constructor(t,e){this.input=void 0,this.state=void 0,this.input=t,this.state=e}with(...t){if(this.state.matched)return this;const e=t[t.length-1],r=[t[0]];let n;3===t.length&&"function"==typeof t[1]?n=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let a=!1,o={};const s=(t,e)=>{a=!0,o[t]=e},l=!r.some(t=>c(t,this.input,s))||n&&!Boolean(n(this.input))?N:{matched:!0,value:e(a?i in o?o[i]:o:this.input,this.input)};return new I(this.input,l)}when(t,e){if(this.state.matched)return this;const r=Boolean(t(this.input));return new I(this.input,r?{matched:!0,value:e(this.input,this.input)}:N)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=v){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function v(t){throw new A(t)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.