@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
2 lines • 6.18 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../constants/index.cjs`),t=require(`../config/index.cjs`);let n=require(`vue`);var r=0,i,a=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`,o=typeof setImmediate==`function`?setImmediate:setTimeout;function s(e=`dt`){return`${e}${r++}`}function c(e,t){if(t){let n=l(t);return e[Math.abs(n)%e.length]}else return e[u(e.length)]}function l(e){let t;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}function u(e){return Math.floor(Math.random()*e)}function d(t){return t?t.map(t=>typeof t==`string`?{message:t,type:e.DEFAULT_VALIDATION_MESSAGE_TYPE}:t):[]}function f(e){let t=p(e);return!e||!t?[]:e.filter(e=>!!e.message&&e.type===t)}function p(t){return t?m(t,e.VALIDATION_MESSAGE_TYPES.ERROR)?e.VALIDATION_MESSAGE_TYPES.ERROR:m(t,e.VALIDATION_MESSAGE_TYPES.WARNING)?e.VALIDATION_MESSAGE_TYPES.WARNING:m(t,e.VALIDATION_MESSAGE_TYPES.SUCCESS)?e.VALIDATION_MESSAGE_TYPES.SUCCESS:null:null}function m(e,t){return!e||!t?!1:e.some(e=>e?.type===t)}function h(e){return e?.querySelector(a)}var g=e=>(0,n.h)(`div`,{innerHTML:e.html}),_=()=>new Promise(e=>{o(e)});function v(e,t={}){return e?e(t).some(e=>e.type===n.Comment||Array.isArray(e.children)&&!e.children.length?!1:e.type!==n.Text||typeof e.children==`string`&&e.children.trim()!==``):!1}var y=e=>e?.toLowerCase().split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``),b=e=>e.replace(/\.?([A-Z0-9]+)/g,(e,t)=>`-`+t.toLowerCase()).replace(/^-/,``),x=e=>{let t=Object.entries(e).filter(([e])=>e.match(/on[A-Z]/));return Object.fromEntries(t)},S=e=>{let t=Object.entries(e).filter(([e])=>!e.match(/on[A-Z]/));return Object.fromEntries(t)},C=e=>e?.nodeType===Node.ELEMENT_NODE?e:e?.nodeType?C(e?.nextSibling):null;function w(e){if(!t.configVue2StyleClassAttrs)return e;let n=Object.entries(e).filter(([e])=>![`class`,`style`].includes(e));return Object.fromEntries(n)}function T(e){return t.configVue2StyleClassAttrs?{class:e.class,style:e.style}:{}}function E(e,t=300){clearTimeout(i),i=setTimeout(e,t)}function D(e){let t=e.getBoundingClientRect(),n={top:t.top<0,left:t.left<0,bottom:t.bottom>(window.innerHeight||document.documentElement.clientHeight),right:t.right>(window.innerWidth||document.documentElement.clientWidth)};return n.any=Object.values(n).some(e=>e),n.all=Object.values(n).every(e=>e),n}var O=/(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/,k=RegExp(`(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)`),A=RegExp(`(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])`),j=RegExp(`(?:`+[[O.source,k.source].join(`+`),A.source].join(`|`)+`)`),M=/(?:(?:[;/][^#?<>\s]*)?)/,N=/(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/,P=RegExp(`\\b`+[j.source,M.source,N.source,`(?!\\w)`].join(`+`)),F=/\b[a-z\d.-]+:\/\/[^<>\s]+/,I=RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+[j.source,N.source].join(`+`)+`(?!\\w)`);function L(e=7,t=15){try{return RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`)}catch{console.warn(`This browser doesn't support regex lookahead/lookbehind`)}return RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`)}var R=L(),z=new RegExp([P.source,F.source,I.source,R.source].join(`|`),`gi`);function B(e){return!e||![`string`,`number`].includes(typeof e)?!1:(e=e.toString(),R.exec(e)?.[0]===e)}function V(e){return!e||typeof e!=`string`?!1:P.exec(e)?.[0]===e||F.exec(e)?.[0]===e}function H(e){return!e||typeof e!=`string`?!1:I.exec(e)?.[0]===e}function U(e){return e.filter(e=>!!e).join(`, `)}function W(e,t=`en-US`){return e.replace(/^\p{CWU}/u,e=>e.toLocaleUpperCase(t))}function G(e,t){typeof process>`u`||process.env.NODE_ENV===`test`&&(!e||!(e instanceof HTMLElement)||!document?.body||document.body.contains(e)||console.warn(`The ${t} component is not attached to the document body. This may cause issues.`))}function K(e=document.documentElement){return!!e.hasAttribute(`data-overlayscrollbars`)}function q(e=document.documentElement){K(e)?e.classList.add(`d-scrollbar-disabled`):e.classList.add(`d-of-hidden`)}function J(e=document.documentElement){K(e)?e.classList.remove(`d-scrollbar-disabled`):e.classList.remove(`d-of-hidden`)}function Y(e){return e.replaceAll(/[ -]/g,`_`).replaceAll(/\W/g,``).toUpperCase()}var X={getUniqueString:s,getRandomElement:c,getRandomInt:u,formatMessages:d,filterFormattedMessages:f,hasFormattedMessageOfType:m,getValidationState:p,htmlFragment:g,flushPromises:_,kebabCaseToPascalCase:y,extractVueListeners:x,extractNonListeners:S,removeClassStyleAttrs:w,addClassStyleAttrs:T,returnFirstEl:C,debounce:E,isOutOfViewPort:D,getPhoneNumberRegex:L,linkRegex:z,isEmailAddress:H,isPhoneNumber:B,isURL:V,safeConcatStrings:U,capitalizeFirstLetter:W,disableRootScrolling:q,enableRootScrolling:J};exports.addClassStyleAttrs=T,exports.capitalizeFirstLetter=W,exports.debounce=E,exports.default=X,exports.disableRootScrolling=q,exports.enableRootScrolling=J,exports.extractNonListeners=S,exports.extractVueListeners=x,exports.filterFormattedMessages=f,exports.findFirstFocusableNode=h,exports.flushPromises=_,exports.formatMessages=d,exports.getPhoneNumberRegex=L,exports.getRandomElement=c,exports.getRandomInt=u,exports.getUniqueString=s,exports.getValidationState=p,exports.hasFormattedMessageOfType=m,exports.hasSlotContent=v,exports.htmlFragment=g,exports.isEmailAddress=H,exports.isOutOfViewPort=D,exports.isPhoneNumber=B,exports.isURL=V,exports.javaHashCode=l,exports.kebabCaseToPascalCase=y,exports.linkRegex=z,exports.pascalCaseToKebabCase=b,exports.removeClassStyleAttrs=w,exports.returnFirstEl=C,exports.safeConcatStrings=U,exports.toFluentKeyString=Y,exports.warnIfUnmounted=G;
//# sourceMappingURL=index.cjs.map