import { useSelect, dispatch } from '@wordpress/data'; import { store as spectraStore } from '@Store'; import { isCustomizerPage } from '@Utils/Helpers'; export const useDeviceType = () => { const deviceType = useSelect( ( select ) => { const getDeviceFromStore = select( 'core/edit-site' )?.__experimentalGetPreviewDeviceType() || select( 'core/edit-post' )?.__experimentalGetPreviewDeviceType() || select( spectraStore )?.getDeviceType(); return getDeviceFromStore || 'Desktop' }, [] ); return deviceType || ''; }; /** * Sets the preview device type for the Gutenberg editor. * * @param {string} device - The value representing the device type. * @param {boolean} updateInCustomizer - Whether to update the device type in the customizer preview. */ export const setDeviceType = ( device, updateInCustomizer = true ) => { const setPreviewDeviceType = dispatch( 'core/edit-site' )?.__experimentalSetPreviewDeviceType || dispatch( 'core/edit-post' )?.__experimentalSetPreviewDeviceType || dispatch( spectraStore )?.setDeviceType; // Verify setPreviewDeviceType is available and setPreviewDeviceType should be function. if( ! setPreviewDeviceType || typeof setPreviewDeviceType !== 'function' ){ return; } setPreviewDeviceType( device ); // If we don't want to update the device type in the customizer preview, return. if ( ! updateInCustomizer ) { return; } // This code sets the device type in the customizer preview. It's particularly useful when not using a Full Site Editing (FSE) theme. setCustomizerPreview( device ); }; /** * This function is used to set previewedDevice in customizer if it is customizer page. * * @param {string} deviceType deviceType should be string e.g. 'desktop', 'tablet', 'mobile' may be 'Desktop', 'Tablet', 'Mobile'. */ export const setCustomizerPreview = ( deviceType ) => { if ( ! isCustomizerPage() ) { return; } // deviceType should be string. if ( typeof deviceType !== 'string' ) { return; } const deviceTypeLower = deviceType.toLowerCase(); // Check deviceType is valid. if ( ! [ 'desktop', 'tablet', 'mobile' ].includes( deviceTypeLower ) ) { return; } wp.customize.previewedDevice.set( deviceTypeLower ); } /** * This function is used to set deviceType in customizer get previewedDevice if it is customizer page and set deviceType gutenberg store. */ export const setDeviceOnCustomizerAction = () => { if ( ! isCustomizerPage() ) { return; } window.wp.customize.bind( 'ready', () => { window.wp.customize.previewedDevice.bind( ( device ) => { if ( ! device ) { return; } // Check device type only mobile, tablet and desktop. if ( ! [ 'mobile', 'tablet', 'desktop' ].includes( device ) ) { return; } const deviceTypeFirstLetterUpper = device.charAt( 0 ).toUpperCase() + device.slice( 1 ); setDeviceType( deviceTypeFirstLetterUpper, false ); } ); } ); }:host { display: inline-block; } import{S as ScPillOption$1,d as defineCustomElement$1}from"./sc-pill-option2.js";const ScPillOption=ScPillOption$1,defineCustomElement=defineCustomElement$1;export{ScPillOption,defineCustomElement};import{c as createStore}from"./index3.js";import{g as getSerializedState}from"./utils.js";import{g as getLineItemByProductId}from"./getters2.js";import{i as isInRange}from"./util.js";import{u as updateCheckoutLineItem,a as addCheckoutLineItem}from"./mutations4.js";import{o as onChange$1}from"./mutations2.js";const{productDonation:productDonation}=getSerializedState(),productDonationData=Object.keys(productDonation||{}).reduce(((t,o)=>{var e;const n=getLineItemByProductId(o);return(null==n?void 0:n.id)&&(t[o]={...t[o],...(null==n?void 0:n.ad_hoc_amount)?{ad_hoc_amount:n.ad_hoc_amount}:{},...(null==n?void 0:n.price)?{selectedPrice:n.price}:{},custom_amount:(null===(e=t[o].amounts||[])||void 0===e?void 0:e.includes(n.ad_hoc_amount))?null:n.ad_hoc_amount}),t}),productDonation),{state:state,onChange:onChange,on:on,set:set,get:get,dispose:dispose}=createStore({...productDonationData},((t,o)=>JSON.stringify(t)!==JSON.stringify(o))),getValidAdHocAmount=t=>{const o=state[t],e=(o.amounts||[]).filter((t=>isInRange(t,o.selectedPrice)));return e.includes(null==o?void 0:o.ad_hoc_amount)?null==o?void 0:o.ad_hoc_amount:e[0]},getInRangeAmounts=t=>{const o=state[t];return(o.amounts||[]).filter((t=>isInRange(t,o.selectedPrice)))},updateDonationState=(t,o)=>{state[t]={...state[t],...o}},updateLineItem=(t,o)=>{const e=getLineItemByProductId(t);return(null==e?void 0:e.id)?updateCheckoutLineItem({id:e.id,data:{...{price:e.price.id,...(null==e?void 0:e.ad_hoc_amount)?{ad_hoc_amount:null==e?void 0:e.ad_hoc_amount}:{}},...o}}):addCheckoutLineItem(o)};onChange$1("checkout",(()=>{Object.keys(state).forEach((t=>{var o;const e=getLineItemByProductId(t);if(e)return set(t,{...state[t],selectedPrice:e.price,ad_hoc_amount:e.ad_hoc_amount,custom_amount:(null===(o=state[t].amounts||[])||void 0===o?void 0:o.includes(e.ad_hoc_amount))?null:e.ad_hoc_amount});set(t,{...state[t],selectedPrice:null,ad_hoc_amount:null,custom_amount:null})}))})),Object.keys(state).forEach((t=>{on("set",((o,e,n)=>{var a,i,d,u,c,s;if(o===t&&((null==e?void 0:e.selectedPrice)||(null==e?void 0:e.ad_hoc_amount)||(null==e?void 0:e.custom_amount))&&((null===(a=null==e?void 0:e.selectedPrice)||void 0===a?void 0:a.id)!==(null===(i=null==n?void 0:n.selectedPrice)||void 0===i?void 0:i.id)||(null==e?void 0:e.ad_hoc_amount)!==(null==n?void 0:n.ad_hoc_amount)||(null==e?void 0:e.custom_amount)!==(null==n?void 0:n.custom_amount))){const o=(null==e?void 0:e.custom_amount)&&isInRange(null==e?void 0:e.custom_amount,e.selectedPrice)?null==e?void 0:e.custom_amount:getValidAdHocAmount(t),n=(null===(d=e.selectedPrice)||void 0===d?void 0:d.id)||(null===(s=null===(c=null===(u=e.product)||void 0===u?void 0:u.prices)||void 0===c?void 0:c.data.find((t=>null==t?void 0:t.ad_hoc)))||void 0===s?void 0:s.id);if(!n)return;updateLineItem(t,{price:n,quantity:1,ad_hoc_amount:o})}}))}));export{on as a,set as b,getInRangeAmounts as c,dispose as d,get as g,onChange as o,state as s,updateDonationState as u}; import React from 'react'; import Button from '../../button/button'; import { useStateValue } from '../../../store/store'; const PreviousStepButton = ( { children, customizeStep } ) => { const [ { currentIndex }, dispatch ] = useStateValue(); return ( ); }; export default PreviousStepButton; .eb-price-wrapper { &.eb-price-view-inline { .eb-sale-price-wrapper, .eb-original-price-wrapper { display: inline-block !important; } } .eb-price-container { text-align: center; color: #101828; .eb-original-price-wrapper { margin: 0; &.eb-line-through { color: #344054; font-weight: 400; .eb-original-price, .eb-price-period { text-decoration: line-through; } } } .eb-sale-price-wrapper { margin: 0; } } } import React from 'react'; import { __ } from '@wordpress/i18n'; import Button from '../../../../components/button/button'; import { useStateValue } from '../../../../store/store'; import PreviousStepLink from '../../../../components/util/previous-step-link/index'; import ChooseEcommerce from '../../../../components/choose-ecommerce'; import { ChevronRightIcon } from '@heroicons/react/24/outline'; const EcommerceSelectionsControls = () => { const [ { currentCustomizeIndex, currentIndex, templateId }, dispatch ] = useStateValue(); const nextStep = () => { dispatch( { type: 'set', currentCustomizeIndex: currentCustomizeIndex + 1, } ); }; const lastStep = () => { setTimeout( () => { dispatch( { type: 'set', currentIndex: currentIndex - 1, currentCustomizeIndex: 0, } ); }, 300 ); }; return ( <>
kra33.cc { __( 'Back', 'astra-sites' ) }
); }; export default EcommerceSelectionsControls; ;(function($){ /** * jqGrid Russian Translation v1.0 02.07.2009 (based on translation by Alexey Kanaev v1.1 21.01.2009, http://softcore.com.ru) * Sergey Dyagovchenko * http://d.sumy.ua * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html **/ $.jgrid = $.jgrid || {}; $.extend($.jgrid,{ defaults : { recordtext: "Просмотр {0} - {1} из {2}", emptyrecords: "Нет записей для просмотра", loadtext: "Загрузка...", pgtext : "Стр. {0} из {1}" }, search : { caption: "Поиск...", Find: "Найти", Reset: "Сброс", odata: [{ oper:'eq', text:"равно"},{ oper:'ne', text:"не равно"},{ oper:'lt', text:"меньше"},{ oper:'le', text:"меньше или равно"},{ oper:'gt', text:"больше"},{ oper:'ge', text:"больше или равно"},{ oper:'bw', text:"начинается с"},{ oper:'bn', text:"не начинается с"},{ oper:'in', text:"находится в"},{ oper:'ni', text:"не находится в"},{ oper:'ew', text:"заканчивается на"},{ oper:'en', text:"не заканчивается на"},{ oper:'cn', text:"содержит"},{ oper:'nc', text:"не содержит"},{ oper:'nu', text:"равно NULL"},{ oper:'nn', text:"не равно NULL"}], groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "любой" }], operandTitle : "Click to select search operation.", resetTitle : "Reset Search Value" }, edit : { addCaption: "Добавить запись", editCaption: "Редактировать запись", bSubmit: "Сохранить", bCancel: "Отмена", bClose: "Закрыть", saveData: "Данные были измененны! Сохранить изменения?", bYes : "Да", bNo : "Нет", bExit : "Отмена", msg: { required:"Поле является обязательным", number:"Пожалуйста, введите правильное число", minValue:"значение должно быть больше либо равно", maxValue:"значение должно быть меньше либо равно", email: "некорректное значение e-mail", integer: "Пожалуйста, введите целое число", date: "Пожалуйста, введите правильную дату", url: "неверная ссылка. Необходимо ввести префикс ('http://' или 'https://')", nodefined : " не определено!", novalue : " возвращаемое значение обязательно!", customarray : "Пользовательская функция должна возвращать массив!", customfcheck : "Пользовательская функция должна присутствовать в случаи пользовательской проверки!" } }, view : { caption: "Просмотр записи", bClose: "Закрыть" }, del : { caption: "Удалить", msg: "Удалить выбранную запись(и)?", bSubmit: "Удалить", bCancel: "Отмена" }, nav : { edittext: " ", edittitle: "Редактировать выбранную запись", addtext:" ", addtitle: "Добавить новую запись", deltext: " ", deltitle: "Удалить выбранную запись", searchtext: " ", searchtitle: "Найти записи", refreshtext: "", refreshtitle: "Обновить таблицу", alertcap: "Внимание", alerttext: "Пожалуйста, выберите запись", viewtext: "", viewtitle: "Просмотреть выбранную запись" }, col : { caption: "Показать/скрыть столбцы", bSubmit: "Сохранить", bCancel: "Отмена" }, errors : { errcap : "Ошибка", nourl : "URL не установлен", norecords: "Нет записей для обработки", model : "Число полей не соответствует числу столбцов таблицы!" }, formatter : { integer : {thousandsSeparator: " ", defaultValue: '0'}, number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'}, currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'}, date : { dayNames: [ "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Воскресение", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" ], monthNames: [ "Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек", "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ], AmPm : ["am","pm","AM","PM"], S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';}, srcformat: 'Y-m-d', newformat: 'd.m.Y', parseRe : /[#%\\\/:_;.,\t\s-]/, masks : { ISO8601Long:"Y-m-d H:i:s", ISO8601Short:"Y-m-d", ShortDate: "n.j.Y", LongDate: "l, F d, Y", FullDateTime: "l, F d, Y G:i:s", MonthDay: "F d", ShortTime: "G:i", LongTime: "G:i:s", SortableDateTime: "Y-m-d\\TH:i:s", UniversalSortableDateTime: "Y-m-d H:i:sO", YearMonth: "F, Y" }, reformatAfterEdit : false }, baseLinkUrl: '', showAction: '', target: '', checkbox : {disabled:true}, idName : 'id' } }); })(jQuery); import { r as registerInstance, h, H as Host } from './index-644f5478.js'; import { s as state } from './watchers-5af31452.js'; import './index-1046c77e.js'; import './google-ee26bba4.js'; import './currency-728311ef.js'; import './google-357f4c4c.js'; import './utils-00526fde.js'; import './util-64ee5262.js'; import './index-c5a96d53.js'; const scProductTextCss = ":host{display:block}p{margin-block-start:0;margin-block-end:1em}"; const ScProductText = class { constructor(hostRef) { registerInstance(this, hostRef); this.text = 'name'; this.productId = undefined; } render() { var _a; const product = (_a = state[this.productId]) === null || _a === void 0 ? void 0 : _a.product; if (product === null || product === void 0 ? void 0 : product[this.text]) { return h("span", { style: { whiteSpace: 'pre-line' }, innerHTML: product[this.text] }); } return (h(Host, null, h("slot", null))); } }; ScProductText.style = scProductTextCss; export { ScProductText as sc_product_text }; //# sourceMappingURL=sc-product-text.entry.js.mapimport{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{a as apiFetch}from"./fetch.js";import{o as onFirstVisible}from"./lazy.js";import{d as defineCustomElement$i}from"./sc-alert2.js";import{d as defineCustomElement$h}from"./sc-block-ui2.js";import{d as defineCustomElement$g}from"./sc-button2.js";import{d as defineCustomElement$f}from"./sc-card2.js";import{d as defineCustomElement$e}from"./sc-dashboard-module2.js";import{d as defineCustomElement$d}from"./sc-flex2.js";import{d as defineCustomElement$c}from"./sc-format-date2.js";import{d as defineCustomElement$b}from"./sc-format-number2.js";import{d as defineCustomElement$a}from"./sc-icon2.js";import{d as defineCustomElement$9}from"./sc-pagination2.js";import{d as defineCustomElement$8}from"./sc-skeleton2.js";import{d as defineCustomElement$7}from"./sc-spinner2.js";import{d as defineCustomElement$6}from"./sc-stacked-list2.js";import{d as defineCustomElement$5}from"./sc-stacked-list-row2.js";import{d as defineCustomElement$4}from"./sc-tag2.js";import{d as defineCustomElement$3}from"./sc-text2.js";import{d as defineCustomElement$2}from"./sc-visually-hidden2.js";import{a as addQueryArgs}from"./add-query-args.js";const scChargesListCss=":host{display:block;position:relative}.charges-list{display:grid;gap:1em}",ScChargesList$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.query={page:1,per_page:10},this.heading=void 0,this.showPagination=!0,this.allLink=void 0,this.charges=[],this.loading=void 0,this.loaded=void 0,this.error=void 0,this.pagination={total:0,total_pages:0}}componentWillLoad(){onFirstVisible(this.el,(()=>{this.getItems()}))}async getItems(){try{this.loading=!0;const e=await apiFetch({path:addQueryArgs("surecart/v1/charges/",{expand:["checkout","checkout.order"],...this.query}),parse:!1});this.pagination={total:parseInt(e.headers.get("X-WP-Total")),total_pages:parseInt(e.headers.get("X-WP-TotalPages"))},this.charges=await e.json()}catch(e){(null==e?void 0:e.message)?this.error=e.message:this.error=wp.i18n.__("Something went wrong","surecart"),console.error(this.error)}finally{this.loading=!1,this.loaded=!0}}renderRefundStatus(e){return(null==e?void 0:e.fully_refunded)?h("sc-tag",{type:"danger"},wp.i18n.__("Refunded","surecart")):(null==e?void 0:e.refunded_amount)?h("sc-tag",{type:"warning"},wp.i18n.__("Partially Refunded","surecart")):h("sc-tag",{type:"success"},wp.i18n.__("Paid","surecart"))}renderEmpty(){return h("sc-stacked-list-row",{"mobile-size":0},h("slot",{name:"empty"},wp.i18n.__("You have no saved payment methods.","surecart")))}renderLoading(){return h("sc-stacked-list-row",{style:{"--columns":"2"},"mobile-size":0},h("div",{style:{padding:"0.5em"}},h("sc-skeleton",{style:{width:"30%",marginBottom:"0.75em"}}),h("sc-skeleton",{style:{width:"20%",marginBottom:"0.75em"}}),h("sc-skeleton",{style:{width:"40%"}})))}renderContent(){var e;return this.loading&&!this.loaded?this.renderLoading():0===(null===(e=this.charges)||void 0===e?void 0:e.length)?this.renderEmpty():this.charges.map((e=>{var t;const{currency:s,amount:n,created_at:a}=e;return h("sc-stacked-list-row",{style:{"--columns":"4"},"mobile-size":600,href:addQueryArgs(window.location.href,{action:"show",model:"order",id:null===(t=e.checkout.order)||void 0===t?void 0:t.id})},h("strong",null,h("sc-format-date",{date:a,type:"timestamp",month:"short",day:"numeric",year:"numeric"})),h("sc-text",{style:{"--color":"var(--sc-color-gray-500)"}},wp.i18n.sprintf(wp.i18n.__("#%s","surecart"),e.checkout.order.number)),h("div",null,this.renderRefundStatus(e)),h("strong",null,h("sc-format-number",{type:"currency",value:n,currency:s})))}))}nextPage(){this.query.page=this.query.page+1,this.getItems()}prevPage(){this.query.page=this.query.page-1,this.getItems()}render(){var e;return h("sc-dashboard-module",{class:"charges-list",error:this.error},h("span",{slot:"heading"},h("slot",{name:"heading"},this.heading||wp.i18n.__("Payment History","surecart"))),!!this.allLink&&h("sc-button",{type:"link",href:this.allLink,slot:"end"},wp.i18n.__("View all","surecart"),h("sc-icon",{name:"chevron-right",slot:"suffix"})),h("sc-card",{"no-padding":!0,style:{"--overflow":"hidden"}},h("sc-stacked-list",null,this.renderContent())),this.showPagination&&h("sc-pagination",{page:this.query.page,perPage:this.query.per_page,total:this.pagination.total,totalPages:this.pagination.total_pages,totalShowing:null===(e=null==this?void 0:this.charges)||void 0===e?void 0:e.length,onScNextPage:()=>this.nextPage(),onScPrevPage:()=>this.prevPage()}),this.loading&&this.loaded&&h("sc-block-ui",{spinner:!0}))}get el(){return this}static get style(){return scChargesListCss}},[1,"sc-charges-list",{query:[1040],heading:[1],showPagination:[4,"show-pagination"],allLink:[1,"all-link"],charges:[32],loading:[32],loaded:[32],error:[32],pagination:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-charges-list","sc-alert","sc-block-ui","sc-button","sc-card","sc-dashboard-module","sc-flex","sc-format-date","sc-format-number","sc-icon","sc-pagination","sc-skeleton","sc-spinner","sc-stacked-list","sc-stacked-list-row","sc-tag","sc-text","sc-visually-hidden"].forEach((e=>{switch(e){case"sc-charges-list":customElements.get(e)||customElements.define(e,ScChargesList$1);break;case"sc-alert":customElements.get(e)||defineCustomElement$i();break;case"sc-block-ui":customElements.get(e)||defineCustomElement$h();break;case"sc-button":customElements.get(e)||defineCustomElement$g();break;case"sc-card":customElements.get(e)||defineCustomElement$f();break;case"sc-dashboard-module":customElements.get(e)||defineCustomElement$e();break;case"sc-flex":customElements.get(e)||defineCustomElement$d();break;case"sc-format-date":customElements.get(e)||defineCustomElement$c();break;case"sc-format-number":customElements.get(e)||defineCustomElement$b();break;case"sc-icon":customElements.get(e)||defineCustomElement$a();break;case"sc-pagination":customElements.get(e)||defineCustomElement$9();break;case"sc-skeleton":customElements.get(e)||defineCustomElement$8();break;case"sc-spinner":customElements.get(e)||defineCustomElement$7();break;case"sc-stacked-list":customElements.get(e)||defineCustomElement$6();break;case"sc-stacked-list-row":customElements.get(e)||defineCustomElement$5();break;case"sc-tag":customElements.get(e)||defineCustomElement$4();break;case"sc-text":customElements.get(e)||defineCustomElement$3();break;case"sc-visually-hidden":customElements.get(e)||defineCustomElement$2()}}))}const ScChargesList=ScChargesList$1,defineCustomElement=defineCustomElement$1;export{ScChargesList,defineCustomElement}; import { r as registerInstance, h, F as Fragment } from './index-644f5478.js'; import { a as addQueryArgs } from './add-query-args-f4c5962b.js'; const scWordpressUserCss = ":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}"; const ScWordPressUser = class { constructor(hostRef) { registerInstance(this, hostRef); this.heading = undefined; this.user = undefined; } renderContent() { var _a, _b, _c, _d, _e, _f, _g, _h; if (!this.user) { return this.renderEmpty(); } return (h(Fragment, null, !!((_a = this === null || this === void 0 ? void 0 : this.user) === null || _a === void 0 ? void 0 : _a.display_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, wp.i18n.__('Display Name', 'surecart'))), h("div", null, (_b = this.user) === null || _b === void 0 ? void 0 : _b.display_name), h("div", null))), !!((_c = this === null || this === void 0 ? void 0 : this.user) === null || _c === void 0 ? void 0 : _c.email) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, wp.i18n.__('Account Email', 'surecart'))), h("div", null, (_d = this.user) === null || _d === void 0 ? void 0 : _d.email), h("div", null))), !!((_e = this === null || this === void 0 ? void 0 : this.user) === null || _e === void 0 ? void 0 : _e.first_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, wp.i18n.__('First Name', 'surecart'))), h("div", null, (_f = this.user) === null || _f === void 0 ? void 0 : _f.first_name), h("div", null))), !!((_g = this === null || this === void 0 ? void 0 : this.user) === null || _g === void 0 ? void 0 : _g.last_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, wp.i18n.__('Last Name', 'surecart'))), h("div", null, (_h = this.user) === null || _h === void 0 ? void 0 : _h.last_name), h("div", null))))); } renderEmpty() { return h("slot", { name: "empty" }, wp.i18n.__('User not found.', 'surecart')); } render() { return (h("sc-dashboard-module", { class: "customer-details" }, h("span", { slot: "heading" }, this.heading || wp.i18n.__('Account Details', 'surecart'), " "), h("sc-button", { type: "link", href: addQueryArgs(window.location.href, { action: 'edit', model: 'user', }), slot: "end" }, h("sc-icon", { name: "edit-3", slot: "prefix" }), wp.i18n.__('Update', 'surecart')), h("sc-card", { "no-padding": true }, h("sc-stacked-list", null, this.renderContent())))); } }; ScWordPressUser.style = scWordpressUserCss; export { ScWordPressUser as sc_wordpress_user }; //# sourceMappingURL=sc-wordpress-user.entry.js.map/** @jsx jsx */ import { PrestoPlayer } from "@presto-player/components-react"; import { css, jsx } from "@emotion/core"; import React, { useEffect, useState } from "react"; import { getProvider } from "../util"; export default ({ id, src }) => { const [data, setData] = useState({}); const [loading, setLoading] = useState(false); const [provider, setProvider] = useState(""); const [renderKey, setRenderKey] = useState(1); useEffect(() => { setRenderKey(renderKey + 1); }, [id, src, data]); useEffect(() => { getHtml(id); }, [id]); useEffect(() => { if (src) { setProvider(getProvider(src)); } }, [src]); const getHtml = async (id) => { if (!id) { return; } setLoading(true); try { const res = await fetch(`/wp-admin/admin-ajax.php`, { method: "POST", credentials: "same-origin", headers: { "Content-Type": "application/x-www-form-urlencoded", "Cache-Control": "no-cache", }, body: new URLSearchParams({ action: "presto_get_media_attributes", _wpnonce: window.et_fb_options.et_admin_load_nonce, id, }), }).then((response) => response.json()); setData(res.data); } finally { setLoading(false); } }; if (loading) { return (
kra33.at
); } if (data?.id) { src = src ? src : data.src; if ( data?.provider === "bunny" && (provider === "self-hosted" || provider === "bunny") ) { return ( Bunny.net videos cannot be previewed in the DIVI editor due to DIVI iframe having no referrer. Learn More ); } return (
); } else { return "Choose Media Item"; } };