whoami7 - Manager
:
/
home
/
analuakl
/
somethingsmushy.com
/
wp-content
/
plugins
/
user-registration
/
chunks
/
Upload File:
files >> /home/analuakl/somethingsmushy.com/wp-content/plugins/user-registration/chunks/reactPlayerTiktok.js
"use strict";(globalThis.webpackChunkuser_registration=globalThis.webpackChunkuser_registration||[]).push([[85],{5104(e,t,o){o.r(t),o.d(t,{default:()=>w});var s=o(1609);const n=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,i={INIT:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3},r={[i.INIT]:"emptied",[i.PAUSED]:"pause",[i.ENDED]:"ended",[i.PLAYING]:"play",[i.BUFFERING]:"waiting"};function a(e,t={}){const o={src:l(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(o["data-config"]=JSON.stringify(t.config)),`\n <style>\n :host {\n display:inline-block;\n min-width: 300px;\n min-height: 150px;\n position: relative;\n }\n iframe {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n height:100%;\n border:0;\n }\n </style>\n <iframe ${function(e){let t="";for(const o in e){const s=e[o];t+=""===s?` ${d(o)}`:` ${d(o)}="${d(`${s}`)}"`}return t}(o)} title="TikTok video"></iframe>\n `}function l(e,t={}){if(!e.src)return;const o=e.src.match(n);return`https://www.tiktok.com/player/v1/${o&&o[1]}?${function(e){return String(new URLSearchParams(function(e){let t={};for(let o in e){let s=e[o];!0===s||""===s?t[o]=1:!1===s?t[o]=0:null!=s&&(t[o]=s)}return t}(e)))}({controls:""===e.controls?null:0,autoplay:e.autoplay,muted:e.muted,loop:e.loop,rel:0,...t.config})}`}class u extends(globalThis.HTMLElement??class{}){static getTemplateHTML=a;static shadowRootOptions={mode:"open"};static get observedAttributes(){return["src","controls","loop","autoplay","muted"]}loadComplete=new c;#e;#t;#o=!1;#s=0;#n=!0;#i=null;#r=100;#a=0;#l;constructor(){super(),this.#u("config")}async load(){if(this.#e)return;this.shadowRoot||this.attachShadow(u.shadowRootOptions);const e=!this.#t;if(this.#t&&(this.loadComplete=new c),this.#t=!0,await(this.#e=Promise.resolve()),this.#e=null,this.#s=0,this.#o=!1,this.#n=!0,!this.src)return this.shadowRoot.innerHTML="",void globalThis.removeEventListener("message",this.#c);let t=this.shadowRoot.querySelector("iframe");const o=function(e){let t={};for(let o of e)t[o.name]=o.value;return t}(this.attributes);e&&t&&(this.#i=JSON.parse(t.getAttribute("data-config")||"{}")),(null==t?void 0:t.src)&&t.src===l(o,this)||(this.shadowRoot.innerHTML=a(o,this),t=this.shadowRoot.querySelector("iframe")),this.#l=t,globalThis.addEventListener("message",this.#c)}async attributeChangedCallback(e,t,o){if(t!==o)switch(e){case"muted":await this.loadComplete,this.muted=null!=o;break;case"autoplay":case"controls":case"loop":case"src":return void this.load()}}get config(){return this.#i}set config(e){this.#i=e}#c=e=>{var t;if(e.source!==(null==(t=this.#l)?void 0:t.contentWindow))return;const o=e.data;if(null==o?void 0:o["x-tiktok-player"])switch(o.type){case"onPlayerReady":this.loadComplete.resolve();break;case"onStateChange":{this.#n=[i.INIT,i.PAUSED,i.ENDED].includes(o.value);const e=r[o.value];e&&this.dispatchEvent(new Event(e));break}case"onCurrentTime":this.#s=o.value.currentTime,this.#a=o.value.duration,this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("timeupdate"));break;case"onVolumeChange":this.#r=o.value,this.dispatchEvent(new Event("volumechange"));break;case"onMute":this.#o=!!o.value,this.#r=o.value?0:this.#r,this.dispatchEvent(new Event("volumechange"));break;case"onError":this.dispatchEvent(new Event("error"));break;default:console.warn("Unhandled TikTok player message:",o)}};#d(e,t){var o;if(!(null==(o=this.#l)?void 0:o.contentWindow))return;const s={"x-tiktok-player":!0,type:e,...void 0!==t?{value:t}:{}};this.#l.contentWindow.postMessage(s,"*")}async play(){await this.loadComplete,this.#d("play")}async pause(){await this.loadComplete,this.#d("pause")}async#h(e){await this.loadComplete,this.#d("seekTo",Number(e))}async#p(){await this.loadComplete,this.#d("mute")}async#m(){await this.loadComplete,this.#d("unMute")}get volume(){return this.#r/100}set volume(e){console.warn("Volume control is not supported for TikTok videos.")}get currentTime(){return this.#s}set currentTime(e){this.#h(e)}get muted(){return this.#o}set muted(e){this.#o=e,e?this.#p():this.#m()}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.toggleAttribute("muted",!!e)}get paused(){return this.#n}get duration(){return this.#a}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e??"")}#u(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}}}class c extends Promise{constructor(e=()=>{}){let t,o;super((s,n)=>{e(s,n),t=s,o=n}),this.resolve=t,this.reject=o}}function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}globalThis.customElements&&!globalThis.customElements.get("tiktok-video")&&globalThis.customElements.define("tiktok-video",u);var h=u,p=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),m={className:"class",htmlFor:"for"};function f(e){return e.toLowerCase()}function v(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e||"object"==typeof e&&null!==e?void 0:e}function g(e,t,o){var s;e[t]=o,null==o&&t in((null==(s=globalThis.HTMLElement)?void 0:s.prototype)??{})&&e.removeAttribute(t)}var w=function({react:e,tagName:t,elementClass:o,events:s,displayName:n,defaultProps:i,toAttributeName:r=f,toAttributeValue:a=v}){const l=Number.parseInt(e.version)>=19,u=e.forwardRef((n,u)=>{var c,d;const h=e.useRef(null),f=e.useRef(new Map),w={},y={},b={},T={};for(const[e,t]of Object.entries(n)){if(p.has(e)){b[e]=t;continue}const s=r(m[e]??e);if(o.prototype&&e in o.prototype&&!(e in((null==(c=globalThis.HTMLElement)?void 0:c.prototype)??{}))&&!(null==(d=o.observedAttributes)?void 0:d.some(e=>e===s))){T[e]=t;continue}if(e.startsWith("on")){w[e]=t;continue}const n=a(t);if(s&&null!=n&&(y[s]=String(n),l||(b[s]=n)),s&&l){const e=v(t);b[s]=n!==e?n:t}}if("undefined"!=typeof window){for(const t in w){const o=w[t],n=t.endsWith("Capture"),i=((null==s?void 0:s[t])??t.slice(2).toLowerCase()).slice(0,n?-7:void 0);e.useLayoutEffect(()=>{const e=null==h?void 0:h.current;if(e&&"function"==typeof o)return e.addEventListener(i,o,n),()=>{e.removeEventListener(i,o,n)}},[null==h?void 0:h.current,o])}e.useLayoutEffect(()=>{if(null===h.current)return;const e=new Map;for(const t in T)g(h.current,t,T[t]),f.current.delete(t),e.set(t,T[t]);for(const[e,t]of f.current)g(h.current,e,void 0);f.current=e})}if("undefined"==typeof window&&(null==o?void 0:o.getTemplateHTML)&&(null==o?void 0:o.shadowRootOptions)){const{mode:t,delegatesFocus:s}=o.shadowRootOptions,i=e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:o.getTemplateHTML(y,n)},key:"ce-la-react-ssr-template-shadow-root"});b.children=[i,b.children]}return e.createElement(t,{...i,...b,ref:e.useCallback(e=>{h.current=e,"function"==typeof u?u(e):null!==u&&(u.current=e)},[u])},b.children)});return u.displayName=n??o.name,u}({react:s,tagName:"tiktok-video",elementClass:h,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":f(e)})}}]);
Copyright ©2021 || Defacer Indonesia