1"use strict";(self.webpackChunktwilio_foundation_frontend=self.webpackChunktwilio_foundation_frontend||[]).push([[1207],{1207:function(e,t,n){n.r(t),n.d(t,{FALLBACK_MAX_USECASE_LENGTH:function(){return l},registerProductRecommenderEntry:function(){return O}});const r="/en-us/products/product-recommendation",o="usecase",i="[data-self-target]",c="wcmmode",a="disabled",u="product-recommender-entry--submitting",d={PROMPT_SUBMIT:"product_recommender_prompt_submit",PREDEFINED_USECASE_CLICK:"product_recommender_predefined_usecase_click"},s={ROOT:".product-recommender-entry",INPUT:".product-recommender-entry__input",SUBMIT:".product-recommender-entry__submit-btn",OPTION:".product-recommender-entry__option",MESSAGE:".product-recommender-entry__message",MESSAGE_TEXT:".product-recommender-entry__message-text"},l=1900,m=150;function f(e){return e.maxLength>0?e.maxLength:l}var E;function S(e){const t=f(e)-e.value.length;return t<0?E.OverLimit:t<=m?E.NearLimit:E.Ok}function _(e,t,n){const r=e.querySelector(s.MESSAGE),o=e.querySelector(s.MESSAGE_TEXT);r&&(r.hidden=n===E.Ok),o&&(o.textContent=n===E.Ok?"":function(e,t){if(t===E.OverLimit)return`Please enter a use case less than ${f(e)} characters.`;const n=f(e)-e.value.length;return 1===n?"1 character remaining.":`${n} characters remaining.`}(t,n)),t.setAttribute("aria-invalid",(n===E.OverLimit).toString())}function h(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e})}function w(e){const t=e.replace(/\.html$/,"");return t.length>1?t.replace(/\/$/,""):t}function L(e,t,n){const r=e.querySelector(s.SUBMIT);e.classList.toggle(u,n),t.disabled=n,r&&(r.disabled=n),e.querySelectorAll(s.OPTION).forEach(e=>{e.disabled=n})}function p(e,t){const n=t.value.trim();if(n){if(n.length>f(t))return _(e,t,E.OverLimit),void t.focus();h(d.PROMPT_SUBMIT),L(e,t,!0),function(e,t,n){!function(e){return e.origin===window.location.origin&&w(e.pathname)===w(window.location.pathname)}(n)?(window.open(n.toString(),"_blank","noopener"),L(e,t,!1)):window.location.assign(n.toString())}(e,t,function(e,t){const n=null!==e.closest(i),u=n?new URL(window.location.href):new URL(e.dataset.experienceUrl?.trim()||r,window.location.origin);return n?u.hash="":function(e){new URLSearchParams(window.location.search).get(c)===a&&e.searchParams.set(c,a)}(u),u.searchParams.set(o,t),u}(e,n))}}function g(e){const t=e.querySelector(s.INPUT);t&&(function(e){const t=new URLSearchParams(window.location.search).get(o)?.trim();!t||t.length<=f(e)||(e.value=t)}(t),_(e,t,S(t)),t.addEventListener("input",()=>{_(e,t,S(t))}),e.querySelector(s.SUBMIT)?.addEventListener("click",()=>p(e,t)),t.addEventListener("keydown",n=>{"Enter"!==n.key||n.shiftKey||(n.preventDefault(),p(e,t))}),e.querySelectorAll(s.OPTION).forEach(n=>{n.addEventListener("click",()=>{t.value=n.textContent?.trim()||"",_(e,t,S(t)),h(d.PREDEFINED_USECASE_CLICK),p(e,t)})}))}function y(){document.querySelectorAll(s.ROOT).forEach(g)}function O(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",y):y()}!function(e){e.Ok="ok",e.NearLimit="nearLimit",e.OverLimit="overLimit"}(E||(E={}))}}]);
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.