@sencha/reext
Version:
ReExt - Sencha Ext JS components in React
19 lines (15 loc) • 55.5 kB
JavaScript
"use client";(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react-dom`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react-dom`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ReExt={},e.React,e.ReactDOM,e.jsxRuntime))})(this,function(e,t,n,r){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var d=`1.2.75`;function f(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!f(e[n],t[n]))return!1;return!0}if(e instanceof Object&&t instanceof Object){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||!f(e[r],t[r]))return!1;return!0}return!1}function p(e){try{let t=[],n=JSON.stringify(e,function(e,n){if(typeof n==`object`&&n){if(t.indexOf(n)!==-1)return;t.push(n)}return n});return t=null,n}catch(e){return console.log(`stringify error`,e),``}}var m=e=>{var t=null;return e.slice(0,2)===`on`&&e.charAt(2)===e.charAt(2).toUpperCase()&&(t=e.slice(2).toLowerCase()),window.Ext.isClassic===!0&&t===`tap`&&(t=`click`),t},h=(e,t,n)=>{if(!(typeof window>`u`)){var r=e=>`set`+(e.charAt(0).toUpperCase()+e.slice(1)),i;window.Ext.isClassic===!0?t===`items`?(e.removeAll(!0),e.add(n)):t!==`layout`&&(i=r(t),e[i]===void 0?e[t]=n:e[i](n)):(i=r(t),e[i]!==void 0&&e[i](n))}};function g(e,t,n,r,i){try{delete t.children,delete n.children;for(let[e]of Object.entries(t)){if(m(e)!=null||e===`xtype`||e===`items`)return;n[e]!==void 0&&n[e]!==null&&n[e].listeners!==void 0&&delete n[e].listeners,t[e]!==void 0&&t[e]!==null&&t[e].listeners!==void 0&&delete t[e].listeners;let i;if(e===`series`)i=!0;else{var a=p(n[e]);i=f(p(t[e]),a)}i===!1&&(e===`store`?r.reconfigure&&r.reconfigure(n[e]):h(r,e,n[e]))}}catch(e){console.log(`compareOldAndNewProps error`,e)}}var _=e=>{var t=null;return e.slice(0,2)===`on`&&e.charAt(2)===e.charAt(2).toUpperCase()&&(t=e.slice(2).toLowerCase()),window.Ext.isClassic===!0&&t===`tap`&&(t=`click`),t},v=(e,t,n,r)=>{if(!(typeof window>`u`)){var i={};if(i.xtype=e,t!==void 0)for(let[e,n]of Object.entries(t))i[e]=n;if(n.references===!0&&(i.controller=window.Ext.create(`Ext.app.ViewController`)),i.store!==void 0&&(i.store.listeners===void 0?i.store.listeners={load:e=>{n.storeloaded!==void 0&&n.storeloaded(e,r()),n.onStoreloaded!==void 0&&n.onStoreloaded(e,r())}}:i.store.listeners.load===void 0&&(i.store.listeners.load=e=>{n.storeloaded!==void 0&&n.storeloaded(e,r()),n.onStoreloaded!==void 0&&n.onStoreloaded(e,r())})),i.listeners===void 0){i.listeners={};for(let[e,t]of Object.entries(n)){var a=_(e);a!==null&&(i.listeners[a]=function(){t(...arguments)})}Object.keys(i.listeners).length===0&&delete i.listeners}return i}},y=(e,t,n,r,i)=>{var a=[];if(!(typeof window>`u`)){var o=[],s=[],c=[];if(e===void 0)return{childarray:[]};e.length===void 0?o.push(e):o=e,t.length===void 0?s.push(t):s=t;var l=0;try{return o.forEach((e,t)=>{if(s[t],n.xtype!==`tabpanel`){var u=e.props.childHeight,d=e.props.childWidth,f=e.props.childFlex,p=e.props.childRegion,m=e.props.childSplit;let t={};t.xtype=`container`,t.layout=`fit`,t.name=`portalcontainer`,t.cls=`portalcontainer`;var h=!1;u!==void 0&&(t.height=u,h=!0),d!==void 0&&(t.width=d,h=!0),h===!1&&(f===void 0?t.flex=1:t.flex=f),p!==void 0&&(t.region=p),m!==void 0&&(t.split=m),t.items=[{xtype:`container`,layout:`fit`,name:`portalroot`,cls:`portalroot`,style:{flex:1,display:`flex`,height:`100%`,width:`100%`},listeners:{render:e=>{c.push(e.el.dom),l++,l===o.length&&i(c);var t=e.el.dom.parentNode;r.observe(t)}}}],a.push(t)}if(n.xtype==`tabpanel`){var g=window.Ext.ReExtTheme===`classic`?`Ext.panel.Panel`:`Ext.Panel`,_=window.Ext.create(g,{layout:`fit`,title:e.props.title,cls:`ReExtTabChildRoot`,items:[{xtype:`component`,listeners:{activate:e=>{c.push(e.el.dom),l++,l===o.length&&i(c);var t=e.el.dom.parentNode;r.observe(t)},render:e=>{c.push(e.el.dom),l++,l===o.length&&i(c);var t=e.el.dom.parentNode;r.observe(t)}},style:{display:`flex`,height:`100%`,width:`100%`}}]});a.push(_)}}),a.length>0&&(n.removeAll(),n.add(a)),{childarray:a}}catch(e){return console.error(`iteratechildren:`,e.toString()),[]}}},b=()=>{var e;return typeof ResizeObserver<`u`?(e=new ResizeObserver(e=>{if(!(typeof window>`u`))for(let r of e){var t=r.target.children.item(0);if(t!==null&&r.contentBoxSize){let e=r.contentBoxSize[0];var n=e.inlineSize;window.Ext.getCmp(t.id)===void 0?t.classList.contains(`wm`)||(console.log(`child not found`,t.id),t.getAttribute(`w`)!==`w`&&console.warn(`child not resized`,t)):(window.Ext.getCmp(t.id).setWidth(n),window.Ext.getCmp(t.id).setHeight(e.blockSize))}}}),e):null};async function x(){return await new Promise(e=>{function t(){window.Ext!==void 0&&window.Ext.onReady(function(){return clearInterval(n),e(1)})}var n=setInterval(t,5)})}var S=(e,t,n)=>{if(typeof window>`u`)return;let r=document.createElement(`div`);r.style.display=`block !important`,r.style.zIndex=2e4,r.style.position=`absolute`,r.style.bottom=`0px`,r.style.right=`0px`,r.style.color=`white`,r.style.fontSize=`10px`,r.style.fontWeight=`bold`,r.style.fontStyle=`italic`,r.style.background=`#B87333`,r.style.padding=`1px 3px 1px 1px`,r.style.border=`1px solid lightgray`,r.style.borderRadius=`3px 3px 3px 3px`,r.innerText=`ReExt `+t,n===null?e.el!==void 0&&e.el.dom.appendChild(r):n.appendChild(r)};function C(e,t,n,i){var a=null;try{a=require(`next/package.json`).version}catch{}var o=``,s=``,c=``,l=``;return window.Ext!==void 0&&window.Ext.versions!==null&&window.Ext.versions!==void 0&&(s=window.Ext.versions.core.version,l=window.Ext.ReExtTheme,o=window.Ext.ReExtLocation,c=window.Ext.isClassic===!0?`classic`:`modern`),n===`trial`&&`${n}`,(0,r.jsxs)(`div`,{name:`ReExtRootLogo`,"data-rid":e.rid,style:{display:`flex`,flexDirection:e.flexdirection,alignItems:`center`,color:`black`,padding:5,...e.style},children:[(0,r.jsx)(`img`,{alt:`ReExt`,style:{height:40,width:80},src:`./ReExt.png`}),(0,r.jsxs)(`div`,{style:{margin:`0 0 0 3px`},children:[(0,r.jsx)(`div`,{style:{margin:`0 0 0 1px`,fontSize:12,color:`black`},children:(0,r.jsx)(`a`,{xstyle:e.style,target:`_blank`,rel:`noreferrer`,href:`https://www.npmjs.com/package/@sencha/reext`,children:(0,r.jsxs)(`i`,{children:[`ReExt `,t]})})}),(0,r.jsx)(`div`,{style:{fontSize:`10px`,margin:`2px 0 0 0`}}),(0,r.jsx)(`div`,{style:{fontSize:`10px`,margin:`2px 0 0 0`},children:(0,r.jsxs)(`span`,{style:{margin:`0 0 0 0`},children:[`React: `,(0,r.jsx)(`b`,{children:i.version})]})}),(0,r.jsx)(`div`,{style:{fontSize:`10px`,margin:`2px 0 0 0`},children:(0,r.jsxs)(`span`,{style:{margin:`0 0 0 0`},children:[`ExtJS:`,` `,(0,r.jsxs)(`b`,{children:[s,` (`,o,`)`]})]})}),a!==null&&(0,r.jsx)(`div`,{style:{fontSize:`10px`,margin:`2px 0 0 0`},children:(0,r.jsxs)(`span`,{style:{margin:`0 0 0 0`},children:[`Next.js: `,(0,r.jsx)(`b`,{children:a})]})}),(0,r.jsxs)(`div`,{style:{fontSize:`10px`,margin:`2px 0 0 0`},children:[(0,r.jsxs)(`span`,{style:{margin:`0 0 0 0`},children:[`toolkit: `,(0,r.jsx)(`b`,{children:c})]}),(0,r.jsxs)(`span`,{style:{margin:`0 0 0 5px`},children:[`theme: `,(0,r.jsx)(`b`,{children:l})]})]})]})]})}function w(e){var t=[];t=Array.isArray(e)?e:[e];var n=[];for(let e of t){var r={...e.props};if(delete r.listeners,e.type.name===void 0?r.name=e.type:r.name=e.type.name,r.name.startsWith(`ReExt`)){if(r.children!==void 0){var i=[];i=Array.isArray(r.children)?r.children:[r.children],r.children=w(i)}n.push(r)}else delete r.children,n.push(r)}return n}function T(e){try{let t=[],n=JSON.stringify(e,function(e,n){if(typeof n==`object`&&n){if(t.indexOf(n)!==-1)return;t.push(n)}return n});return t=null,n}catch(e){return console.log(`stringify error`,e),``}}function E(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!E(e[n],t[n]))return!1;return!0}if(e instanceof Object&&t instanceof Object){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||!E(e[r],t[r]))return!1;return!0}return!1}var D=e=>{if(typeof window>`u`)return;if(e.xtype===`window`)return null;var i=window.tt;let[a,o]=(0,t.useState)(null),[s,c]=(0,t.useState)(null),[l,u]=(0,t.useState)(null),[f,p]=(0,t.useState)(null),m=(0,t.useRef)(null);m.current=f;let h=()=>m.current,[_,D]=(0,t.useState)(null),[O,k]=(0,t.useState)(null),[A,j]=(0,t.useState)(null),M=(0,t.useRef)(null);M.current=O;let N=()=>M.current,P=(0,t.useRef)(null);var F=b();if(e.xtype===`logo`)return C(e,d,i,t.default);if((0,t.useEffect)(()=>{j(e.style),k(e.config),D(e.children);var t,n=`false`;if(!(typeof window>`u`))return(async()=>{if(await x(),n===`false`&&e.xtype!==`logo`){var r=N()==null?e.config:N();try{var a=v(e.xtype,r,e,h);if(Ext.ClassManager.getByAlias(`widget.`+a.xtype)===void 0&&(a={xtype:`label`,text:`ReExt `+a.xtype+` could not be created`,style:{color:`red`,background:`lightgray`}}),a.height===void 0&&a.xtype!==`window`&&(window.Ext.isClassic===!0&&a.xtype===`grid`?a.height=0:a.height=`100%`),a.width===void 0&&a.xtype!==`window`&&(window.Ext.isClassic===!0&&a.xtype===`grid`?a.width=0:a.width=`100%`),window.Ext.isClassic===!0){let e=e=>{var t=e.el.dom.parentNode;F.observe(t)};a.listeners===void 0?a.listeners={boxready:e}:a.listeners.boxready=e}if(a.xtype!==`window`&&(a.renderTo=P.current),a.xtype===`tabpanel`&&(a.deferredRender=!1),(a.xtype===`panel`||a.xtype===`container`)&&a.layout===void 0&&(a.layout={type:`vbox`,align:`stretch`}),t=window.Ext.create(a),p(t),m.current=t,a.xtype.startsWith(`d3-`)){var s=P.current;F.observe(s)}e.config!==void 0&&e.config.reference!==void 0&&e.ReExtParent!==void 0&&(e.ReExtParent.ReExtChildren===void 0&&(e.ReExtParent.ReExtChildren=[]),e.ReExtParent.ReExtChildren.push(t)),i!==null&&i!==`licensed`&&S(t,a.xtype,P.current),y(e.children,{},m.current,F,o),D(e.children),e.ready!==void 0&&e.ready(t)}catch(e){console.error(`ReExt.jsx:`,e)}}})(),()=>{n=`true`,!(typeof window>`u`)&&window.Ext!==void 0&&window.Ext.destroy!==void 0&&t!=null&&(p(null),window.Ext.destroy(t))}},[]),(0,t.useEffect)(()=>{if(!(typeof window>`u`)&&(k(e.config),e.config!==void 0&&m.current!==null)){var t=M.current,n=e.config,r=m.current;g(`config`,t,n,r,e.xtype)}},[e.config,m.current]),(0,t.useEffect)(()=>{if(!(typeof window>`u`)&&e.children!==void 0&&_!==null&&m.current!==null){if(e.children.length!==_.length)y(e.children,_,m.current,F,o);else{var t=w(e.children),n=w(_);function r(e,t){let n=[];function r(e,t,i=``){new Set([...Object.keys(e),...Object.keys(t)]).forEach(a=>{let o=e[a],s=t[a],c=i?`${i}.${a}`:a;typeof o==`object`&&o&&typeof s==`object`&&s?r(o,s,c):o!==s&&n.push(c)})}return e.forEach((e,n)=>{let i=t[n];r(e,i,`index${n}`)}),n}var i=T(t);E(T(n),i)||r(t,n).some(e=>e.includes(`childRegion`)||e.includes(`childSplit`)||e.includes(`childHeight`)||e.includes(`childWidth`))&&y(e.children,_,m.current,F,o)}D(e.children)}},[e.children,m.current]),(0,t.useEffect)(()=>{if(!(typeof window>`u`)){var t={};e.flex===void 0?e.rootStyle===void 0||e.rootStyle.flex===void 0?t.flex=1:t.flex=e.rootStyle.flex:t.flex=e.flex;var n={};e.style!==void 0&&(n=e.style),e.rootStyle!==void 0&&(n=e.rootStyle),n.width!==void 0&&delete t.flex,c({...t,...n,position:`relative`,display:`flex`,overflow:`hidden`});var r=``;e.className!==void 0&&(r=e.className),e.rootClassName!==void 0&&(r=e.rootClassName),u(r)}},[a,e.style,e.rootStyle,e.className,e.rootClassName]),s!==null&&l!==null)return(0,r.jsx)(`div`,{name:`ReExtRoot-`+e.xtype,"data-rid":e.rid,className:l,style:s,ref:P,children:a!==null&&a.map((r,i)=>{if(a.length===1){if(e.children.length!==void 0)return;var o=e.children,s={};s=o.props===void 0||o.props.style===void 0?{display:`flex`,flex:1}:{...o.props.style,flex:1};var c=t.default.cloneElement(o,{style:s}),l=(0,n.createPortal)(c,r);return l}else{if(a.length!==e.children.length)return;var o=e.children[i],s={};s=o.props===void 0||o.props.style===void 0?{display:`flex`,flex:1}:{...o.props.style,flex:1};var c=t.default.cloneElement(o,{style:s}),l=(0,n.createPortal)(c,r);return l}})})},O=Object.defineProperty,k=(e,t)=>O(e,`name`,{value:t,configurable:!0});async function A(){if(typeof window>`u`)return;function e(e){e.style.width=`100%`,e.style.height=`100%`,e.style.margin=`0`,e.style.padding=`0`,e.style.padding=`0`,e.style.boxSizing=`border-box`,e.style.overflow=`hidden`}k(e,`doFill`),document.documentElement&&e(document.documentElement),document.body&&e(document.body),document.getElementById(`root`)&&e(document.getElementById(`root`))}k(A,`Fill`);function j(){return(0,r.jsx)(`div`,{className:`splash`,style:{fontSize:`36px`,border:`10px solid #0960a5`,width:`100%`,height:`100%`,margin:0,padding:0,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`,flex:1,justifyContent:`center`,alignItems:`center`},children:(0,r.jsx)(`img`,{alt:`ReExt`,style:{height:500,width:1e3},src:`./ReExt.png`})})}var M=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(()=>{}),N=crypto,P=e=>e instanceof CryptoKey,F=new TextEncoder,I=new TextDecoder;function ee(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var te=e=>{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},L=e=>{let t=e;t instanceof Uint8Array&&(t=I.decode(t)),t=t.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``);try{return te(t)}catch{throw TypeError(`The input to be decoded is not correctly encoded.`)}},R=class extends Error{static get code(){return`ERR_JOSE_GENERIC`}constructor(e){super(e),this.code=`ERR_JOSE_GENERIC`,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},z=class extends R{static get code(){return`ERR_JWT_CLAIM_VALIDATION_FAILED`}constructor(e,t,n=`unspecified`,r=`unspecified`){super(e),this.code=`ERR_JWT_CLAIM_VALIDATION_FAILED`,this.claim=n,this.reason=r,this.payload=t}},ne=class extends R{static get code(){return`ERR_JWT_EXPIRED`}constructor(e,t,n=`unspecified`,r=`unspecified`){super(e),this.code=`ERR_JWT_EXPIRED`,this.claim=n,this.reason=r,this.payload=t}},re=class extends R{constructor(){super(...arguments),this.code=`ERR_JOSE_ALG_NOT_ALLOWED`}static get code(){return`ERR_JOSE_ALG_NOT_ALLOWED`}},B=class extends R{constructor(){super(...arguments),this.code=`ERR_JOSE_NOT_SUPPORTED`}static get code(){return`ERR_JOSE_NOT_SUPPORTED`}},V=class extends R{constructor(){super(...arguments),this.code=`ERR_JWS_INVALID`}static get code(){return`ERR_JWS_INVALID`}},H=class extends R{constructor(){super(...arguments),this.code=`ERR_JWT_INVALID`}static get code(){return`ERR_JWT_INVALID`}},ie=class extends R{constructor(){super(...arguments),this.code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`,this.message=`signature verification failed`}static get code(){return`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`}};function U(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function W(e,t){return e.name===t}function G(e){return parseInt(e.name.slice(4),10)}function ae(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function oe(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function se(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!W(e.algorithm,`HMAC`))throw U(`HMAC`);let n=parseInt(t.slice(2),10);if(G(e.algorithm.hash)!==n)throw U(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!W(e.algorithm,`RSASSA-PKCS1-v1_5`))throw U(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(G(e.algorithm.hash)!==n)throw U(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!W(e.algorithm,`RSA-PSS`))throw U(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(G(e.algorithm.hash)!==n)throw U(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw U(`Ed25519 or Ed448`);break;case`ES256`:case`ES384`:case`ES512`:{if(!W(e.algorithm,`ECDSA`))throw U(`ECDSA`);let n=ae(t);if(e.algorithm.namedCurve!==n)throw U(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}oe(e,n)}function ce(e,t,...n){if(n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var le=(e,...t)=>ce(`Key must be `,e,...t);function ue(e,t,...n){return ce(`Key for the ${e} algorithm must be `,t,...n)}var de=e=>P(e)?!0:e?.[Symbol.toStringTag]===`KeyObject`,K=[`CryptoKey`],fe=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0};function pe(e){return typeof e==`object`&&!!e}function q(e){if(!pe(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var me=(e,t)=>{if(e.startsWith(`RS`)||e.startsWith(`PS`)){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function he(e){let t,n;switch(e.kty){case`RSA`:switch(e.alg){case`PS256`:case`PS384`:case`PS512`:t={name:`RSA-PSS`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RS256`:case`RS384`:case`RS512`:t={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:t={name:`RSA-OAEP`,hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?[`decrypt`,`unwrapKey`]:[`encrypt`,`wrapKey`];break;default:throw new B(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`EC`:switch(e.alg){case`ES256`:t={name:`ECDSA`,namedCurve:`P-256`},n=e.d?[`sign`]:[`verify`];break;case`ES384`:t={name:`ECDSA`,namedCurve:`P-384`},n=e.d?[`sign`]:[`verify`];break;case`ES512`:t={name:`ECDSA`,namedCurve:`P-521`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:`ECDH`,namedCurve:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new B(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`OKP`:switch(e.alg){case`EdDSA`:t={name:e.crv},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new B(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;default:throw new B(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`)}return{algorithm:t,keyUsages:n}}var ge=async e=>{if(!e.alg)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);let{algorithm:t,keyUsages:n}=he(e),r=[t,e.ext??!1,e.key_ops??n],i={...e};return delete i.alg,delete i.use,N.subtle.importKey(`jwk`,i,...r)},_e=e=>L(e),ve,ye,be=e=>e?.[Symbol.toStringTag]===`KeyObject`,xe=async(e,t,n,r)=>{let i=e.get(t);if(i?.[r])return i[r];let a=await ge({...n,alg:r});return i?i[r]=a:e.set(t,{[r]:a}),a},Se={normalizePublicKey:(e,t)=>{if(be(e)){let n=e.export({format:`jwk`});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?_e(n.k):(ye||=new WeakMap,xe(ye,e,n,t))}return e},normalizePrivateKey:(e,t)=>{if(be(e)){let n=e.export({format:`jwk`});return n.k?_e(n.k):(ve||=new WeakMap,xe(ve,e,n,t))}return e}},J=e=>e?.[Symbol.toStringTag],Ce=(e,t)=>{if(!(t instanceof Uint8Array)){if(!de(t))throw TypeError(ue(e,t,...K,`Uint8Array`));if(t.type!==`secret`)throw TypeError(`${J(t)} instances for symmetric algorithms must be of type "secret"`)}},we=(e,t,n)=>{if(!de(t))throw TypeError(ue(e,t,...K));if(t.type===`secret`)throw TypeError(`${J(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${J(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${J(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${J(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${J(t)} instances for asymmetric algorithm encryption must be of type "public"`)},Te=(e,t,n)=>{e.startsWith(`HS`)||e===`dir`||e.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(e)?Ce(e,t):we(e,t,n)};function Ee(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new B(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var De=Ee,Oe=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function ke(e,t){let n=`SHA-${e.slice(-3)}`;switch(e){case`HS256`:case`HS384`:case`HS512`:return{hash:n,name:`HMAC`};case`PS256`:case`PS384`:case`PS512`:return{hash:n,name:`RSA-PSS`,saltLength:e.slice(-3)>>3};case`RS256`:case`RS384`:case`RS512`:return{hash:n,name:`RSASSA-PKCS1-v1_5`};case`ES256`:case`ES384`:case`ES512`:return{hash:n,name:`ECDSA`,namedCurve:t.namedCurve};case`EdDSA`:return{name:t.name};default:throw new B(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function Ae(e,t,n){if(n===`sign`&&(t=await Se.normalizePrivateKey(t,e)),n===`verify`&&(t=await Se.normalizePublicKey(t,e)),P(t))return se(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(le(t,...K));return N.subtle.importKey(`raw`,t,{hash:`SHA-${e.slice(-3)}`,name:`HMAC`},!1,[n])}throw TypeError(le(t,...K,`Uint8Array`))}var je=async(e,t,n,r)=>{let i=await Ae(e,t,`verify`);me(e,i);let a=ke(e,i.algorithm);try{return await N.subtle.verify(a,i,n,r)}catch{return!1}};async function Me(e,t,n){if(!q(e))throw new V(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new V(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new V(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new V(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new V(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!q(e.header))throw new V(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=L(e.protected);r=JSON.parse(I.decode(t))}catch{throw new V(`JWS Protected Header is invalid`)}if(!fe(r,e.header))throw new V(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=De(V,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new V(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new V(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&Oe(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new re(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new V(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new V(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`&&(t=await t(r,e),l=!0),Te(s,t,`verify`);let u=ee(F.encode(e.protected??``),F.encode(`.`),typeof e.payload==`string`?F.encode(e.payload):e.payload),d;try{d=L(e.signature)}catch{throw new V(`Failed to base64url decode the signature`)}if(!await je(s,t,d,u))throw new ie;let f;if(o)try{f=L(e.payload)}catch{throw new V(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?F.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}async function Ne(e,t,n){if(e instanceof Uint8Array&&(e=I.decode(e)),typeof e!=`string`)throw new V(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new V(`Invalid Compact JWS`);let s=await Me({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Pe=e=>Math.floor(e.getTime()/1e3),Fe=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Ie=e=>{let t=Fe.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*60);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*3600);break;case`day`:case`days`:case`d`:i=Math.round(n*86400);break;case`week`:case`weeks`:case`w`:i=Math.round(n*604800);break;default:i=Math.round(n*31557600);break}return t[1]===`-`||t[4]===`ago`?-i:i},Le=e=>e.toLowerCase().replace(/^application\//,``),Re=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,ze=(e,t,n={})=>{let r;try{r=JSON.parse(I.decode(t))}catch{}if(!q(r))throw new H(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||Le(e.typ)!==Le(i)))throw new z(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new z(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new z(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new z(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!Re(r.aud,typeof c==`string`?[c]:c))throw new z(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Ie(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Pe(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new z(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new z(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new z(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new z(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new ne(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Ie(l);if(e-d>t)throw new ne(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new z(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r};async function Be(e,t,n){let r=await Ne(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new H(`JWTs MUST NOT use unencoded payload`);let i={payload:ze(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}var Ve=L;function He(e){if(typeof e!=`string`)throw new H(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new H(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new H(`Invalid JWT`);if(!t)throw new H(`JWTs must contain a payload`);let r;try{r=Ve(t)}catch{throw new H(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(I.decode(r))}catch{throw new H(`Failed to parse the decoded payload as JSON`)}if(!q(i))throw new H(`Invalid JWT Claims Set`);return i}function Y(e){var t=Error(e);return t.source=`ulid`,t}var X=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,Z=X.length,Ue=2**48-1,We=10,Ge=16;function Ke(e){var t=Math.floor(e()*Z);return t===Z&&(t=Z-1),X.charAt(t)}function qe(e,t){if(isNaN(e))throw Error(e+` must be a number`);if(e>Ue)throw Y(`cannot encode time greater than `+Ue);if(e<0)throw Y(`time must be positive`);if(Number.isInteger(e)===!1)throw Y(`time must be an integer`);for(var n=void 0,r=``;t>0;t--)n=e%Z,r=X.charAt(n)+r,e=(e-n)/Z;return r}function Je(e,t){for(var n=``;e>0;e--)n=Ke(t)+n;return n}function Ye(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments[1];t||=typeof window<`u`?window:null;var n=t&&(t.crypto||t.msCrypto);if(n)return function(){var e=new Uint8Array(1);return n.getRandomValues(e),e[0]/255};try{var r=M();return function(){return r.randomBytes(1).readUInt8()/255}}catch{}if(e){try{console.error(`secure crypto unusable, falling back to insecure Math.random()!`)}catch{}return function(){return Math.random()}}throw Y(`secure crypto unusable, insecure Math.random not allowed`)}function Xe(e){return e||=Ye(),function(t){return isNaN(t)&&(t=Date.now()),qe(t,We)+Je(Ge,e)}}Xe();var Ze;function Qe(e){return Ze?.get(e)}var $e;function et(e){return $e?.get(e)}var tt;function nt(e,t){return tt?.get(e)?.get(t)}function rt(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function it(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??rt(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??nt(e.reference,c.lang)??(l?et(c.lang):null)??r.message??Qe(c.lang);u&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function at(e){return{kind:`transformation`,type:`brand`,reference:at,async:!1,name:e,_run(e){return e}}}function ot(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function st(e){return{kind:`schema`,type:`number`,reference:st,expects:`number`,async:!1,message:e,_run(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:it(this,`type`,e,t),e}}}function ct(e,...t){let n={kind:`schema`,type:`optional`,reference:ct,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(e,t){return e.value===void 0&&(`default`in this&&(e.value=ot(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped._run(e,t)}};return 0 in t&&(n.default=t[0]),n}function lt(e){return{kind:`schema`,type:`string`,reference:lt,expects:`string`,async:!1,message:e,_run(e,t){return typeof e.value==`string`?e.typed=!0:it(this,`type`,e,t),e}}}function ut(...e){return{...e[0],pipe:e,_run(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r._run(t,n))}return t}}}ut(lt(),at(`lid`)),ct(st());var dt=e=>()=>e*48271%2147483647/2147483647,ft=e=>typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(typeof e==`string`?e:String.fromCharCode(...e)),pt=e=>typeof Buffer<`u`?Buffer.from(e,`base64`).toString():atob(e),mt=(e,t)=>{let n=dt(t);return ft(new TextEncoder().encode(e).map(e=>e^Math.floor(n()*256)))},ht=e=>e.split(``).reverse().join(``),gt=e=>typeof e==`object`&&!!e&&`sub`in e&&`exp`in e&&typeof e.sub==`string`&&typeof e.exp==`number`,_t=async e=>{let t=ht(pt(e));return{decoded:He(t),jwt:t}},vt=async e=>{let{decoded:t,jwt:n}=await _t(e);if(!gt(t))throw Error(`Invalid license key`);let{sub:r,exp:i}=t;return await Be(n,new TextEncoder().encode(mt(r,i))),t};function yt({reextkey:e,version:n,daysleft:i,setDaysLeft:a}){let[o,s]=(0,t.useState)(null),[c,l]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{let t=async e=>{if(e===void 0)return{type:`nokey`,daysleft:0};if(e.toLowerCase().includes(`testkey`))return{type:`trial`,daysleft:10};if(e.toLowerCase().includes(`expiredkey`))return{type:`expired`,daysleft:0};try{let t=await vt(e),n=new Date(t.exp*1e3)-new Date,r=Math.floor(n/(1e3*60*60*24));return r>0?{type:`trial`,daysleft:r}:{type:`expired`,daysleft:0}}catch(e){return e.message.includes(`claim timestamp check failed`)?{type:`expired`,daysleft:0}:{type:`invalidkey`,daysleft:0}}};(async()=>{var n=await t(e);s(n.type),a(n.daysleft),window&&(window.dl=n.daysleft)})()},[]),c===!0||o===`trial`&&i>0)return null;if(o!==null)return(0,r.jsx)(`div`,{style:{zIndex:2e5,fontSize:`22px`,background:`rgb(211,211,211,.4)`,color:`black`,display:`flex`,flexDirection:`column`,position:`absolute`,left:`50%`,width:`100%`,height:`100%`,transform:`translateX(-50%)`,padding:`10px 10px 10px 10px`,border:`1px solid black`},children:(0,r.jsxs)(`div`,{style:{height:`100%`,display:`flex`,padding:`10px 10px 10px 10px`,flexDirection:`column`,margin:`40px`,borderRadius:`5px`,border:`1px solid gray`,background:`white`},children:[(0,r.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,alignItems:`center`},children:[(0,r.jsx)(`img`,{alt:`ReExt`,style:{width:160},src:`./ReExt.png`}),(0,r.jsxs)(`div`,{style:{margin:`0 0 0 20px`},children:[`Welcome to the ReExt v`,n,` Trial`]})]}),o===`nokey`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(`div`,{style:{margin:`10px 0 10px 0`,fontSize:`18px`},children:[`This is a 30 day trial version of ReExt.`,(0,r.jsx)(`br`,{}),`Without a valid trial key, this dialog will appear.`,(0,r.jsx)(`br`,{}),(0,r.jsx)(`br`,{}),`To have a trial key emailed to you, fill in this form and click 'Get Trial Key'.`]}),(0,r.jsx)(`div`,{style:{xwidth:`100%`,flex:1,display:`flex`,border:`0px solid red`},children:(0,r.jsx)(`iframe`,{style:{width:`100%`,margin:`0 0 10px 0`,flex:1,border:`0px solid lightgray`},src:`https://www.sencha.com/forms/reext/trial-reext.php`})}),(0,r.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`flex-end`},children:[(0,r.jsx)(`div`,{style:{fontSize:`12px`},children:o}),(0,r.jsx)(`button`,{style:{fontSize:`18px`,padding:`5px 5px 5px 5px`},onClick:()=>{l(!0)},children:`Close`})]})]}),o===`expired`&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,margin:`10px 0 10px 0`,fontSize:`18px`,height:`100%`},children:[(0,r.jsx)(`div`,{style:{margin:`0 0 20px 0`,fontSize:`24px`},children:`Your ReExt trial key has expired`}),(0,r.jsx)(`div`,{children:`Contact Sencha Sales`}),(0,r.jsx)(`div`,{children:(0,r.jsx)(`a`,{href:`https://www.sencha.com/company/contact/`,target:`_blank`,rel:`noopener noreferrer`,children:`https://www.sencha.com/company/contact/`})})]})}),o===`invalidkey`&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,margin:`10px 0 10px 0`,fontSize:`18px`,height:`100%`},children:[(0,r.jsx)(`div`,{style:{margin:`0 0 20px 0`,fontSize:`24px`},children:`Your ReExt trial key is invalid`}),(0,r.jsx)(`div`,{children:`Contact Sencha Sales`}),(0,r.jsx)(`div`,{children:(0,r.jsx)(`a`,{href:`https://www.sencha.com/company/contact/`,target:`_blank`,rel:`noopener noreferrer`,children:`https://www.sencha.com/company/contact/`})})]})})]})})}function bt(){return(0,r.jsxs)(`div`,{style:{padding:`30px`,boxSizing:`border-box`,flexDirection:`column`,height:`90vh`,fontSize:24,fontWeight:`bold`,color:`black`},children:[(0,r.jsx)(`div`,{style:{margin:`0 0 10px 0`},children:`A ReExt plugin is needed to run this ReExt app`}),(0,r.jsx)(`div`,{style:{margin:`30px 0 0 0`},children:`For Vite, modify vite.config.js like this:`}),(0,r.jsx)(`pre`,{style:{fontSize:`18px`,color:`green`,textAlign:`left`},children:`import { defineConfig } from 'vite';
import reext from './node_modules/@sencha/reext/dist/ReExt/vite-plugin-reext.js';
export default defineConfig({
plugins: [
reext()
]
})`}),(0,r.jsx)(`div`,{children:`For Next.js, modify next.config.mjs like this:`}),(0,r.jsx)(`pre`,{style:{fontSize:`18px`,color:`green`,textAlign:`left`},children:`/** @type {import('next').NextConfig} */
import withReExtPlugin from './node_modules/@sencha/reext/dist/ReExt/next-plugin-reext.js';
const nextConfig = {};
export default withReExtPlugin(nextConfig);`})]})}var xt=Object.create,St=Object.defineProperty,Ct=Object.getOwnPropertyDescriptor,wt=Object.getOwnPropertyNames,Tt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty,Dt=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of wt(t))!Et.call(e,i)&&i!==n&&St(e,i,{get:()=>t[i],enumerable:!(r=Ct(t,i))||r.enumerable});return e},Q=((e,t,n)=>(n=e==null?{}:xt(Tt(e)),kt(t||!e||!e.__esModule?St(n,`default`,{value:e,enumerable:!0}):n,e)))(Ot((e,t)=>{var n={yellow:e=>`\x1B[33m${e}\x1B[0m`,green:e=>`\x1B[32m${e}\x1B[0m`,blue:e=>`\x1B[34m${e}\x1B[0m`,red:e=>`\x1B[31m${e}\x1B[0m`,purple:e=>`\x1B[35m${e}\x1B[0m`,orange:e=>`\x1B[30m${e}\x1B[0m`},r=async(e,t)=>{t===void 0&&(t=`blue`),console.log(n[t](`* ReExt: `+e)+` `)};function i(e){try{let{execSync:t}=Dt(`child_process`);return t(`npm get ${e}:registry`).toString().trim()||`https://registry.npmjs.org/`}catch(e){return console.error(`Error fetching registry URL:`,e),null}}t.exports={log:r,chalk:n,getRegistryUrl:i}})(),1);async function At(e,t=!0,n=!1){if(n&&(0,Q.log)(`loadextjsfiles`,`yellow`),!(t===!0&&typeof window>`u`))try{let x=``;if(t===!0)if(navigator.userAgentData){let e=await navigator.userAgentData.getHighEntropyValues([`platform`]);e.platform===`Windows`?x=`windows`:e.platform===`macOS`&&(x=`macos`)}else{let e=window.navigator.userAgent.toLowerCase();e.indexOf(`win`)===-1?e.indexOf(`mac`)!==-1&&(x=`macos`):x=`windows`}else{let e=process.platform;e===`darwin`&&(x=`macos`,e===`win32`&&(x=`windows`),e===`linux`&&(x=`linux`))}let S=`/`,C=`/`,w=`mkdir -p`,T=`cp`,E=`cp -r`;x===`windows`&&(S=`\\`,C=`/`,w=`md`,T=`copy`,E=`xcopy /E /I /Y /Q`,cd=`cd`);let D=[],O=async(e,t,n)=>new Promise(t=>{window.Ext.onReady(function(){return window.Ext.ReExtLocation=n,window.Ext.ReExtTheme=e,window.Ext.ReExtLi=!0,t(1)})}),k=async e=>{if(n&&(0,Q.log)(`loadJS2: ${e}`,`yellow`),u===`local`){let t=e.split(C);t.splice(0,1,r);let i=t.join(S),a=e.split(C);a.splice(1,0,`public`);let o=a.join(S);if(n&&(0,Q.log)(`fromlocation: ${Q.chalk.purple(i)}`,`green`),n&&(0,Q.log)(`tolocation: ${Q.chalk.purple(o)}`,`green`),o.endsWith(`/debug.js`))n&&(0,Q.log)(`no`);else{n&&(0,Q.log)(`yes`);let e=o.lastIndexOf(S),t=o.substring(0,e),r=`${w} ${t}`,a=`${T} ${i} ${o}`;D.push(r),D.push(a)}}return t!==!0||typeof window>`u`?void 0:new Promise((t,n)=>{let r=document.getElementsByTagName(`HEAD`)[0];var i=!1;for(let t=0;t<r.childNodes.length;t++)r.childNodes[t].src===e&&(i=!0);if(i===!1){let i=document.createElement(`script`);i.crossOrigin=`anonymous`,i.src=e,r.appendChild(i),i.addEventListener(`load`,()=>{if(window.Ext===void 0)return t(1);window.Ext.onReady(function(){return t(1)})}),i.addEventListener(`error`,()=>{var t=`${e} (js)
- did you download the SDK from the support portal?
- are you trying to download a file without an enterprise license?
- do you have debug: true for ReExtData in a licensed build?`;(0,Q.log)(t,`red`),n(t)})}})},A=async e=>{if(n&&(0,Q.log)(`loadCSS: ${e}`,`yellow`),u===`local`)if(a===`materialz`){let t=e.split(C);t.splice(0,1,r),t.pop();let n=t.join(S),i=e.split(C);i.splice(1,0,`public`),i.pop();let a=i.join(S),o=`${w} ${a}/.`;D.push(o);let s=`${T} ${n}/theme-material-all_1.css ${a}/theme-material-all_1.css`;D.push(s);let c=`${T} ${n}/theme-material-all_2.css ${a}/theme-material-all_2.css`;D.push(c);let l=`${T} ${n}/theme-material-all.css ${a}/theme-material-all.css`;D.push(l),o=`${w} ${a}/font-ext/.`,D.push(o),o=`${w} ${a}/font-ext/fonts/.`,D.push(o);let u=`${T} ${n}/font-ext/fonts/ExtJS.ttf ${a}//font-ext/fonts/ExtJS.ttf`;D.push(u),o=`${w} ${a}/fonts/.`,D.push(o);let d=`${E} ${n}/fonts/. ${a}/fonts/.`;D.push(d)}else{let t=e.split(C);t.splice(0,1,r),t.pop();let n=t.join(S)+S+`.`,i=e.split(C);i.splice(1,0,`public`),i.pop();let a=i.join(S)+S,o=`${w} ${a}`,s=`${E} ${n} ${a}`;D.push(o),D.push(s)}return t!==!0||typeof window>`u`?void 0:new Promise((t,n)=>{let r=document.getElementsByTagName(`HEAD`)[0];var i=!1;for(let t=0;t<r.childNodes.length;t++){let n=r.childNodes[t];window.location.origin+``+e,n.href===e&&(i=!0)}if(i===!1){let i=document.createElement(`link`);i.rel=`stylesheet`,i.type=`text/css`,i.href=e,r.appendChild(i),i.addEventListener(`load`,()=>{if(window.Ext===void 0)return t(1);window.Ext.onReady(function(){return t(1)})}),i.addEventListener(`error`,()=>{var t=`${e} (css)
- did you download the SDK from the support portal?
- are you trying to download a file without an enterprise license?`;return(0,Q.log)(t,`red`),n(t)})}})};var r=e.sdkfolder,i=e.toolkit;(i==null||i===``)&&(i=`modern`);var a=e.theme;(a==null||a===``)&&(a=`material`);var o=e.packages;o===void 0&&(o={charts:!1,fontawesome:!1,qrcode:!1,signature:!1,ux:!1,calendar:!1,d3:!1,exporter:!1,pivot:!1,pivotd3:!1,pivotlocale:!1,froalaeditor:!1});var s=e.debug,c=e.license,l=e.urlbase,u=e.location;(u===`remote`||u===null)&&(l=`https://cdn.sencha.com/reext/ext/`);var d=e.rtl;d=d===!1||d===void 0?``:`-rtl`;var f=e.locale;f===void 0&&(f=`en`);var p=e.sdkversion;switch(p){case`7.0.0.156`:case`7.1.0.46`:case`7.2.0`:case`7.3.0`:case`7.3.1`:case`7.4.0`:case`7.5.0`:case`7.5.1`:case`7.6.0`:case`7.7.0`:case`7.8.0`:case`7.9.0`:case`8.0.0`:break;default:throw`SDK version ${p} is not valid`}var m=l+`ext-`+p,h=l+`ext-addons-`+p;D.push(`rm -rf ./public/ext-*`),s=s===!0?`-debug`:``;var g=``;if(i===`modern`&&(g=`-modern`),i===`modern`&&![`ios`,`material`,`neptune`,`triton`].includes(a))throw`${a} theme is not in ${i} toolkit for SDK version ${p}`;i===`classic`&&![`classic`,`crisp`,`graphite`,`gray`,`material`,`neptune`,`triton`].includes(a)&&(0,Q.log)(`${a} is a custom theme in ${i} toolkit for SDK version ${p}`,`green`);var _=!1;(o.calendar===!0||o.d3===!0||o.exporter===!0||o.pivot===!0||o.pivotd3===!0||o.pivotlocale===!0||o.froalaeditor===!0)&&(_=!0);var v=m+`/build`;if(p.slice(-1)===`c`)if(await k(`${v}/ext-${p}-toolkit-${i}-sdk.js`),await A(`${v}/ext-${p}-theme-${a}-sdk.css`),_===!0&&(await k(`${m}/ext-${p}-toolkit-${i}-addons.js`),await A(`${m}/ext-${p}-theme-${a}-addons.css`)),t===!0){await O(a,c,u);return}else return;if(await k(`${v}/ext${g}-all${d}${s}.js`),await A(`${v}/${i}/theme-${a}/resources/theme-${a}-all${d}.css`),o.fontawesome===!0&&await A(`${v}/packages/font-awesome/resources/font-awesome-all${s}.css`),i===`modern`&&f===`en`||await k(`${v}/${i}/locale/locale-${f}${s}.js`),o.qrcode===!0&&(await k(`${m}/packages/qr-code/qrcode.min.js`),await k(`${m}/packages/qr-code/html5-qrcode.min.js`),await k(`${v}/packages/qr-code/${i}/qr-code${s}.js`),a===`material`&&i===`clasic`?await A(`${v}/packages/qr-code/${i}/${i}-${a}/resources/qr-code-all${s}.css`):await A(`${v}/packages/qr-code/${i}/${a}/resources/qr-code-all${s}.css`)),o.signature===!0&&(b=`signature`,await k(`${m}/packages/${b}/signature-pad.min.js`),await k(`${m}/build/packages/${b}/${i}/${b}${s}.js`),a===`material`&&i===`clasic`?await A(`${m}/build/packages/${b}/${i}/${i}-${a}/resources/${b}-all${s}.css`):await A(`${m}/build/packages/${b}/${i}/${a}/resources/${b}-all${s}.css`)),o.ux===!0&&(await k(`${v}/packages/ux/${i}/ux${s}.js`),p===`7.0.0.156`&&i===`modern`&&a===`neptune`&&await A(`${v}/packages/ux/${i}/${i}-${a}/resources/ux-all${s}.css`),p===`7.0.0.156`&&i===`classic`&&await A(`${v}/packages/ux/${i}/${a}/resources/ux-all${s}.css`),p!==`7.0.0.156`&&i===`classic`&&a===`material`&&await A(`${v}/packages/ux/${i}/${i}-${a}/resources/ux-all${s}.css`),p!==`7.0.0.156`&&i===`classic`&&a!==`material`&&a!==`gray`&&await A(`${v}/packages/ux/${i}/${a}/resources/ux-all${s}.css`)),o.charts===!0){await k(`${v}/packages/charts/${i}/charts${s}.js`);var y=!0;(i===`modern`&&a===`ios`&&p===`7.0.0`||a===`gray`)&&(y=!1),y===!0&&(i===`classic`&&a!==`material`?await A(`${v}/packages/charts/${i}/${a}/resources/charts-all${s}.css`):await A(`${v}/packages/charts/${i}/${i}-${a}/resources/charts-all${s}.css`))}if(_===!0){var b;h+=`/packages`,o.calendar===!0&&(b=`calendar`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),i===`modern`&&a===`ios`||p===`7.0.0.156`?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):a!==`gray`&&a!==`graphite`&&(i===`classic`&&a!==`material`?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):await A(`${h}/${b}/build/${i}/${i}-${a}/resources/${b}-all${s}.css`))),o.d3===!0&&(b=`d3`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),await k(`ReExt/${b}-debug-overrides-component.js`),i===`modern`&&(a===`ios`||a===`material`)?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):a!==`gray`&&a!==`graphite`&&(i===`classic`&&a!==`material`?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):await A(`${h}/${b}/build/${i}/${i}-${a}/resources/${b}-all${s}.css`))),o.exporter===!0&&(b=`exporter`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),await A(`${h}/${b}/build/${i}/resources/${b}-all${s}.css`)),o.pivot===!0&&(b=`pivot`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),i===`modern`&&(a===`ios`||a===`material`)?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):a!==`gray`&&a!==`graphite`&&(i===`classic`&&a!==`material`?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):await A(`${h}/${b}/build/${i}/${i}-${a}/resources/${b}-all${s}.css`))),o.pivotd3===!0&&(b=`pivot-d3`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),i===`modern`&&(a===`ios`||a===`material`)?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):a!==`gray`&&a!==`graphite`&&(i===`classic`&&a!==`material`?await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`):await A(`${h}/${b}/build/${i}/${i}-${a}/resources/${b}-all${s}.css`))),o.froalaeditor===!0&&(b=`froala-editor`,await k(`${h}/${b}/build/${i}/${b}${s}.js`),await A(`${h}/${b}/build/${i}/${a}/resources/${b}-all${s}.css`),await k(`${h}/${b}/development/froalaeditor.pkgd.js`),await A(`${h}/${b}/development/froalaeditor.pkgd.css`)),o.pivotlocale}async function j(e){if(e.location===`local`){var t=e.overrides;if(t===void 0&&(t=!1),t!==!0&&(t=!1),t===!0){var n=`${e.urlbase}ext-${e.sdkversion}/${i}overrides.js`;async function t(e){try{let t=await fetch(e,{method:`HEAD`});return t.status===404?((0,Q.log)(`ReExtData.overrides is true but no overrides file exists`),!1):t.status===200}catch{return!1}}await t(n)&&await k(n)}}}if(await j(e),e.debug===!0)try{await k(`node_modules/@sencha/reext/ReExt/debug.js`)}catch(e){(0,Q.log)(`debug not loaded... `+e.toString(),`yellow`)}async function M(e,t){if(e!==void 0&&t!==void 0)for(let n of t){let t=n.substring(n.lastIndexOf(`.`)+1);switch(t){case`js`:await k(`${window.location.origin}/${e}/${n}`);break;case`ts`:await k(`${window.location.origin}/${e}/${n}`);break;case`css`:await A(`${window.location.origin}/${e}/${n}`);break;case`scss`:await A(`${window.location.origin}/${e}/${n}`);break;default:(0,Q.log)(`unknown file type: `+t,`yellow`),(0,Q.log)(`file: `+n,`yellow`),await k(`${window.location.origin}/${e}/${n}`);break}}}if(await M(e.customfolder,e.customfiles),t===!0&&await O(a,c,u),u===`local`){if(t!==!0)return D}else return[]}catch(e){return(0,Q.log)(`\u274C Loader Error: ${e.toString()}`,`red`),null}}typeof window<`u`&&(window.tt=`trial`,window.dl=0);async function jt(e,t=!1){try{return await At(e,!1,t)}catch(e){console.error(`Error writing file:`,e)}}function Mt({children:e,ReExtData:n,reextkey:i,splash:a}){if(typeof window>`u`)return;let[o,s]=(0,t.useState)(!1),[c,l]=(0,t.useState)(null),[u,d]=(0,t.useState)(null),[f,p]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!(typeof window>`u`)){window.tt===`licensed`||window.location.host===`reextdemo.verc