maze-blockly-wrapper 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockly-CB1haBOu.cjs +329 -0
- package/dist/blockly-CB1haBOu.cjs.map +1 -0
- package/dist/blockly-D9trJ_x0.js +329 -0
- package/dist/blockly-D9trJ_x0.js.map +1 -0
- package/dist/blockly_compressed-Bdba50O4.js +21043 -0
- package/dist/{blockly_compressed-L5h4evQZ.js.map → blockly_compressed-Bdba50O4.js.map} +1 -1
- package/dist/blockly_compressed-DKwMdvF1.cjs +21042 -0
- package/dist/{blockly_compressed-BZraWoMC.cjs.map → blockly_compressed-DKwMdvF1.cjs.map} +1 -1
- package/dist/blocks-B05dnyOn.js +1707 -0
- package/dist/{blocks-DNGprLHy.js.map → blocks-B05dnyOn.js.map} +1 -1
- package/dist/blocks-BabbRNKU.cjs +1707 -0
- package/dist/{blocks-C4L357Lk.cjs.map → blocks-BabbRNKU.cjs.map} +1 -1
- package/dist/components/maze/MazeGame.d.ts +1 -0
- package/dist/index-C2TQzLih.js +5038 -0
- package/dist/{index-Kkc2CBjJ.js.map → index-C2TQzLih.js.map} +1 -1
- package/dist/index-CeTmKa8Y.cjs +5053 -0
- package/dist/{index-CRP4KubC.cjs.map → index-CeTmKa8Y.cjs.map} +1 -1
- package/dist/index.cjs.js +34 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +32 -32
- package/dist/javascript-B767_urL.js +969 -0
- package/dist/{javascript-BdBscNU_.js.map → javascript-B767_urL.js.map} +1 -1
- package/dist/javascript-Diow8phl.cjs +969 -0
- package/dist/{javascript-C001Vve5.cjs.map → javascript-Diow8phl.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/blockly-Bh_t9Weo.cjs +0 -2
- package/dist/blockly-Bh_t9Weo.cjs.map +0 -1
- package/dist/blockly-Dbc_qiBz.js +0 -328
- package/dist/blockly-Dbc_qiBz.js.map +0 -1
- package/dist/blockly_compressed-BZraWoMC.cjs +0 -792
- package/dist/blockly_compressed-L5h4evQZ.js +0 -15717
- package/dist/blocks-C4L357Lk.cjs +0 -4
- package/dist/blocks-DNGprLHy.js +0 -1316
- package/dist/index-CRP4KubC.cjs +0 -75
- package/dist/index-Kkc2CBjJ.js +0 -3762
- package/dist/javascript-BdBscNU_.js +0 -819
- package/dist/javascript-C001Vve5.cjs +0 -219
package/dist/index-CRP4KubC.cjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";const w=require("react"),Ce=require("react-dom");function Er(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const T=Er(w);let $,q,ne=!1,Z=null,ye=[],le=0;function Bt(){le++;const t=(new Error().stack||"Unknown call stack").split(`
|
|
2
|
-
`)[2]?.trim()||"Unknown caller";return ye.push(`Call #${le}: ${t}`),console.log(`[Blockly Setup] 🚀 initializeBlockly() called #${le}`),console.log(`[Blockly Setup] 📍 Caller: ${t}`),console.log(`[Blockly Setup] 📊 Current state: isInitialized=${ne}, hasPromise=${!!Z}`),console.log("[Blockly Setup] 📋 All calls so far:",ye),ne?(console.log("[Blockly Setup] ✅ Already initialized, returning resolved promise"),Promise.resolve()):Z?(console.log("[Blockly Setup] ⏳ Initialization already in progress, returning existing promise"),Z):(console.log("[Blockly Setup] 🎯 Starting fresh Blockly initialization..."),Z=new Promise((r,n)=>{(async()=>{try{if(console.log("[Blockly Setup] 🔍 Checking Blockly core availability..."),console.log("[Blockly Setup] 📦 Current Blockly state:",{BlocklyType:typeof $,BlocklyValue:$?"defined":"undefined",javascriptGeneratorType:typeof q,javascriptGeneratorValue:q?"defined":"undefined"}),typeof $>"u"){console.log("[Blockly Setup] 📥 Blockly not loaded, attempting dynamic import...");try{console.log("[Blockly Setup] 📥 Importing blockly/core...");const o=await Promise.resolve().then(()=>require("./blockly-Bh_t9Weo.cjs"));console.log("[Blockly Setup] 📥 Importing blockly/blocks..."),await Promise.resolve().then(()=>require("./blocks-C4L357Lk.cjs")),console.log("[Blockly Setup] 📥 Importing blockly/javascript...");const a=await Promise.resolve().then(()=>require("./javascript-C001Vve5.cjs"));$=o,q=a.javascriptGenerator,console.log("[Blockly Setup] ✅ Blockly modules imported successfully"),console.log("[Blockly Setup] 📦 Post-import state:",{BlocklyType:typeof $,BlocklyKeys:$?Object.keys($).slice(0,10):"none",javascriptGeneratorType:typeof q,javascriptGeneratorKeys:q?Object.keys(q).slice(0,10):"none"})}catch(o){console.error("[Blockly Setup] ❌ Failed to import Blockly modules:",o),console.error("[Blockly Setup] 📋 Import error details:",{message:o.message,stack:o.stack,name:o.name});const a=new Error("Blockly core is not available. Make sure Blockly is properly installed and imported in your project.");n(a);return}}else console.log("[Blockly Setup] ✅ Blockly already loaded, skipping import");if(console.log("[Blockly Setup] ✅ Blockly core is available"),console.log("[Blockly Setup] 🌍 Setting up locale..."),typeof $.setLocale=="function")try{$.setLocale("en"),console.log("[Blockly Setup] ✅ Locale set to English")}catch(o){console.warn("[Blockly Setup] ⚠️ Locale setup failed, using default:",o)}else console.log("[Blockly Setup] ⚠️ setLocale function not available");if(console.log("[Blockly Setup] 🏗️ Initializing main workspace access..."),typeof $.getMainWorkspace=="function")try{const o=$.getMainWorkspace();console.log("[Blockly Setup] ✅ Main workspace access initialized:",!!o)}catch(o){console.log("[Blockly Setup] ℹ️ Main workspace access failed (expected if no workspace exists):",o.message)}else console.log("[Blockly Setup] ⚠️ getMainWorkspace function not available");if(console.log("[Blockly Setup] 🎯 Initializing event system..."),console.log("[Blockly Setup] 🔍 Checking Events object:",{EventsType:typeof $.Events,EventsKeys:$.Events?Object.keys($.Events).slice(0,10):"none",hasGetGroup:typeof $.Events?.getGroup=="function"}),typeof $.Events=="object"&&$.Events.getGroup)try{const o=$.Events.getGroup();console.log("[Blockly Setup] ✅ Event system initialized, group:",o)}catch(o){console.log("[Blockly Setup] ⚠️ Event system initialization failed (may already be initialized):",o.message)}else console.log("[Blockly Setup] ⚠️ Events.getGroup not available");console.log("[Blockly Setup] 🔧 Checking for recentlyCreatedOwnerStacks...");try{$.Events&&typeof $.Events.getGroup=="function"&&($.Events.getGroup(),console.log("[Blockly Setup] ✅ Events.getGroup() called successfully")),$.utils&&$.utils.xml&&console.log("[Blockly Setup] ✅ Blockly.utils.xml is available"),$.inject&&console.log("[Blockly Setup] ✅ Blockly.inject is available")}catch(o){console.error("[Blockly Setup] ❌ Error during internal state check:",o)}if(console.log("[Blockly Setup] 🔧 Checking JavaScript generator..."),typeof q>"u"){const o=new Error("Blockly JavaScript generator is not available. Make sure blockly/javascript is imported.");console.error("[Blockly Setup] ❌ Error:",o.message),n(o);return}console.log("[Blockly Setup] ✅ JavaScript generator is available"),console.log("[Blockly Setup] 📦 JavaScript generator details:",{type:typeof q,hasWorkspaceToCode:typeof q.workspaceToCode=="function",hasForBlock:typeof q.forBlock=="object",keys:Object.keys(q).slice(0,10)}),ne=!0,console.log("[Blockly Setup] 🎉 ✅ Blockly initialized successfully for package usage"),console.log("[Blockly Setup] 📊 Final state:",{isBlocklyInitialized:ne,hasBlockly:!!$,hasJavaScriptGenerator:!!q,initializationCount:le,callStack:ye}),r()}catch(o){console.error("[Blockly Setup] ❌ Failed to initialize Blockly:",o),console.error("[Blockly Setup] 📋 Error details:",{message:o.message,stack:o.stack,name:o.name}),Z=null,n(o)}})()}),Z)}function tt(){return ne&&typeof $<"u"}function Oe(){if(!tt())throw new Error("Blockly is not initialized. Call initializeBlockly() first.");return $}function Me(){if(!tt())throw new Error("Blockly is not initialized. Call initializeBlockly() first.");return q}function wr(){console.log("[Blockly Setup] 🔄 Resetting initialization state"),console.log("[Blockly Setup] 📊 State before reset:",{isBlocklyInitialized:ne,hasInitializationPromise:!!Z,initializationCount:le,callStack:ye}),ne=!1,Z=null,ye=[],le=0,console.log("[Blockly Setup] ✅ Reset completed")}function ce(){return{isBlocklyInitialized:ne,hasInitializationPromise:!!Z,initializationCount:le,callStack:[...ye],blocklyState:{hasBlockly:!!$,blocklyType:typeof $,blocklyKeys:$?Object.keys($).slice(0,20):"none"},generatorState:{hasGenerator:!!q,generatorType:typeof q,generatorKeys:q?Object.keys(q).slice(0,20):"none"}}}function Sr(e,t){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),t)}}function Tr(e,t){let r;return(...n)=>{r||(e(...n),r=!0,setTimeout(()=>r=!1,t))}}function Rr(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r}function _r(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function jr(e,t={}){const r=new Date(e),n={year:"numeric",month:"long",day:"numeric",...t};return new Intl.DateTimeFormat("en-US",n).format(r)}function Mr(e){const t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s} minute${s===1?"":"s"} ago`;const o=Math.floor(s/60);if(o<24)return`${o} hour${o===1?"":"s"} ago`;const a=Math.floor(o/24);if(a<7)return`${a} day${a===1?"":"s"} ago`;const l=Math.floor(a/7);if(l<4)return`${l} week${l===1?"":"s"} ago`;const u=Math.floor(a/30);if(u<12)return`${u} month${u===1?"":"s"} ago`;const f=Math.floor(a/365);return`${f} year${f===1?"":"s"} ago`}function zt(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Or(e){return e.toLowerCase().split(" ").map(t=>zt(t)).join(" ")}function Br(e,t,r="..."){return e.length<=t?e:e.substring(0,t-r.length)+r}function zr(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function Nr(e){try{return new URL(e),!0}catch{return!1}}function Ve(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(t=>Ve(t));if(typeof e=="object"){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Ve(e[r]));return t}return e}function Nt(...e){return e.reduce((t,r)=>{for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?t[n]=Nt(t[n]||{},r[n]):t[n]=r[n]);return t},{})}function Pr(e){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==void 0&&e[r]!==null&&(t[r]=e[r]);return t}function Ir(e,t,r){const n=t.split(".");let s=e;for(const o of n)if(s&&typeof s=="object"&&o in s)s=s[o];else return r;return s}function $r(e,t,r){const n=t.split("."),s={...e};let o=s;for(let a=0;a<n.length-1;a++){const l=n[a];(!(l in o)||typeof o[l]!="object")&&(o[l]={}),o=o[l]}return o[n[n.length-1]]=r,s}function Pt(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s)||!Pt(e[s],t[s]))return!1;return!0}function It(e){return new Promise(t=>setTimeout(t,e))}async function Ar(e,t=3,r=1e3){let n;for(let s=0;s<=t;s++)try{return await e()}catch(o){if(n=o,s===t)throw n;const a=r*Math.pow(2,s);await It(a)}throw n}var Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te={exports:{}},ke={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var ft;function Fr(){if(ft)return ke;ft=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var l in s)l!=="key"&&(o[l]=s[l])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:a,ref:s!==void 0?s:null,props:o}}return ke.Fragment=t,ke.jsx=r,ke.jsxs=r,ke}var be={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.development.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var dt;function Lr(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&(function(){function e(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ve?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case v:return"Fragment";case P:return"Profiler";case k:return"StrictMode";case m:return"Suspense";case W:return"SuspenseList";case ge:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case I:return"Portal";case M:return(i.displayName||"Context")+".Provider";case G:return(i._context.displayName||"Context")+".Consumer";case L:var d=i.render;return i=i.displayName,i||(i=d.displayName||d.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return d=i.displayName||null,d!==null?d:e(i.type)||"Memo";case ue:d=i._payload,i=i._init;try{return e(i(d))}catch{}}return null}function t(i){return""+i}function r(i){try{t(i);var d=!1}catch{d=!0}if(d){d=console;var x=d.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return x.call(d,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),t(i)}}function n(i){if(i===v)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===ue)return"<...>";try{var d=e(i);return d?"<"+d+">":"<...>"}catch{return"<...>"}}function s(){var i=te.A;return i===null?null:i.getOwner()}function o(){return Error("react-stack-top-frame")}function a(i){if(fe.call(i,"key")){var d=Object.getOwnPropertyDescriptor(i,"key").get;if(d&&d.isReactWarning)return!1}return i.key!==void 0}function l(i,d){function x(){de||(de=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",d))}x.isReactWarning=!0,Object.defineProperty(i,"key",{get:x,configurable:!0})}function u(){var i=e(this.type);return Y[i]||(Y[i]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),i=this.props.ref,i!==void 0?i:null}function f(i,d,x,b,C,R,j,O){return x=R.ref,i={$$typeof:_,type:i,key:d,props:R,_owner:C},(x!==void 0?x:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:u}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function p(i,d,x,b,C,R,j,O){var E=d.children;if(E!==void 0)if(b)if(xe(E)){for(b=0;b<E.length;b++)h(E[b]);Object.freeze&&Object.freeze(E)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(E);if(fe.call(d,"key")){E=e(i);var B=Object.keys(d).filter(function(U){return U!=="key"});b=0<B.length?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}",pe[E+b]||(B=0<B.length?"{"+B.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
|
-
let props = %s;
|
|
20
|
-
<%s {...props} />
|
|
21
|
-
React keys must be passed directly to JSX without using spread:
|
|
22
|
-
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,b,E,B,E),pe[E+b]=!0)}if(E=null,x!==void 0&&(r(x),E=""+x),a(d)&&(r(d.key),E=""+d.key),"key"in d){x={};for(var z in d)z!=="key"&&(x[z]=d[z])}else x=d;return E&&l(x,typeof i=="function"?i.displayName||i.name||"Unknown":i),f(i,E,R,C,s(),x,j,O)}function h(i){typeof i=="object"&&i!==null&&i.$$typeof===_&&i._store&&(i._store.validated=1)}var y=w,_=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),M=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),ve=Symbol.for("react.client.reference"),te=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=Object.prototype.hasOwnProperty,xe=Array.isArray,X=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(i){return i()}};var de,Y={},H=y.react_stack_bottom_frame.bind(y,o)(),se=X(n(o)),pe={};be.Fragment=v,be.jsx=function(i,d,x,b,C){var R=1e4>te.recentlyCreatedOwnerStacks++;return p(i,d,x,!1,b,C,R?Error("react-stack-top-frame"):H,R?X(n(i)):se)},be.jsxs=function(i,d,x,b,C){var R=1e4>te.recentlyCreatedOwnerStacks++;return p(i,d,x,!0,b,C,R?Error("react-stack-top-frame"):H,R?X(n(i)):se)}})()),be}var pt;function Gr(){return pt||(pt=1,process.env.NODE_ENV==="production"?Te.exports=Fr():Te.exports=Lr()),Te.exports}var c=Gr(),Ae={exports:{}};/*!
|
|
24
|
-
Copyright (c) 2018 Jed Watson.
|
|
25
|
-
Licensed under the MIT License (MIT), see
|
|
26
|
-
http://jedwatson.github.io/classnames
|
|
27
|
-
*/var mt;function Wr(){return mt||(mt=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(o=s(o,n(l)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var l in o)t.call(o,l)&&o[l]&&(a=s(a,l));return a}function s(o,a){return a?o?o+" "+a:o+a:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ae)),Ae.exports}var qr=Wr();const N=Pe(qr);function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xe.apply(null,arguments)}function $t(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ht(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function Ur(e){var t=Yr(e,"string");return typeof t=="symbol"?t:String(t)}function Yr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Vr(e,t,r){var n=w.useRef(e!==void 0),s=w.useState(t),o=s[0],a=s[1],l=e!==void 0,u=n.current;return n.current=l,!l&&u&&o!==t&&a(t),[l?e:o,w.useCallback(function(f){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y<p;y++)h[y-1]=arguments[y];r&&r.apply(void 0,[f].concat(h)),a(f)},[r])]}function Xr(e,t){return Object.keys(t).reduce(function(r,n){var s,o=r,a=o[ht(n)],l=o[n],u=$t(o,[ht(n),n].map(Ur)),f=t[n],p=Vr(l,a,e[f]),h=p[0],y=p[1];return Xe({},u,(s={},s[n]=h,s[f]=y,s))},e)}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},He(e,t)}function Hr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,He(e,t)}const Jr=["xxl","xl","lg","md","sm","xs"],Kr="xs",Ie=T.createContext({prefixes:{},breakpoints:Jr,minBreakpoint:Kr}),{Consumer:to,Provider:ro}=Ie;function F(e,t){const{prefixes:r}=w.useContext(Ie);return e||r[t]||t}function At(){const{breakpoints:e}=w.useContext(Ie);return e}function Dt(){const{minBreakpoint:e}=w.useContext(Ie);return e}function Zr(e){return e&&e.ownerDocument||document}function Qr(e){var t=Zr(e);return t&&t.defaultView||window}function en(e,t){return Qr(e).getComputedStyle(e,t)}var tn=/([A-Z])/g;function rn(e){return e.replace(tn,"-$1").toLowerCase()}var nn=/^ms-/;function Re(e){return rn(e).replace(nn,"-ms-")}var on=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function sn(e){return!!(e&&on.test(e))}function Ft(e,t){var r="",n="";if(typeof t=="string")return e.style.getPropertyValue(Re(t))||en(e).getPropertyValue(Re(t));Object.keys(t).forEach(function(s){var o=t[s];!o&&o!==0?e.style.removeProperty(Re(s)):sn(s)?n+=s+"("+o+") ":r+=Re(s)+": "+o+";"}),n&&(r+="transform: "+n+";"),e.style.cssText+=";"+r}var _e={exports:{}},je={exports:{}},A={};/** @license React v16.13.1
|
|
28
|
-
* react-is.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var yt;function an(){if(yt)return A;yt=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,_=e?Symbol.for("react.memo"):60115,I=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,G=e?Symbol.for("react.scope"):60119;function M(m){if(typeof m=="object"&&m!==null){var W=m.$$typeof;switch(W){case t:switch(m=m.type,m){case u:case f:case n:case o:case s:case h:return m;default:switch(m=m&&m.$$typeof,m){case l:case p:case I:case _:case a:return m;default:return W}}case r:return W}}}function L(m){return M(m)===f}return A.AsyncMode=u,A.ConcurrentMode=f,A.ContextConsumer=l,A.ContextProvider=a,A.Element=t,A.ForwardRef=p,A.Fragment=n,A.Lazy=I,A.Memo=_,A.Portal=r,A.Profiler=o,A.StrictMode=s,A.Suspense=h,A.isAsyncMode=function(m){return L(m)||M(m)===u},A.isConcurrentMode=L,A.isContextConsumer=function(m){return M(m)===l},A.isContextProvider=function(m){return M(m)===a},A.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},A.isForwardRef=function(m){return M(m)===p},A.isFragment=function(m){return M(m)===n},A.isLazy=function(m){return M(m)===I},A.isMemo=function(m){return M(m)===_},A.isPortal=function(m){return M(m)===r},A.isProfiler=function(m){return M(m)===o},A.isStrictMode=function(m){return M(m)===s},A.isSuspense=function(m){return M(m)===h},A.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===f||m===o||m===s||m===h||m===y||typeof m=="object"&&m!==null&&(m.$$typeof===I||m.$$typeof===_||m.$$typeof===a||m.$$typeof===l||m.$$typeof===p||m.$$typeof===k||m.$$typeof===P||m.$$typeof===G||m.$$typeof===v)},A.typeOf=M,A}var D={};/** @license React v16.13.1
|
|
35
|
-
* react-is.development.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var gt;function ln(){return gt||(gt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,_=e?Symbol.for("react.memo"):60115,I=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,G=e?Symbol.for("react.scope"):60119;function M(g){return typeof g=="string"||typeof g=="function"||g===n||g===f||g===o||g===s||g===h||g===y||typeof g=="object"&&g!==null&&(g.$$typeof===I||g.$$typeof===_||g.$$typeof===a||g.$$typeof===l||g.$$typeof===p||g.$$typeof===k||g.$$typeof===P||g.$$typeof===G||g.$$typeof===v)}function L(g){if(typeof g=="object"&&g!==null){var J=g.$$typeof;switch(J){case t:var Se=g.type;switch(Se){case u:case f:case n:case o:case s:case h:return Se;default:var ut=Se&&Se.$$typeof;switch(ut){case l:case p:case I:case _:case a:return ut;default:return J}}case r:return J}}}var m=u,W=f,V=l,ue=a,ge=t,ve=p,te=n,fe=I,xe=_,X=r,de=o,Y=s,H=h,se=!1;function pe(g){return se||(se=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),i(g)||L(g)===u}function i(g){return L(g)===f}function d(g){return L(g)===l}function x(g){return L(g)===a}function b(g){return typeof g=="object"&&g!==null&&g.$$typeof===t}function C(g){return L(g)===p}function R(g){return L(g)===n}function j(g){return L(g)===I}function O(g){return L(g)===_}function E(g){return L(g)===r}function B(g){return L(g)===o}function z(g){return L(g)===s}function U(g){return L(g)===h}D.AsyncMode=m,D.ConcurrentMode=W,D.ContextConsumer=V,D.ContextProvider=ue,D.Element=ge,D.ForwardRef=ve,D.Fragment=te,D.Lazy=fe,D.Memo=xe,D.Portal=X,D.Profiler=de,D.StrictMode=Y,D.Suspense=H,D.isAsyncMode=pe,D.isConcurrentMode=i,D.isContextConsumer=d,D.isContextProvider=x,D.isElement=b,D.isForwardRef=C,D.isFragment=R,D.isLazy=j,D.isMemo=O,D.isPortal=E,D.isProfiler=B,D.isStrictMode=z,D.isSuspense=U,D.isValidElementType=M,D.typeOf=L})()),D}var vt;function Lt(){return vt||(vt=1,process.env.NODE_ENV==="production"?je.exports=an():je.exports=ln()),je.exports}/*
|
|
42
|
-
object-assign
|
|
43
|
-
(c) Sindre Sorhus
|
|
44
|
-
@license MIT
|
|
45
|
-
*/var De,xt;function cn(){if(xt)return De;xt=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var u=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(u.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return De=s()?Object.assign:function(o,a){for(var l,u=n(o),f,p=1;p<arguments.length;p++){l=Object(arguments[p]);for(var h in l)t.call(l,h)&&(u[h]=l[h]);if(e){f=e(l);for(var y=0;y<f.length;y++)r.call(l,f[y])&&(u[f[y]]=l[f[y]])}}return u},De}var Fe,kt;function rt(){if(kt)return Fe;kt=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Fe=e,Fe}var Le,bt;function Gt(){return bt||(bt=1,Le=Function.call.bind(Object.prototype.hasOwnProperty)),Le}var Ge,Ct;function un(){if(Ct)return Ge;Ct=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=rt(),r={},n=Gt();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function s(o,a,l,u,f){if(process.env.NODE_ENV!=="production"){for(var p in o)if(n(o,p)){var h;try{if(typeof o[p]!="function"){var y=Error((u||"React class")+": "+l+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}h=o[p](a,p,u,l,null,t)}catch(I){h=I}if(h&&!(h instanceof Error)&&e((u||"React class")+": type specification of "+l+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var _=f?f():"";e("Failed "+l+" type: "+h.message+(_??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Ge=s,Ge}var We,Et;function fn(){if(Et)return We;Et=1;var e=Lt(),t=cn(),r=rt(),n=Gt(),s=un(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return We=function(l,u){var f=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function h(i){var d=i&&(f&&i[f]||i[p]);if(typeof d=="function")return d}var y="<<anonymous>>",_={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:G(),arrayOf:M,element:L(),elementType:m(),instanceOf:W,node:ve(),objectOf:ue,oneOf:V,oneOfType:ge,shape:fe,exact:xe};function I(i,d){return i===d?i!==0||1/i===1/d:i!==i&&d!==d}function v(i,d){this.message=i,this.data=d&&typeof d=="object"?d:{},this.stack=""}v.prototype=Error.prototype;function k(i){if(process.env.NODE_ENV!=="production")var d={},x=0;function b(R,j,O,E,B,z,U){if(E=E||y,z=z||O,U!==r){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var J=E+":"+O;!d[J]&&x<3&&(o("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+E+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),d[J]=!0,x++)}}return j[O]==null?R?j[O]===null?new v("The "+B+" `"+z+"` is marked as required "+("in `"+E+"`, but its value is `null`.")):new v("The "+B+" `"+z+"` is marked as required in "+("`"+E+"`, but its value is `undefined`.")):null:i(j,O,E,B,z)}var C=b.bind(null,!1);return C.isRequired=b.bind(null,!0),C}function P(i){function d(x,b,C,R,j,O){var E=x[b],B=Y(E);if(B!==i){var z=H(E);return new v("Invalid "+R+" `"+j+"` of type "+("`"+z+"` supplied to `"+C+"`, expected ")+("`"+i+"`."),{expectedType:i})}return null}return k(d)}function G(){return k(a)}function M(i){function d(x,b,C,R,j){if(typeof i!="function")return new v("Property `"+j+"` of component `"+C+"` has invalid PropType notation inside arrayOf.");var O=x[b];if(!Array.isArray(O)){var E=Y(O);return new v("Invalid "+R+" `"+j+"` of type "+("`"+E+"` supplied to `"+C+"`, expected an array."))}for(var B=0;B<O.length;B++){var z=i(O,B,C,R,j+"["+B+"]",r);if(z instanceof Error)return z}return null}return k(d)}function L(){function i(d,x,b,C,R){var j=d[x];if(!l(j)){var O=Y(j);return new v("Invalid "+C+" `"+R+"` of type "+("`"+O+"` supplied to `"+b+"`, expected a single ReactElement."))}return null}return k(i)}function m(){function i(d,x,b,C,R){var j=d[x];if(!e.isValidElementType(j)){var O=Y(j);return new v("Invalid "+C+" `"+R+"` of type "+("`"+O+"` supplied to `"+b+"`, expected a single ReactElement type."))}return null}return k(i)}function W(i){function d(x,b,C,R,j){if(!(x[b]instanceof i)){var O=i.name||y,E=pe(x[b]);return new v("Invalid "+R+" `"+j+"` of type "+("`"+E+"` supplied to `"+C+"`, expected ")+("instance of `"+O+"`."))}return null}return k(d)}function V(i){if(!Array.isArray(i))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function d(x,b,C,R,j){for(var O=x[b],E=0;E<i.length;E++)if(I(O,i[E]))return null;var B=JSON.stringify(i,function(U,g){var J=H(g);return J==="symbol"?String(g):g});return new v("Invalid "+R+" `"+j+"` of value `"+String(O)+"` "+("supplied to `"+C+"`, expected one of "+B+"."))}return k(d)}function ue(i){function d(x,b,C,R,j){if(typeof i!="function")return new v("Property `"+j+"` of component `"+C+"` has invalid PropType notation inside objectOf.");var O=x[b],E=Y(O);if(E!=="object")return new v("Invalid "+R+" `"+j+"` of type "+("`"+E+"` supplied to `"+C+"`, expected an object."));for(var B in O)if(n(O,B)){var z=i(O,B,C,R,j+"."+B,r);if(z instanceof Error)return z}return null}return k(d)}function ge(i){if(!Array.isArray(i))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var d=0;d<i.length;d++){var x=i[d];if(typeof x!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+se(x)+" at index "+d+"."),a}function b(C,R,j,O,E){for(var B=[],z=0;z<i.length;z++){var U=i[z],g=U(C,R,j,O,E,r);if(g==null)return null;g.data&&n(g.data,"expectedType")&&B.push(g.data.expectedType)}var J=B.length>0?", expected one of type ["+B.join(", ")+"]":"";return new v("Invalid "+O+" `"+E+"` supplied to "+("`"+j+"`"+J+"."))}return k(b)}function ve(){function i(d,x,b,C,R){return X(d[x])?null:new v("Invalid "+C+" `"+R+"` supplied to "+("`"+b+"`, expected a ReactNode."))}return k(i)}function te(i,d,x,b,C){return new v((i||"React class")+": "+d+" type `"+x+"."+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+C+"`.")}function fe(i){function d(x,b,C,R,j){var O=x[b],E=Y(O);if(E!=="object")return new v("Invalid "+R+" `"+j+"` of type `"+E+"` "+("supplied to `"+C+"`, expected `object`."));for(var B in i){var z=i[B];if(typeof z!="function")return te(C,R,j,B,H(z));var U=z(O,B,C,R,j+"."+B,r);if(U)return U}return null}return k(d)}function xe(i){function d(x,b,C,R,j){var O=x[b],E=Y(O);if(E!=="object")return new v("Invalid "+R+" `"+j+"` of type `"+E+"` "+("supplied to `"+C+"`, expected `object`."));var B=t({},x[b],i);for(var z in B){var U=i[z];if(n(i,z)&&typeof U!="function")return te(C,R,j,z,H(U));if(!U)return new v("Invalid "+R+" `"+j+"` key `"+z+"` supplied to `"+C+"`.\nBad object: "+JSON.stringify(x[b],null," ")+`
|
|
46
|
-
Valid keys: `+JSON.stringify(Object.keys(i),null," "));var g=U(O,z,C,R,j+"."+z,r);if(g)return g}return null}return k(d)}function X(i){switch(typeof i){case"number":case"string":case"undefined":return!0;case"boolean":return!i;case"object":if(Array.isArray(i))return i.every(X);if(i===null||l(i))return!0;var d=h(i);if(d){var x=d.call(i),b;if(d!==i.entries){for(;!(b=x.next()).done;)if(!X(b.value))return!1}else for(;!(b=x.next()).done;){var C=b.value;if(C&&!X(C[1]))return!1}}else return!1;return!0;default:return!1}}function de(i,d){return i==="symbol"?!0:d?d["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&d instanceof Symbol:!1}function Y(i){var d=typeof i;return Array.isArray(i)?"array":i instanceof RegExp?"object":de(d,i)?"symbol":d}function H(i){if(typeof i>"u"||i===null)return""+i;var d=Y(i);if(d==="object"){if(i instanceof Date)return"date";if(i instanceof RegExp)return"regexp"}return d}function se(i){var d=H(i);switch(d){case"array":case"object":return"an "+d;case"boolean":case"date":case"regexp":return"a "+d;default:return d}}function pe(i){return!i.constructor||!i.constructor.name?y:i.constructor.name}return _.checkPropTypes=s,_.resetWarningCache=s.resetWarningCache,_.PropTypes=_,_},We}var qe,wt;function dn(){if(wt)return qe;wt=1;var e=rt();function t(){}function r(){}return r.resetWarningCache=t,qe=function(){function n(a,l,u,f,p,h){if(h!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}n.isRequired=n;function s(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o},qe}var St;function pn(){if(St)return _e.exports;if(St=1,process.env.NODE_ENV!=="production"){var e=Lt(),t=!0;_e.exports=fn()(e.isElement,t)}else _e.exports=dn()();return _e.exports}var mn=pn();const S=Pe(mn),Tt={disabled:!1};var hn=process.env.NODE_ENV!=="production"?S.oneOfType([S.number,S.shape({enter:S.number,exit:S.number,appear:S.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&S.oneOfType([S.string,S.shape({enter:S.string,exit:S.string,active:S.string}),S.shape({enter:S.string,enterDone:S.string,enterActive:S.string,exit:S.string,exitDone:S.string,exitActive:S.string})]);const Wt=w.createContext(null);var yn=function(t){return t.scrollTop},Ee="unmounted",ae="exited",re="entering",ie="entered",Je="exiting",ee=(function(e){Hr(t,e);function t(n,s){var o;o=e.call(this,n,s)||this;var a=s,l=a&&!a.isMounting?n.enter:n.appear,u;return o.appearStatus=null,n.in?l?(u=ae,o.appearStatus=re):u=ie:n.unmountOnExit||n.mountOnEnter?u=Ee:u=ae,o.state={status:u},o.nextCallback=null,o}t.getDerivedStateFromProps=function(s,o){var a=s.in;return a&&o.status===Ee?{status:ae}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(s){var o=null;if(s!==this.props){var a=this.state.status;this.props.in?a!==re&&a!==ie&&(o=re):(a===re||a===ie)&&(o=Je)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var s=this.props.timeout,o,a,l;return o=a=l=s,s!=null&&typeof s!="number"&&(o=s.exit,a=s.enter,l=s.appear!==void 0?s.appear:a),{exit:o,enter:a,appear:l}},r.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===re){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Ce.findDOMNode(this);a&&yn(a)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ae&&this.setState({status:Ee})},r.performEnter=function(s){var o=this,a=this.props.enter,l=this.context?this.context.isMounting:s,u=this.props.nodeRef?[l]:[Ce.findDOMNode(this),l],f=u[0],p=u[1],h=this.getTimeouts(),y=l?h.appear:h.enter;if(!s&&!a||Tt.disabled){this.safeSetState({status:ie},function(){o.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:re},function(){o.props.onEntering(f,p),o.onTransitionEnd(y,function(){o.safeSetState({status:ie},function(){o.props.onEntered(f,p)})})})},r.performExit=function(){var s=this,o=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:Ce.findDOMNode(this);if(!o||Tt.disabled){this.safeSetState({status:ae},function(){s.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Je},function(){s.props.onExiting(l),s.onTransitionEnd(a.exit,function(){s.safeSetState({status:ae},function(){s.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},r.setNextCallback=function(s){var o=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,o.nextCallback=null,s(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(s,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Ce.findDOMNode(this),l=s==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],f=u[0],p=u[1];this.props.addEndListener(f,p)}s!=null&&setTimeout(this.nextCallback,s)},r.render=function(){var s=this.state.status;if(s===Ee)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var l=$t(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return w.createElement(Wt.Provider,{value:null},typeof a=="function"?a(s,l):w.cloneElement(w.Children.only(a),l))},t})(w.Component);ee.contextType=Wt;ee.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:S.shape({current:typeof Element>"u"?S.any:function(e,t,r,n,s,o){var a=e[t];return S.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(e,t,r,n,s,o)}}),children:S.oneOfType([S.func.isRequired,S.element.isRequired]).isRequired,in:S.bool,mountOnEnter:S.bool,unmountOnExit:S.bool,appear:S.bool,enter:S.bool,exit:S.bool,timeout:function(t){var r=hn;t.addEndListener||(r=r.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return r.apply(void 0,[t].concat(s))},addEndListener:S.func,onEnter:S.func,onEntering:S.func,onEntered:S.func,onExit:S.func,onExiting:S.func,onExited:S.func}:{};function me(){}ee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:me,onEntering:me,onEntered:me,onExit:me,onExiting:me,onExited:me};ee.UNMOUNTED=Ee;ee.EXITED=ae;ee.ENTERING=re;ee.ENTERED=ie;ee.EXITING=Je;function gn(){const e=T.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}function vn(e){if(!e||typeof e=="function")return null;const{major:t}=gn();return t>=19?e.props.ref:e.ref}const xn=!!(typeof window<"u"&&window.document&&window.document.createElement);var Ke=!1,Ze=!1;try{var Ue={get passive(){return Ke=!0},get once(){return Ze=Ke=!0}};xn&&(window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,!0))}catch{}function kn(e,t,r,n){if(n&&typeof n!="boolean"&&!Ze){var s=n.once,o=n.capture,a=r;!Ze&&s&&(a=r.__once||function l(u){this.removeEventListener(t,l,o),r.call(this,u)},r.__once=a),e.addEventListener(t,a,Ke?n:o)}e.addEventListener(t,r,n)}function bn(e,t,r,n){var s=n&&typeof n!="boolean"?n.capture:n;e.removeEventListener(t,r,s),r.__once&&e.removeEventListener(t,r.__once,s)}function qt(e,t,r,n){return kn(e,t,r,n),function(){bn(e,t,r,n)}}function Cn(e,t,r,n){if(n===void 0&&(n=!0),e){var s=document.createEvent("HTMLEvents");s.initEvent(t,r,n),e.dispatchEvent(s)}}function En(e){var t=Ft(e,"transitionDuration")||"",r=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*r}function wn(e,t,r){r===void 0&&(r=5);var n=!1,s=setTimeout(function(){n||Cn(e,"transitionend",!0)},t+r),o=qt(e,"transitionend",function(){n=!0},{once:!0});return function(){clearTimeout(s),o()}}function Sn(e,t,r,n){r==null&&(r=En(e)||0);var s=wn(e,r,n),o=qt(e,"transitionend",t);return function(){s(),o()}}function Rt(e,t){const r=Ft(e,t)||"",n=r.indexOf("ms")===-1?1e3:1;return parseFloat(r)*n}function Tn(e,t){const r=Rt(e,"transitionDuration"),n=Rt(e,"transitionDelay"),s=Sn(e,o=>{o.target===e&&(s(),t(o))},r+n)}function Rn(e){e.offsetHeight}const _t=e=>!e||typeof e=="function"?e:t=>{e.current=t};function _n(e,t){const r=_t(e),n=_t(t);return s=>{r&&r(s),n&&n(s)}}function jn(e,t){return w.useMemo(()=>_n(e,t),[e,t])}function Mn(e){return e&&"setState"in e?Ce.findDOMNode(e):e??null}const Ut=w.forwardRef(({onEnter:e,onEntering:t,onEntered:r,onExit:n,onExiting:s,onExited:o,addEndListener:a,children:l,childRef:u,...f},p)=>{const h=w.useRef(null),y=jn(h,u),_=W=>{y(Mn(W))},I=W=>V=>{W&&h.current&&W(h.current,V)},v=w.useCallback(I(e),[e]),k=w.useCallback(I(t),[t]),P=w.useCallback(I(r),[r]),G=w.useCallback(I(n),[n]),M=w.useCallback(I(s),[s]),L=w.useCallback(I(o),[o]),m=w.useCallback(I(a),[a]);return c.jsx(ee,{ref:p,...f,onEnter:v,onEntered:P,onEntering:k,onExit:G,onExited:L,onExiting:M,addEndListener:m,nodeRef:h,children:typeof l=="function"?(W,V)=>l(W,{...V,ref:_}):w.cloneElement(l,{ref:_})})});Ut.displayName="TransitionWrapper";function On(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e},[e]),t}function Bn(e){const t=On(e);return w.useCallback(function(...r){return t.current&&t.current(...r)},[t])}const nt=(e=>T.forwardRef((t,r)=>c.jsx("div",{...t,ref:r,className:N(t.className,e)}))),Yt=nt("h4");Yt.displayName="DivStyledAsH4";const Vt=T.forwardRef(({className:e,bsPrefix:t,as:r=Yt,...n},s)=>(t=F(t,"alert-heading"),c.jsx(r,{ref:s,className:N(e,t),...n})));Vt.displayName="AlertHeading";function zn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e},[e]),t}function Nn(e){const t=zn(e);return w.useCallback(function(...r){return t.current&&t.current(...r)},[t])}const Pn=["as","disabled"];function In(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $n(e){return!e||e.trim()==="#"}function ot({tagName:e,disabled:t,href:r,target:n,rel:s,role:o,onClick:a,tabIndex:l=0,type:u}){e||(r!=null||n!=null||s!=null?e="a":e="button");const f={tagName:e};if(e==="button")return[{type:u||"button",disabled:t},f];const p=y=>{if((t||e==="a"&&$n(r))&&y.preventDefault(),t){y.stopPropagation();return}a?.(y)},h=y=>{y.key===" "&&(y.preventDefault(),p(y))};return e==="a"&&(r||(r="#"),t&&(r=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:l,href:r,target:e==="a"?n:void 0,"aria-disabled":t||void 0,rel:e==="a"?s:void 0,onClick:p,onKeyDown:h},f]}const An=T.forwardRef((e,t)=>{let{as:r,disabled:n}=e,s=In(e,Pn);const[o,{tagName:a}]=ot(Object.assign({tagName:r,disabled:n},s));return c.jsx(a,Object.assign({},s,o,{ref:t}))});An.displayName="Button";const Dn=["onKeyDown"];function Fn(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ln(e){return!e||e.trim()==="#"}const Xt=T.forwardRef((e,t)=>{let{onKeyDown:r}=e,n=Fn(e,Dn);const[s]=ot(Object.assign({tagName:"a"},n)),o=Nn(a=>{s.onKeyDown(a),r?.(a)});return Ln(n.href)||n.role==="button"?c.jsx("a",Object.assign({ref:t},n,s,{onKeyDown:o})):c.jsx("a",Object.assign({ref:t},n,{onKeyDown:r}))});Xt.displayName="Anchor";const Ht=T.forwardRef(({className:e,bsPrefix:t,as:r=Xt,...n},s)=>(t=F(t,"alert-link"),c.jsx(r,{ref:s,className:N(e,t),...n})));Ht.displayName="AlertLink";const Gn={[re]:"show",[ie]:"show"},Qe=T.forwardRef(({className:e,children:t,transitionClasses:r={},onEnter:n,...s},o)=>{const a={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...s},l=w.useCallback((u,f)=>{Rn(u),n?.(u,f)},[n]);return c.jsx(Ut,{ref:o,addEndListener:Tn,...a,onEnter:l,childRef:vn(t),children:(u,f)=>T.cloneElement(t,{...f,className:N("fade",e,t.props.className,Gn[u],r[u])})})});Qe.displayName="Fade";const Wn={"aria-label":S.string,onClick:S.func,variant:S.oneOf(["white"])},st=T.forwardRef(({className:e,variant:t,"aria-label":r="Close",...n},s)=>c.jsx("button",{ref:s,type:"button",className:N("btn-close",t&&`btn-close-${t}`,e),"aria-label":r,...n}));st.displayName="CloseButton";st.propTypes=Wn;const Jt=T.forwardRef((e,t)=>{const{bsPrefix:r,show:n=!0,closeLabel:s="Close alert",closeVariant:o,className:a,children:l,variant:u="primary",onClose:f,dismissible:p,transition:h=Qe,...y}=Xr(e,{show:"onClose"}),_=F(r,"alert"),I=Bn(P=>{f&&f(!1,P)}),v=h===!0?Qe:h,k=c.jsxs("div",{role:"alert",...v?void 0:y,ref:t,className:N(a,_,u&&`${_}-${u}`,p&&`${_}-dismissible`),children:[p&&c.jsx(st,{onClick:I,"aria-label":s,variant:o}),l]});return v?c.jsx(v,{unmountOnExit:!0,...y,ref:void 0,in:n,children:k}):n?k:null});Jt.displayName="Alert";const jt=Object.assign(Jt,{Link:Ht,Heading:Vt}),he=T.forwardRef(({bsPrefix:e,bg:t="primary",pill:r=!1,text:n,className:s,as:o="span",...a},l)=>{const u=F(e,"badge");return c.jsx(o,{ref:l,...a,className:N(s,u,r&&"rounded-pill",n&&`text-${n}`,t&&`bg-${t}`)})});he.displayName="Badge";const K=T.forwardRef(({as:e,bsPrefix:t,variant:r="primary",size:n,active:s=!1,disabled:o=!1,className:a,...l},u)=>{const f=F(t,"btn"),[p,{tagName:h}]=ot({tagName:e,disabled:o,...l}),y=h;return c.jsx(y,{...p,...l,ref:u,disabled:o,className:N(a,f,s&&"active",r&&`${f}-${r}`,n&&`${f}-${n}`,l.href&&o&&"disabled")})});K.displayName="Button";const et=T.forwardRef(({bsPrefix:e,size:t,vertical:r=!1,className:n,role:s="group",as:o="div",...a},l)=>{const u=F(e,"btn-group");let f=u;return r&&(f=`${u}-vertical`),c.jsx(o,{...a,ref:l,role:s,className:N(n,f,t&&`${u}-${t}`)})});et.displayName="ButtonGroup";const at=T.forwardRef(({className:e,bsPrefix:t,as:r="div",...n},s)=>(t=F(t,"card-body"),c.jsx(r,{ref:s,className:N(e,t),...n})));at.displayName="CardBody";const Kt=T.forwardRef(({className:e,bsPrefix:t,as:r="div",...n},s)=>(t=F(t,"card-footer"),c.jsx(r,{ref:s,className:N(e,t),...n})));Kt.displayName="CardFooter";const Zt=T.createContext(null);Zt.displayName="CardHeaderContext";const Qt=T.forwardRef(({bsPrefix:e,className:t,as:r="div",...n},s)=>{const o=F(e,"card-header"),a=w.useMemo(()=>({cardHeaderBsPrefix:o}),[o]);return c.jsx(Zt.Provider,{value:a,children:c.jsx(r,{ref:s,...n,className:N(t,o)})})});Qt.displayName="CardHeader";const er=T.forwardRef(({bsPrefix:e,className:t,variant:r,as:n="img",...s},o)=>{const a=F(e,"card-img");return c.jsx(n,{ref:o,className:N(r?`${a}-${r}`:a,t),...s})});er.displayName="CardImg";const tr=T.forwardRef(({className:e,bsPrefix:t,as:r="div",...n},s)=>(t=F(t,"card-img-overlay"),c.jsx(r,{ref:s,className:N(e,t),...n})));tr.displayName="CardImgOverlay";const rr=T.forwardRef(({className:e,bsPrefix:t,as:r="a",...n},s)=>(t=F(t,"card-link"),c.jsx(r,{ref:s,className:N(e,t),...n})));rr.displayName="CardLink";const qn=nt("h6"),nr=T.forwardRef(({className:e,bsPrefix:t,as:r=qn,...n},s)=>(t=F(t,"card-subtitle"),c.jsx(r,{ref:s,className:N(e,t),...n})));nr.displayName="CardSubtitle";const or=T.forwardRef(({className:e,bsPrefix:t,as:r="p",...n},s)=>(t=F(t,"card-text"),c.jsx(r,{ref:s,className:N(e,t),...n})));or.displayName="CardText";const Un=nt("h5"),sr=T.forwardRef(({className:e,bsPrefix:t,as:r=Un,...n},s)=>(t=F(t,"card-title"),c.jsx(r,{ref:s,className:N(e,t),...n})));sr.displayName="CardTitle";const ar=T.forwardRef(({bsPrefix:e,className:t,bg:r,text:n,border:s,body:o=!1,children:a,as:l="div",...u},f)=>{const p=F(e,"card");return c.jsx(l,{ref:f,...u,className:N(t,p,r&&`bg-${r}`,n&&`text-${n}`,s&&`border-${s}`),children:o?c.jsx(at,{children:a}):a})});ar.displayName="Card";const we=Object.assign(ar,{Img:er,Title:sr,Subtitle:nr,Body:at,Link:rr,Text:or,Header:Qt,Footer:Kt,ImgOverlay:tr});function Yn(e,t){return T.Children.toArray(e).some(r=>T.isValidElement(r)&&r.type===t)}function Vn({as:e,bsPrefix:t,className:r,...n}){t=F(t,"col");const s=At(),o=Dt(),a=[],l=[];return s.forEach(u=>{const f=n[u];delete n[u];let p,h,y;typeof f=="object"&&f!=null?{span:p,offset:h,order:y}=f:p=f;const _=u!==o?`-${u}`:"";p&&a.push(p===!0?`${t}${_}`:`${t}${_}-${p}`),y!=null&&l.push(`order${_}-${y}`),h!=null&&l.push(`offset${_}-${h}`)}),[{...n,className:N(r,...a,...l)},{as:e,bsPrefix:t,spans:a}]}const oe=T.forwardRef((e,t)=>{const[{className:r,...n},{as:s="div",bsPrefix:o,spans:a}]=Vn(e);return c.jsx(s,{...n,ref:t,className:N(r,!a.length&&o)})});oe.displayName="Col";const ir=T.forwardRef(({bsPrefix:e,fluid:t=!1,as:r="div",className:n,...s},o)=>{const a=F(e,"container"),l=typeof t=="string"?`-${t}`:"-fluid";return c.jsx(r,{ref:o,...s,className:N(n,t?`${a}${l}`:a)})});ir.displayName="Container";var Ye,Mt;function Xn(){if(Mt)return Ye;Mt=1;var e=process.env.NODE_ENV!=="production",t=function(){};if(e){var r=function(s,o){var a=arguments.length;o=new Array(a>1?a-1:0);for(var l=1;l<a;l++)o[l-1]=arguments[l];var u=0,f="Warning: "+s.replace(/%s/g,function(){return o[u++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};t=function(n,s,o){var a=arguments.length;o=new Array(a>2?a-2:0);for(var l=2;l<a;l++)o[l-2]=arguments[l];if(s===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");n||r.apply(null,[s].concat(o))}}return Ye=t,Ye}var Hn=Xn();const lr=Pe(Hn),Jn={type:S.string,tooltip:S.bool,as:S.elementType},$e=T.forwardRef(({as:e="div",className:t,type:r="valid",tooltip:n=!1,...s},o)=>c.jsx(e,{...s,ref:o,className:N(t,`${r}-${n?"tooltip":"feedback"}`)}));$e.displayName="Feedback";$e.propTypes=Jn;const Q=T.createContext({}),it=T.forwardRef(({id:e,bsPrefix:t,className:r,type:n="checkbox",isValid:s=!1,isInvalid:o=!1,as:a="input",...l},u)=>{const{controlId:f}=w.useContext(Q);return t=F(t,"form-check-input"),c.jsx(a,{...l,ref:u,type:n,id:e||f,className:N(r,t,s&&"is-valid",o&&"is-invalid")})});it.displayName="FormCheckInput";const Be=T.forwardRef(({bsPrefix:e,className:t,htmlFor:r,...n},s)=>{const{controlId:o}=w.useContext(Q);return e=F(e,"form-check-label"),c.jsx("label",{...n,ref:s,htmlFor:r||o,className:N(t,e)})});Be.displayName="FormCheckLabel";const cr=T.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:r,inline:n=!1,reverse:s=!1,disabled:o=!1,isValid:a=!1,isInvalid:l=!1,feedbackTooltip:u=!1,feedback:f,feedbackType:p,className:h,style:y,title:_="",type:I="checkbox",label:v,children:k,as:P="input",...G},M)=>{t=F(t,"form-check"),r=F(r,"form-switch");const{controlId:L}=w.useContext(Q),m=w.useMemo(()=>({controlId:e||L}),[L,e]),W=!k&&v!=null&&v!==!1||Yn(k,Be),V=c.jsx(it,{...G,type:I==="switch"?"checkbox":I,ref:M,isValid:a,isInvalid:l,disabled:o,as:P});return c.jsx(Q.Provider,{value:m,children:c.jsx("div",{style:y,className:N(h,W&&t,n&&`${t}-inline`,s&&`${t}-reverse`,I==="switch"&&r),children:k||c.jsxs(c.Fragment,{children:[V,W&&c.jsx(Be,{title:_,children:v}),f&&c.jsx($e,{type:p,tooltip:u,children:f})]})})})});cr.displayName="FormCheck";const ze=Object.assign(cr,{Input:it,Label:Be}),ur=T.forwardRef(({bsPrefix:e,type:t,size:r,htmlSize:n,id:s,className:o,isValid:a=!1,isInvalid:l=!1,plaintext:u,readOnly:f,as:p="input",...h},y)=>{const{controlId:_}=w.useContext(Q);return e=F(e,"form-control"),process.env.NODE_ENV!=="production"&&lr(_==null||!s,"`controlId` is ignored on `<FormControl>` when `id` is specified."),c.jsx(p,{...h,type:t,size:n,ref:y,readOnly:f,id:s||_,className:N(o,u?`${e}-plaintext`:e,r&&`${e}-${r}`,t==="color"&&`${e}-color`,a&&"is-valid",l&&"is-invalid")})});ur.displayName="FormControl";const Kn=Object.assign(ur,{Feedback:$e}),fr=T.forwardRef(({className:e,bsPrefix:t,as:r="div",...n},s)=>(t=F(t,"form-floating"),c.jsx(r,{ref:s,className:N(e,t),...n})));fr.displayName="FormFloating";const lt=T.forwardRef(({controlId:e,as:t="div",...r},n)=>{const s=w.useMemo(()=>({controlId:e}),[e]);return c.jsx(Q.Provider,{value:s,children:c.jsx(t,{...r,ref:n})})});lt.displayName="FormGroup";const dr=T.forwardRef(({as:e="label",bsPrefix:t,column:r=!1,visuallyHidden:n=!1,className:s,htmlFor:o,...a},l)=>{const{controlId:u}=w.useContext(Q);t=F(t,"form-label");let f="col-form-label";typeof r=="string"&&(f=`${f} ${f}-${r}`);const p=N(s,t,n&&"visually-hidden",r&&f);return process.env.NODE_ENV!=="production"&&lr(u==null||!o,"`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified."),o=o||u,r?c.jsx(oe,{ref:l,as:"label",className:p,htmlFor:o,...a}):c.jsx(e,{ref:l,className:p,htmlFor:o,...a})});dr.displayName="FormLabel";const pr=T.forwardRef(({bsPrefix:e,className:t,id:r,...n},s)=>{const{controlId:o}=w.useContext(Q);return e=F(e,"form-range"),c.jsx("input",{...n,type:"range",ref:s,className:N(t,e),id:r||o})});pr.displayName="FormRange";const mr=T.forwardRef(({bsPrefix:e,size:t,htmlSize:r,className:n,isValid:s=!1,isInvalid:o=!1,id:a,...l},u)=>{const{controlId:f}=w.useContext(Q);return e=F(e,"form-select"),c.jsx("select",{...l,size:r,ref:u,className:N(n,e,t&&`${e}-${t}`,s&&"is-valid",o&&"is-invalid"),id:a||f})});mr.displayName="FormSelect";const hr=T.forwardRef(({bsPrefix:e,className:t,as:r="small",muted:n,...s},o)=>(e=F(e,"form-text"),c.jsx(r,{...s,ref:o,className:N(t,e,n&&"text-muted")})));hr.displayName="FormText";const yr=T.forwardRef((e,t)=>c.jsx(ze,{...e,ref:t,type:"switch"}));yr.displayName="Switch";const Zn=Object.assign(yr,{Input:ze.Input,Label:ze.Label}),gr=T.forwardRef(({bsPrefix:e,className:t,children:r,controlId:n,label:s,...o},a)=>(e=F(e,"form-floating"),c.jsxs(lt,{ref:a,className:N(t,e),controlId:n,...o,children:[r,c.jsx("label",{htmlFor:n,children:s})]})));gr.displayName="FloatingLabel";const Qn={_ref:S.any,validated:S.bool,as:S.elementType},ct=T.forwardRef(({className:e,validated:t,as:r="form",...n},s)=>c.jsx(r,{...n,ref:s,className:N(e,t&&"was-validated")}));ct.displayName="Form";ct.propTypes=Qn;const Ot=Object.assign(ct,{Group:lt,Control:Kn,Floating:fr,Check:ze,Switch:Zn,Label:dr,Text:hr,Range:pr,Select:mr,FloatingLabel:gr}),Ne=T.forwardRef(({bsPrefix:e,className:t,as:r="div",...n},s)=>{const o=F(e,"row"),a=At(),l=Dt(),u=`${o}-cols`,f=[];return a.forEach(p=>{const h=n[p];delete n[p];let y;h!=null&&typeof h=="object"?{cols:y}=h:y=h;const _=p!==l?`-${p}`:"";y!=null&&f.push(`${u}${_}-${y}`)}),c.jsx(r,{ref:s,...n,className:N(t,o,...f)})});Ne.displayName="Row";class vr extends w.Component{createMazeGrid(){const{width:t,height:r,walls:n,finishPosition:s}=this.props.config,o=[];for(let a=0;a<r;a++){o[a]=[];for(let l=0;l<t;l++){const u=n.some(p=>p.x===l&&p.y===a),f=s.x===l&&s.y===a;o[a][l]={isWall:u,isFinish:f,isSpider:!1,isPath:!u}}}return o}render(){const{config:t,cellSize:r}=this.props,{width:n,height:s}=t,o=this.createMazeGrid();return c.jsx("div",{style:{position:"relative",width:n*r,height:s*r,border:"2px solid #333",backgroundColor:"#f0f0f0"},children:o.map((a,l)=>a.map((u,f)=>c.jsxs("div",{style:{position:"absolute",left:f*r,top:l*r,width:r,height:r,backgroundColor:u.isWall?"#333":u.isFinish?"#90EE90":"#f0f0f0",border:"1px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold"},children:[u.isFinish&&c.jsx("div",{style:{width:"80%",height:"80%",backgroundColor:"#32CD32",borderRadius:"50%",border:"3px solid #228B22",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"14px",fontWeight:"bold"},children:"🎯"}),u.isWall&&c.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:"#333",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"12px"},children:"🧱"})]},`${f}-${l}`)))})}}class xr extends w.Component{render(){const{position:t,direction:r,size:n}=this.props,s=n,a={north:0,east:90,south:180,west:270}[r];return c.jsx("div",{style:{position:"absolute",left:t.x*s+s/2,top:t.y*s+s/2,width:s*.8,height:s*.8,transform:`translate(-50%, -50%) rotate(${a}deg)`,transition:"all 0.3s ease-in-out",zIndex:10},children:c.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:"#8B4513",borderRadius:"50%",border:"2px solid #654321",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[c.jsx("div",{style:{width:"30%",height:"30%",backgroundColor:"#FF0000",borderRadius:"50%",position:"absolute",left:"20%",top:"20%",boxShadow:"0 0 5px #FF0000"}}),c.jsx("div",{style:{width:"30%",height:"30%",backgroundColor:"#FF0000",borderRadius:"50%",position:"absolute",right:"20%",top:"20%",boxShadow:"0 0 5px #FF0000"}})]})})}}function kr(){console.log("[MazeBlocks] 🧩 Starting maze blocks registration..."),console.log("[MazeBlocks] 📊 Debug info before registration:",ce());try{const e=Oe();console.log("[MazeBlocks] ✅ Blockly instance obtained:",!!e),console.log("[MazeBlocks] 🔍 Blockly.Blocks state:",{hasBlocks:!!e.Blocks,blocksType:typeof e.Blocks,existingBlocks:e.Blocks?Object.keys(e.Blocks).slice(0,10):"none"}),console.log("[MazeBlocks] 📝 Registering maze_move_forward block..."),e.Blocks.maze_move_forward={init(){this.appendDummyInput().appendField("Move Forward"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Move the spider forward one step"),this.setHelpUrl("")}},console.log("[MazeBlocks] 📝 Registering maze_turn_left block..."),e.Blocks.maze_turn_left={init(){this.appendDummyInput().appendField("🔄 Turn Left"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 90 degrees to the left"),this.setHelpUrl("")}},console.log("[MazeBlocks] 📝 Registering maze_turn_right block..."),e.Blocks.maze_turn_right={init(){this.appendDummyInput().appendField("🔄 Turn Right"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 90 degrees to the right"),this.setHelpUrl("")}},console.log("[MazeBlocks] 📝 Registering maze_turn_around block..."),e.Blocks.maze_turn_around={init(){this.appendDummyInput().appendField("🔄 Turn Around"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(92),this.setTooltip("Turn the spider 180 degrees around"),this.setHelpUrl("")}},console.log("[MazeBlocks] ✅ All maze blocks registered successfully"),console.log("[MazeBlocks] 📊 Final blocks state:",{hasBlocks:!!e.Blocks,registeredBlocks:Object.keys(e.Blocks).filter(t=>t.startsWith("maze_"))})}catch(e){throw console.error("[MazeBlocks] ❌ Failed to register maze blocks:",e),console.error("[MazeBlocks] 📋 Error details:",{message:e.message,stack:e.stack,name:e.name}),console.log("[MazeBlocks] 📊 Debug info at error:",ce()),e}}class br extends w.Component{constructor(t){super(t),this.state={workspace:null,isInitialized:!1},this.onAnyChange=this.onAnyChange.bind(this)}componentDidMount(){console.log("[MazeBlocklyContainer] 🚀 Component mounted, starting initialization..."),console.log("[MazeBlocklyContainer] 📊 Pre-initialization debug info:",ce()),this.initializeBlockly()}componentDidUpdate(t){t.config.toolbox!==this.props.config.toolbox&&(console.log("[MazeBlocklyContainer] 🔄 Toolbox changed, reinitializing..."),console.log("[MazeBlocklyContainer] 📊 Pre-reinitialization debug info:",ce()),this.disposeWorkspace(),this.initializeBlockly()),t.config.initialXml!==this.props.config.initialXml&&this.workspace&&(console.log("[MazeBlocklyContainer] 📝 Initial XML changed, reloading..."),this.loadXml(this.props.config.initialXml))}componentWillUnmount(){this.disposeWorkspace()}workspace=null;blocklyDivRef=w.createRef();async initializeBlockly(){if(!this.blocklyDivRef.current){console.error("[MazeBlocklyContainer] Blockly div ref is not available");return}try{console.log("[MazeBlocklyContainer] Starting Blockly initialization..."),console.log("[MazeBlocklyContainer] Calling initializeBlockly()..."),await Bt(),console.log("[MazeBlocklyContainer] Blockly initialization completed"),console.log("[MazeBlocklyContainer] Registering maze blocks..."),kr(),console.log("[MazeBlocklyContainer] Maze blocks registered"),console.log("[MazeBlocklyContainer] Registering maze generators..."),this.registerMazeGenerators(),console.log("[MazeBlocklyContainer] Maze generators registered"),console.log("[MazeBlocklyContainer] Getting Blockly instance...");const t=Oe();console.log("[MazeBlocklyContainer] Blockly instance obtained:",!!t);const r=this.props.config.toolbox;console.log("[MazeBlocklyContainer] Parsing toolbox XML...");const n=t.utils.xml.textToDom(r);console.log("[MazeBlocklyContainer] Toolbox XML parsed successfully"),console.log("[MazeBlocklyContainer] Injecting Blockly workspace..."),this.workspace=t.inject(this.blocklyDivRef.current,{toolbox:n,scrollbars:!0,trashcan:!0,grid:{spacing:20,length:3,colour:"#ccc",snap:!0},zoom:{controls:!0,wheel:!0,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2}}),console.log("[MazeBlocklyContainer] Workspace injected successfully:",!!this.workspace),console.log("[MazeBlocklyContainer] Loading initial XML..."),this.loadXml(this.props.config.initialXml),console.log("[MazeBlocklyContainer] Initial XML loaded"),console.log("[MazeBlocklyContainer] Adding change listener..."),this.workspace.addChangeListener(this.onAnyChange),console.log("[MazeBlocklyContainer] Change listener added"),this.setState({workspace:this.workspace,isInitialized:!0}),this.props.onWorkspaceChange?.(this.workspace),console.log("[MazeBlocklyContainer] Generating initial code..."),setTimeout(()=>{this.generateCode()},100),console.log("[MazeBlocklyContainer] ✅ Initialization completed successfully"),console.log("[MazeBlocklyContainer] 📊 Post-initialization debug info:",ce())}catch(t){console.error("[MazeBlocklyContainer] ❌ Failed to initialize Blockly:",t),console.error("[MazeBlocklyContainer] 📋 Error details:",{message:t.message,stack:t.stack,name:t.name}),console.log("[MazeBlocklyContainer] 📊 Debug info at error:",ce())}}registerMazeGenerators(){console.log("[MazeBlocklyContainer] Starting maze generator registration...");try{console.log("[MazeBlocklyContainer] Getting JavaScript generator...");const t=Me();console.log("[MazeBlocklyContainer] JavaScript generator obtained:",!!t),console.log("[MazeBlocklyContainer] Registering generators via direct assignment..."),t.maze_move_forward=function(){return`moveForward();
|
|
47
|
-
`},t.maze_turn_left=function(){return`turnLeft();
|
|
48
|
-
`},t.maze_turn_right=function(){return`turnRight();
|
|
49
|
-
`},t.maze_turn_around=function(){return`turnAround();
|
|
50
|
-
`},console.log("[MazeBlocklyContainer] Direct assignment completed"),console.log("[MazeBlocklyContainer] Registering generators via forBlock property...");const r=t;r.forBlock?(r.forBlock.maze_move_forward=function(){return`moveForward();
|
|
51
|
-
`},r.forBlock.maze_turn_left=function(){return`turnLeft();
|
|
52
|
-
`},r.forBlock.maze_turn_right=function(){return`turnRight();
|
|
53
|
-
`},r.forBlock.maze_turn_around=function(){return`turnAround();
|
|
54
|
-
`},console.log("[MazeBlocklyContainer] forBlock registration completed")):console.log("[MazeBlocklyContainer] forBlock property not available, skipping"),console.log("[MazeBlocklyContainer] ✅ Maze generators registered successfully")}catch(t){console.error("[MazeBlocklyContainer] ❌ Failed to register maze generators:",t),console.error("[MazeBlocklyContainer] Error details:",t)}}disposeWorkspace(){this.workspace&&(this.workspace.dispose(),this.workspace=null,this.setState({workspace:null,isInitialized:!1}))}onAnyChange(t){if(!this.workspace)return;const r=t?.type||"";(r==="block_create"||r==="block_move"||r==="block_delete"||r==="block_change")&&(this.props.onWorkspaceChange?.(this.workspace),this.generateCode())}generateCode(){if(!(!this.workspace||!this.props.onCodeChange))try{console.log("Generating code for workspace:",this.workspace),console.log("Available blocks:",this.workspace.getAllBlocks(!1));const r=Me().workspaceToCode(this.workspace);console.log("Generated code:",r),this.props.onCodeChange(r)}catch(t){console.error("Failed to generate code:",t),console.error("Error details:",t)}}loadXml(t){if(!(!this.workspace||!t))try{const r=Oe(),n=r.utils.xml.textToDom(t);r.Xml.domToWorkspace(n,this.workspace)}catch(r){console.error("Failed to load XML:",r)}}executeCode(){if(!this.workspace)return[];try{console.log("Executing maze code..."),console.log("Workspace state:",this.workspace);const r=Me().workspaceToCode(this.workspace);console.log("Executing maze code:",r);const n=this.parseMovementCode(r);return console.log("Parsed movement commands:",n),this.props.onExecuteCode&&this.props.onExecuteCode(n),n}catch(t){return console.error("Failed to execute code:",t),console.error("Error details:",t),[]}}parseMovementCode(t){const r=[],n=t.split(`
|
|
55
|
-
`);for(const s of n){const o=s.trim();o.includes("moveForward()")?r.push({type:"move_forward",direction:"north"}):o.includes("turnLeft()")?r.push({type:"turn_left",direction:"north"}):o.includes("turnRight()")?r.push({type:"turn_right",direction:"north"}):o.includes("turnAround()")&&r.push({type:"turn_around",direction:"north"})}return r}getWorkspace(){return this.workspace}clearWorkspace(){this.workspace?.clear()}render(){const{className:t="",style:r={}}=this.props,{isInitialized:n}=this.state;return c.jsxs("div",{className:`maze-blockly-container ${t}`,style:{width:"100%",height:"400px",position:"relative",...r},children:[c.jsx("div",{ref:this.blocklyDivRef,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0}}),!n&&c.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"#666",fontSize:16},children:"Loading Blockly..."})]})}}const Cr=({config:e,onConfigChange:t,className:r})=>{const[n,s]=w.useState("wall"),[o,a]=w.useState(!1),l=(v,k)=>{const P={...e};switch(n){case"start":{P.spiderStart={x:v,y:k};break}case"finish":{P.finishPosition={x:v,y:k};break}case"wall":{P.walls.findIndex(M=>M.x===v&&M.y===k)===-1&&P.walls.push({x:v,y:k});break}case"empty":{P.walls=P.walls.filter(G=>!(G.x===v&&G.y===k));break}}t(P)},u=(v,k)=>{o&&n==="wall"&&l(v,k)},f=(v,k)=>e.walls.some(P=>P.x===v&&P.y===k),p=(v,k)=>e.spiderStart.x===v&&e.spiderStart.y===k,h=(v,k)=>e.finishPosition.x===v&&e.finishPosition.y===k,y=(v,k)=>p(v,k)?"start":h(v,k)?"finish":f(v,k)?"wall":"empty",_=()=>{const v={width:e.width,height:e.height,spiderStart:{x:1,y:1},finishPosition:{x:e.width-2,y:e.height-2},walls:[]},k=e.width*e.height,P=Math.floor(k*.2);for(let G=0;G<P;G++){const M=Math.floor(Math.random()*e.width),L=Math.floor(Math.random()*e.height);M===v.spiderStart.x&&L===v.spiderStart.y||M===v.finishPosition.x&&L===v.finishPosition.y||v.walls.push({x:M,y:L})}t(v)},I=()=>{const v={...e,walls:[]};t(v)};return c.jsxs(we,{className:r,children:[c.jsx(we.Header,{children:c.jsxs(Ne,{className:"align-items-center",children:[c.jsx(oe,{children:c.jsx("h5",{className:"mb-0",children:"Maze Editor"})}),c.jsx(oe,{xs:"auto",children:c.jsxs(et,{size:"sm",children:[c.jsx(K,{variant:n==="wall"?"primary":"outline-primary",onClick:()=>s("wall"),children:"Wall"}),c.jsx(K,{variant:n==="empty"?"primary":"outline-primary",onClick:()=>s("empty"),children:"Clear"}),c.jsx(K,{variant:n==="start"?"primary":"outline-primary",onClick:()=>s("start"),children:"Start"}),c.jsx(K,{variant:n==="finish"?"primary":"outline-primary",onClick:()=>s("finish"),children:"Finish"})]})}),c.jsx(oe,{xs:"auto",children:c.jsxs(et,{size:"sm",children:[c.jsx(K,{variant:"outline-secondary",onClick:_,children:"Regenerate"}),c.jsx(K,{variant:"outline-secondary",onClick:I,children:"Clear All"})]})})]})}),c.jsx(we.Body,{children:c.jsx("div",{className:"maze-grid",style:{display:"grid",gridTemplateColumns:`repeat(${e.width}, 30px)`,gap:"1px",backgroundColor:"#ccc",padding:"1px"},onMouseDown:()=>a(!0),onMouseUp:()=>a(!1),onMouseLeave:()=>a(!1),children:Array.from({length:e.height},(v,k)=>Array.from({length:e.width},(P,G)=>{const M=y(G,k);return c.jsxs("div",{className:`maze-cell ${M}`,style:{width:"30px",height:"30px",backgroundColor:M==="wall"?"#333":M==="start"?"#28a745":M==="finish"?"#dc3545":"#fff",border:"1px solid #ccc",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:M==="start"||M==="finish"?"white":"black"},onClick:()=>l(G,k),onMouseEnter:()=>u(G,k),title:`${M} at (${G}, ${k})`,children:[M==="start"&&"S",M==="finish"&&"F"]},`${G}-${k}`)}))})})]})};class eo extends w.Component{constructor(t){super(t),t.configuration&&(this.mazeConfig={...t.configuration}),this.state={gameState:{spiderPosition:{...this.mazeConfig.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:t.maxMoves||50},currentDirection:"east",isExecuting:!1,currentCommandIndex:0,generatedCode:"",minSteps:8,isGenerating:!1},t.configuration||this.generateMaze()}componentWillUnmount(){this.executionInterval&&clearInterval(this.executionInterval)}mazeConfig={width:10,height:8,spiderStart:{x:1,y:1},finishPosition:{x:8,y:6},walls:[]};blocklyConfig={allowedTypes:new Set(["maze_move_forward","maze_turn_left","maze_turn_right","maze_turn_around","controls_repeat","controls_if"]),limits:{maze_move_forward:20,maze_turn_left:10,maze_turn_right:10,maze_turn_around:5,controls_repeat:5,controls_if:3},toolbox:`
|
|
56
|
-
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display:none">
|
|
57
|
-
<category name="Movement" colour="#5CA65C">
|
|
58
|
-
<block type="maze_move_forward"></block>
|
|
59
|
-
<block type="maze_turn_left"></block>
|
|
60
|
-
<block type="maze_turn_right"></block>
|
|
61
|
-
<block type="maze_turn_around"></block>
|
|
62
|
-
</category>
|
|
63
|
-
<category name="Control" colour="#A65C81">
|
|
64
|
-
<block type="controls_repeat">
|
|
65
|
-
<field name="TIMES">3</field>
|
|
66
|
-
</block>
|
|
67
|
-
<block type="controls_if"></block>
|
|
68
|
-
</category>
|
|
69
|
-
</xml>
|
|
70
|
-
`,initialXml:`
|
|
71
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
72
|
-
<block type="maze_move_forward" x="20" y="20"></block>
|
|
73
|
-
</xml>
|
|
74
|
-
`};executionInterval=null;blocklyRef=w.createRef();generateMaze=()=>{this.setState({isGenerating:!0}),setTimeout(()=>{const t=this.createMazeWithMinSteps(this.state.minSteps);this.mazeConfig=t,this.setState({gameState:{spiderPosition:{...t.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:Math.max(50,(t.estimatedSteps||8)+10)},currentDirection:"east",isExecuting:!1,currentCommandIndex:0,isGenerating:!1}),this.blocklyRef.current&&this.blocklyRef.current.clearWorkspace()},100)};createMazeWithMinSteps(t){for(let o=0;o<50;o++){const a=this.generateRandomMaze(10,8),l=this.estimateOptimalSteps(a);if(l>=t&&this.isMazeSolvable(a))return{...a,estimatedSteps:l}}return this.generateFallbackMaze(10,8,t)}generateRandomMaze(t,r){const n=[],s={x:1,y:1},o={x:t-2,y:r-2},a=Math.floor(t*r*(.3+Math.random()*.1));for(let l=0;l<a;l++){const u=Math.floor(Math.random()*t),f=Math.floor(Math.random()*r);u===s.x&&f===s.y||u===o.x&&f===o.y||Math.abs(u-s.x)<=1&&Math.abs(f-s.y)<=1||Math.abs(u-o.x)<=1&&Math.abs(f-o.y)<=1||n.some(p=>p.x===u&&p.y===f)||n.push({x:u,y:f})}return{width:t,height:r,spiderStart:s,finishPosition:o,walls:n}}generateFallbackMaze(t,r,n){const s=[],o={x:1,y:1},a={x:t-2,y:r-2},l=[],u={...o};for(;u.x<a.x||u.y<a.y;)u.x<a.x&&(u.x++,l.push({...u})),u.y<a.y&&(u.y++,l.push({...u}));for(let f=0;f<Math.floor(n/2);f++){const p=Math.floor(Math.random()*(t-2))+1,h=Math.floor(Math.random()*(r-2))+1;!l.some(y=>y.x===p&&y.y===h)&&!s.some(y=>y.x===p&&y.y===h)&&s.push({x:p,y:h})}return{width:t,height:r,spiderStart:o,finishPosition:a,walls:s,estimatedSteps:n}}estimateOptimalSteps(t){const r=Math.abs(t.finishPosition.x-t.spiderStart.x)+Math.abs(t.finishPosition.y-t.spiderStart.y),n=Math.min(t.walls.length*.5,10);return Math.ceil(r+n)}isMazeSolvable(t){const r=new Set,n=[t.spiderStart];for(;n.length>0;){const s=n.shift(),o=`${s.x},${s.y}`;if(r.has(o))continue;if(r.add(o),s.x===t.finishPosition.x&&s.y===t.finishPosition.y)return!0;const a=[{x:s.x+1,y:s.y},{x:s.x-1,y:s.y},{x:s.x,y:s.y+1},{x:s.x,y:s.y-1}];for(const l of a)l.x>=0&&l.x<t.width&&l.y>=0&&l.y<t.height&&!t.walls.some(u=>u.x===l.x&&u.y===l.y)&&!r.has(`${l.x},${l.y}`)&&n.push(l)}return!1}handleCodeChange=t=>{this.setState({generatedCode:t})};handleConfigChange=t=>{this.mazeConfig=t,this.setState({gameState:{...this.state.gameState,spiderPosition:{...t.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0}}),this.props.onChange&&this.props.onChange(t)};handleExecuteCode=t=>{t.length!==0&&(this.setState({isExecuting:!0,currentCommandIndex:0}),this.executeCommands(t))};executeCommands(t){let r=0;this.executionInterval=setInterval(()=>{if(r>=t.length){this.stopExecution();return}const n=t[r];this.executeCommand(n),r++,this.setState({currentCommandIndex:r})},800)}executeCommand(t){switch(t.type){case"move_forward":this.moveSpiderForward();break;case"turn_left":this.turnSpider("left");break;case"turn_right":this.turnSpider("right");break;case"turn_around":this.turnSpider("around");break}}moveSpiderForward(){const{gameState:t,currentDirection:r}=this.state,n={...t.spiderPosition};switch(r){case"north":n.y=Math.max(0,n.y-1);break;case"south":n.y=Math.min(this.mazeConfig.height-1,n.y+1);break;case"east":n.x=Math.min(this.mazeConfig.width-1,n.x+1);break;case"west":n.x=Math.max(0,n.x-1);break}if(!this.isWall(n)){const s={...t,spiderPosition:n,moveCount:t.moveCount+1};if(this.isFinish(n)&&(s.isGameWon=!0,s.isGameOver=!0),s.moveCount>=t.maxMoves&&(s.isGameOver=!0),this.setState({gameState:s}),s.isGameOver&&this.props.onRunFinish){const o={steps:s.moveCount,reachedFinish:s.isGameWon,maxMovesExceeded:s.moveCount>=t.maxMoves,finalPosition:n,path:[],executionTime:0};this.props.onRunFinish(o)}}}turnSpider(t){const n={north:{left:"west",right:"east",around:"south"},south:{left:"east",right:"west",around:"north"},east:{left:"north",right:"south",around:"west"},west:{left:"south",right:"north",around:"east"}}[this.state.currentDirection][t];this.setState({currentDirection:n})}isWall(t){return this.mazeConfig.walls.some(r=>r.x===t.x&&r.y===t.y)}isFinish(t){return t.x===this.mazeConfig.finishPosition.x&&t.y===this.mazeConfig.finishPosition.y}stopExecution(){this.executionInterval&&(clearInterval(this.executionInterval),this.executionInterval=null),this.setState({isExecuting:!1})}resetGame=()=>{this.setState({gameState:{spiderPosition:{...this.mazeConfig.spiderStart},isGameWon:!1,isGameOver:!1,moveCount:0,maxMoves:Math.max(50,(this.mazeConfig.estimatedSteps||8)+10)},currentDirection:"east",isExecuting:!1,currentCommandIndex:0}),this.blocklyRef.current&&this.blocklyRef.current.clearWorkspace()};runCode=()=>{this.blocklyRef.current&&this.blocklyRef.current.executeCode()};handleGenerateNewMaze=()=>{this.generateMaze()};render(){const{gameState:t,currentDirection:r,isExecuting:n,generatedCode:s,isGenerating:o}=this.state,a=50;return c.jsx("div",{className:`maze-game ${this.props.className||""}`,children:c.jsx(ir,{fluid:!0,children:c.jsx(Ne,{children:c.jsx(oe,{children:c.jsx(we,{children:c.jsx(we.Body,{children:c.jsxs(Ne,{children:[c.jsxs(oe,{md:8,children:[c.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-3",children:[c.jsxs("div",{children:[c.jsxs(he,{bg:"primary",className:"me-2",children:["Moves: ",t.moveCount,"/",t.maxMoves]}),c.jsx(he,{bg:r==="north"?"success":"secondary",className:"me-1",children:"↑"}),c.jsx(he,{bg:r==="east"?"success":"secondary",className:"me-1",children:"→"}),c.jsx(he,{bg:r==="south"?"success":"secondary",className:"me-1",children:"↓"}),c.jsx(he,{bg:r==="west"?"success":"secondary",className:"me-1",children:"←"})]}),c.jsxs("div",{children:[c.jsx(K,{variant:"success",onClick:this.runCode,disabled:n||t.isGameOver,className:"me-2",children:n?"Running...":"▶️ Run Code"}),c.jsx(K,{variant:"outline-secondary",onClick:this.resetGame,disabled:n,className:"me-2",children:"🔄 Reset"})]})]}),this.props.isEditable&&c.jsxs("div",{className:"d-flex align-items-center mb-3 p-3 bg-light rounded",children:[c.jsxs("div",{className:"me-3",children:[c.jsx(Ot.Label,{className:"mb-1 fw-bold",children:"Steps:"}),c.jsx("div",{className:"text-muted",children:this.mazeConfig.estimatedSteps||"Calculating..."})]}),c.jsxs("div",{className:"me-3",children:[c.jsx(Ot.Label,{className:"mb-1 fw-bold",children:"Walls:"}),c.jsx("div",{className:"text-muted",children:this.mazeConfig.walls.length})]}),c.jsx(K,{variant:"primary",onClick:this.handleGenerateNewMaze,disabled:n||o,className:"ms-auto",children:o?"🔄 Generating...":"🎲 Generate New Maze"})]}),t.isGameWon&&c.jsx(jt,{variant:"success",className:"mb-3",children:"🎉 Congratulations! You've reached the finish! 🎯"}),t.isGameOver&&!t.isGameWon&&c.jsx(jt,{variant:"danger",className:"mb-3",children:"❌ Game Over! You've exceeded the maximum moves."}),this.props.isEditable&&c.jsx("div",{className:"mb-4",children:c.jsx(Cr,{config:this.mazeConfig,onConfigChange:this.handleConfigChange})}),c.jsxs("div",{style:{position:"relative",marginBottom:"20px"},children:[c.jsx(vr,{config:this.mazeConfig,cellSize:a}),c.jsx(xr,{position:t.spiderPosition,direction:r,size:a})]})]}),c.jsxs(oe,{md:4,children:[c.jsx("h5",{children:"Programming Blocks"}),c.jsx(br,{ref:this.blocklyRef,config:this.blocklyConfig,onCodeChange:this.handleCodeChange,onExecuteCode:this.handleExecuteCode,style:{height:"300px"}}),c.jsxs("div",{className:"mt-3",children:[c.jsx("h6",{children:"Generated Code:"}),c.jsx("pre",{className:"bg-light p-2 rounded",style:{fontSize:"12px",maxHeight:"150px",overflow:"auto"},children:s||"// No code generated yet"})]})]})]})})})})})})})}}exports.EditableMazeGrid=Cr;exports.MazeBlocklyContainer=br;exports.MazeGame=eo;exports.MazeGrid=vr;exports.Spider=xr;exports.capitalize=zt;exports.commonjsGlobal=Dr;exports.debounce=Sr;exports.deepClone=Ve;exports.formatDate=jr;exports.formatNumber=_r;exports.formatRelativeTime=Mr;exports.generateId=Rr;exports.getBlockly=Oe;exports.getBlocklyDebugInfo=ce;exports.getDefaultExportFromCjs=Pe;exports.getJavaScriptGenerator=Me;exports.getNestedValue=Ir;exports.initializeBlockly=Bt;exports.isBlocklyReady=tt;exports.isDeepEqual=Pt;exports.isValidEmail=zr;exports.isValidUrl=Nr;exports.mergeObjects=Nt;exports.registerMazeBlocks=kr;exports.removeEmptyValues=Pr;exports.resetBlocklyInitialization=wr;exports.retryWithBackoff=Ar;exports.setNestedValue=$r;exports.sleep=It;exports.throttle=Tr;exports.toTitleCase=Or;exports.truncate=Br;
|
|
75
|
-
//# sourceMappingURL=index-CRP4KubC.cjs.map
|