@jsonpages/core 1.0.42 → 1.0.44
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/index.d.ts +12 -4
- package/dist/jsonpages-core.js +5164 -5176
- package/dist/jsonpages-core.umd.cjs +50 -50
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(xe,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],j):(xe=typeof globalThis<"u"?globalThis:xe||self,j(xe.JsonPagesCore={},xe.React,xe.ReactRouterDOM,xe.z,xe.ReactDOM))})(this,(function(xe,j,He,je,ht){"use strict";function vi(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 E=vi(j),Rr=vi(ht),Ce={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",REQUEST_CLEAN_HTML:"jsonpages:request-clean-html",SEND_CLEAN_HTML:"jsonpages:send-clean-html",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready"};var pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Kn={exports:{}};/*!
|
|
2
2
|
|
|
3
3
|
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
4
4
|
<http://stuartk.com/jszip>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
JSZip uses the library pako released under the MIT license :
|
|
10
10
|
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
11
|
-
*/var
|
|
12
|
-
\0`,G+=i(z,2),G+=O.magic,G+=i(k,2),G+=i(S,2),G+=i(J.crc32,4),G+=i(J.compressedSize,4),G+=i(J.uncompressedSize,4),G+=i(I.length,2),G+=i(H.length,2),{fileRecord:f.LOCAL_FILE_HEADER+G+I+H,dirRecord:f.CENTRAL_FILE_HEADER+i(K,2)+G+i(Z.length,2)+"\0\0\0\0"+i(P,4)+i(b,4)+I+H+Z}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),f=r("../signature");function m(u,x,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=h,this.encodeFileName=b,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,l),m.prototype.push=function(u){var x=u.meta.percent||0,h=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,l.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:h?(x+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var x=this.streamFiles&&!u.file.dir;if(x){var h=s(u,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(u){this.accumulate=!1;var x=this.streamFiles&&!u.file.dir,h=s(u,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),x)this.push({data:(function(b){return f.DATA_DESCRIPTOR+i(b.crc32,4)+i(b.compressedSize,4)+i(b.uncompressedSize,4)})(u),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var u=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var h=this.bytesWritten-u,b=(function(v,w,k,S,C){var O=a.transformTo("string",C(S));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(v,2)+i(v,2)+i(w,4)+i(k,4)+i(O.length,2)+O})(this.dirRecords.length,h,u,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(u){this._sources.push(u);var x=this;return u.on("data",function(h){x.processChunk(h)}),u.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),u.on("error",function(h){x.error(h)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(u){var x=this._sources;if(!l.prototype.error.call(this,u))return!1;for(var h=0;h<x.length;h++)try{x[h].error(u)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var u=this._sources,x=0;x<u.length;x++)u[x].lock()},n.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,o){var i=r("../compressions"),s=r("./ZipFileWorker");o.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(m,u){f++;var x=(function(w,k){var S=w||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(u.options.compression,l.compression),h=u.options.compressionOptions||l.compressionOptions||{},b=u.dir,v=u.date;u._compressWorker(x,h).withStreamInfo("file",{name:m,dir:b,date:v,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(d)}),d.entriesCount=f}catch(m){d.error(m)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=r("./object")).loadAsync=r("./load"),i.support=r("./support"),i.defaults=r("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=r("./external"),n.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,o){var i=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function f(m){return new s.Promise(function(u,x){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){x(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}n.exports=function(m,u){var x=this;return u=i.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",m,!0,u.optimizedBinaryString,u.base64).then(function(h){var b=new l(u);return b.load(h),b}).then(function(h){var b=[s.Promise.resolve(h)],v=h.files;if(u.checkCRC32)for(var w=0;w<v.length;w++)b.push(f(v[w]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),v=b.files,w=0;w<v.length;w++){var k=v[w],S=k.fileNameStr,C=i.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:u.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return b.zipComment.length&&(x.comment=b.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,o){var i=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,o){var i=r("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var d=this;a.on("data",function(f,m){d.push(f)||d._helper.pause(),c&&c(m)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(r,n,o){function i(C,O,N){var I,D=a.getTypeOf(O),L=a.extend(N||{},d);L.date=L.date||new Date,L.compression!==null&&(L.compression=L.compression.toUpperCase()),typeof L.unixPermissions=="string"&&(L.unixPermissions=parseInt(L.unixPermissions,8)),L.unixPermissions&&16384&L.unixPermissions&&(L.dir=!0),L.dosPermissions&&16&L.dosPermissions&&(L.dir=!0),L.dir&&(C=v(C)),L.createFolders&&(I=b(C))&&w.call(this,I,!0);var Z=D==="string"&&L.binary===!1&&L.base64===!1;N&&N.binary!==void 0||(L.binary=!Z),(O instanceof f&&O.uncompressedSize===0||L.dir||!O||O.length===0)&&(L.base64=!1,L.binary=!0,O="",L.compression="STORE",D="string");var j=null;j=O instanceof f||O instanceof l?O:x.isNode&&x.isStream(O)?new h(C,O):a.prepareContent(C,O,L.binary,L.optimizedBinaryString,L.base64);var F=new m(C,j,L);this.files[C]=F}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),f=r("./compressedObject"),m=r("./zipObject"),u=r("./generate"),x=r("./nodejsUtils"),h=r("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var O=C.lastIndexOf("/");return 0<O?C.substring(0,O):""},v=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},w=function(C,O){return O=O!==void 0?O:d.createFolders,C=v(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:O}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var O,N,I;for(O in this.files)I=this.files[O],(N=O.slice(this.root.length,O.length))&&O.slice(0,this.root.length)===this.root&&C(N,I)},filter:function(C){var O=[];return this.forEach(function(N,I){C(N,I)&&O.push(I)}),O},file:function(C,O,N){if(arguments.length!==1)return C=this.root+C,i.call(this,C,O,N),this;if(k(C)){var I=C;return this.filter(function(L,Z){return!Z.dir&&I.test(L)})}var D=this.files[this.root+C];return D&&!D.dir?D:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(D,L){return L.dir&&C.test(D)});var O=this.root+C,N=w.call(this,O),I=this.clone();return I.root=N.name,I},remove:function(C){C=this.root+C;var O=this.files[C];if(O||(C.slice(-1)!=="/"&&(C+="/"),O=this.files[C]),O&&!O.dir)delete this.files[C];else for(var N=this.filter(function(D,L){return L.name.slice(0,C.length)===C}),I=0;I<N.length;I++)delete this.files[N[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var O,N={};try{if((N=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");a.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var I=N.comment||this.comment||"";O=u.generateWorker(this,N,I)}catch(D){(O=new l("error")).error(D)}return new c(O,N.type||"string",N.mimeType)},generateAsync:function(C,O){return this.generateInternalStream(C).accumulate(O)},generateNodeStream:function(C,O){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(O)}};n.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,o){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===d&&this.data[m+3]===f)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&d===m[2]&&f===m[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,o){var i=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,o){var i=r("./Uint8ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,o){var i=r("./ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,o){var i=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var m=i.getTypeOf(f);return i.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new c(f):s.uint8array?new d(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,o){var i=r("./GenericWorker"),s=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,o){var i=r("./GenericWorker"),s=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=i.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=i},{}],29:[function(r,n,o){var i=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(x,h){return new d.Promise(function(b,v){var w=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(O,N){w.push(O),h&&h(N)}).on("error",function(O){w=[],v(O)}).on("end",function(){try{var O=(function(N,I,D){switch(N){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),D);case"base64":return l.encode(I);default:return i.transformTo(N,I)}})(S,(function(N,I){var D,L=0,Z=null,j=0;for(D=0;D<I.length;D++)j+=I[D].length;switch(N){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(Z=new Uint8Array(j),D=0;D<I.length;D++)Z.set(I[D],L),L+=I[D].length;return Z;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+N+"'")}})(k,w),C);b(O)}catch(N){v(N)}w=[]}).resume()})}function u(x,h,b){var v=h;switch(h){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=h,this._mimeType=b,i.checkSupport(v),this._worker=x.pipe(new s(v)),x.lock()}catch(w){this._worker=new a("error"),this._worker.error(w)}}u.prototype={accumulate:function(x){return m(this,x)},on:function(x,h){var b=this;return x==="data"?this._worker.on(x,function(v){h.call(b,v.data,v.meta)}):this._worker.on(x,function(){i.delay(h,arguments,b)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},n.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,o){for(var i=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}o.utf8encode=function(u){return s.nodebuffer?a.newBufferFrom(u,"utf-8"):(function(x){var h,b,v,w,k,S=x.length,C=0;for(w=0;w<S;w++)(64512&(b=x.charCodeAt(w)))==55296&&w+1<S&&(64512&(v=x.charCodeAt(w+1)))==56320&&(b=65536+(b-55296<<10)+(v-56320),w++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),w=k=0;k<C;w++)(64512&(b=x.charCodeAt(w)))==55296&&w+1<S&&(64512&(v=x.charCodeAt(w+1)))==56320&&(b=65536+(b-55296<<10)+(v-56320),w++),b<128?h[k++]=b:(b<2048?h[k++]=192|b>>>6:(b<65536?h[k++]=224|b>>>12:(h[k++]=240|b>>>18,h[k++]=128|b>>>12&63),h[k++]=128|b>>>6&63),h[k++]=128|63&b);return h})(u)},o.utf8decode=function(u){return s.nodebuffer?i.transformTo("nodebuffer",u).toString("utf-8"):(function(x){var h,b,v,w,k=x.length,S=new Array(2*k);for(h=b=0;h<k;)if((v=x[h++])<128)S[b++]=v;else if(4<(w=c[v]))S[b++]=65533,h+=w-1;else{for(v&=w===2?31:w===3?15:7;1<w&&h<k;)v=v<<6|63&x[h++],w--;1<w?S[b++]=65533:v<65536?S[b++]=v:(v-=65536,S[b++]=55296|v>>10&1023,S[b++]=56320|1023&v)}return S.length!==b&&(S.subarray?S=S.subarray(0,b):S.length=b),i.applyFromCharCode(S)})(u=i.transformTo(s.uint8array?"uint8array":"array",u))},i.inherits(f,l),f.prototype.processChunk=function(u){var x=i.transformTo(s.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=x;(x=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),x.set(h,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var b=(function(w,k){var S;for((k=k||w.length)>w.length&&(k=w.length),S=k-1;0<=S&&(192&w[S])==128;)S--;return S<0||S===0?k:S+c[w[S]]>k?S:k})(x),v=x;b!==x.length&&(s.uint8array?(v=x.subarray(0,b),this.leftOver=x.subarray(b,x.length)):(v=x.slice(0,b),this.leftOver=x.slice(b,x.length))),this.push({data:o.utf8decode(v),meta:u.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,i.inherits(m,l),m.prototype.processChunk=function(u){this.push({data:o.utf8encode(u.data),meta:u.meta})},o.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,o){var i=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(h){return h}function d(h,b){for(var v=0;v<h.length;++v)b[v]=255&h.charCodeAt(v);return b}r("setimmediate"),o.newBlob=function(h,b){o.checkSupport("blob");try{return new Blob([h],{type:b})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(h),v.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(h,b,v){var w=[],k=0,S=h.length;if(S<=v)return String.fromCharCode.apply(null,h);for(;k<S;)b==="array"||b==="nodebuffer"?w.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+v,S)))):w.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+v,S)))),k+=v;return w.join("")},stringifyByChar:function(h){for(var b="",v=0;v<h.length;v++)b+=String.fromCharCode(h[v]);return b},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(h){var b=65536,v=o.getTypeOf(h),w=!0;if(v==="uint8array"?w=f.applyCanBeUsed.uint8array:v==="nodebuffer"&&(w=f.applyCanBeUsed.nodebuffer),w)for(;1<b;)try{return f.stringifyByChunk(h,v,b)}catch{b=Math.floor(b/2)}return f.stringifyByChar(h)}function u(h,b){for(var v=0;v<h.length;v++)b[v]=h[v];return b}o.applyFromCharCode=m;var x={};x.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return x.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},x.array={string:m,array:c,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(h)}},x.arraybuffer={string:function(h){return m(new Uint8Array(h))},array:function(h){return u(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:c,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(new Uint8Array(h))}},x.uint8array={string:m,array:function(h){return u(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:c,nodebuffer:function(h){return a.newBufferFrom(h)}},x.nodebuffer={string:m,array:function(h){return u(h,new Array(h.length))},arraybuffer:function(h){return x.nodebuffer.uint8array(h).buffer},uint8array:function(h){return u(h,new Uint8Array(h.length))},nodebuffer:c},o.transformTo=function(h,b){if(b=b||"",!h)return b;o.checkSupport(h);var v=o.getTypeOf(b);return x[v][h](b)},o.resolve=function(h){for(var b=h.split("/"),v=[],w=0;w<b.length;w++){var k=b[w];k==="."||k===""&&w!==0&&w!==b.length-1||(k===".."?v.pop():v.push(k))}return v.join("/")},o.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(h)?"nodebuffer":i.uint8array&&h instanceof Uint8Array?"uint8array":i.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(h){if(!i[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(h){var b,v,w="";for(v=0;v<(h||"").length;v++)w+="\\x"+((b=h.charCodeAt(v))<16?"0":"")+b.toString(16).toUpperCase();return w},o.delay=function(h,b,v){setImmediate(function(){h.apply(v||null,b||[])})},o.inherits=function(h,b){function v(){}v.prototype=b.prototype,h.prototype=new v},o.extend=function(){var h,b,v={};for(h=0;h<arguments.length;h++)for(b in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],b)&&v[b]===void 0&&(v[b]=arguments[h][b]);return v},o.prepareContent=function(h,b,v,w,k){return l.Promise.resolve(b).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,O){var N=new FileReader;N.onload=function(I){C(I.target.result)},N.onerror=function(I){O(I.target.error)},N.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):v&&w!==!0&&(S=(function(O){return d(O,i.uint8array?new Uint8Array(O.length):new Array(O.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(f)+")")}},isSignature:function(f,m){var u=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===m;return this.reader.setIndex(u),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",u=s.transformTo(m,f);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,m,u,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),m=this.reader.readInt(4),u=this.reader.readData(m),this.zip64ExtensibleData[f]={id:f,length:m,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,m;for(f=0;f<this.files.length;f++)m=this.files[f],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var m=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var x=m-u;if(0<x)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=i(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),f=r("./support");function m(u,x){this.options=u,this.loadOptions=x}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var x,h;if(u.skip(22),this.fileNameLength=u.readInt(2),h=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(b){for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)&&d[v].magic===b)return d[v];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var x=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(x),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var x,h,b,v=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<v;)x=u.readInt(2),h=u.readInt(2),b=u.readData(h),this.extraFields[x]={id:x,length:h,value:b};u.setIndex(v)},handleUTF8:function(){var u=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var h=s.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var v=s.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var x=i(u.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var x=i(u.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(u.length-5))}return null}},n.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,o){function i(x,h,b){this.name=x,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=h,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");i.prototype={internalStream:function(x){var h=null,b="string";try{if(!x)throw new Error("No output type specified.");var v=(b=x.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var w=!this._dataBinary;w&&!v&&(h=h.pipe(new l.Utf8EncodeWorker)),!w&&v&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(x,h){return this.internalStream(x).accumulate(h)},nodeStream:function(x,h){return this.internalStream(x||"nodebuffer").toNodejsStream(h)},_compressWorker:function(x,h){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,x,h)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<f.length;u++)i.prototype[f[u]]=m;n.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,d=new l(x),f=i.document.createTextNode("");d.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var h=i.document.createElement("script");h.onreadystatechange=function(){x(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(x,0)};else{var m=new i.MessageChannel;m.port1.onmessage=x,s=function(){m.port2.postMessage(0)}}var u=[];function x(){var h,b;a=!0;for(var v=u.length;v;){for(b=u,u=[],h=-1;++h<v;)b[h]();v=u.length}a=!1}n.exports=function(h){u.push(h)!==1||a||s()}}).call(this,typeof mt<"u"?mt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,o){var i=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function f(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,v!==s&&h(this,v)}function m(v,w,k){this.promise=v,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function u(v,w,k){i(function(){var S;try{S=w(k)}catch(C){return a.reject(v,C)}S===v?a.reject(v,new TypeError("Cannot resolve promise with itself")):a.resolve(v,S)})}function x(v){var w=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof w=="function")return function(){w.apply(v,arguments)}}function h(v,w){var k=!1;function S(N){k||(k=!0,a.reject(v,N))}function C(N){k||(k=!0,a.resolve(v,N))}var O=b(function(){w(C,S)});O.status==="error"&&S(O.value)}function b(v,w){var k={};try{k.value=v(w),k.status="success"}catch(S){k.status="error",k.value=S}return k}(n.exports=f).prototype.finally=function(v){if(typeof v!="function")return this;var w=this.constructor;return this.then(function(k){return w.resolve(v()).then(function(){return k})},function(k){return w.resolve(v()).then(function(){throw k})})},f.prototype.catch=function(v){return this.then(null,v)},f.prototype.then=function(v,w){if(typeof v!="function"&&this.state===c||typeof w!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?u(k,this.state===c?v:w,this.outcome):this.queue.push(new m(k,v,w)),k},m.prototype.callFulfilled=function(v){a.resolve(this.promise,v)},m.prototype.otherCallFulfilled=function(v){u(this.promise,this.onFulfilled,v)},m.prototype.callRejected=function(v){a.reject(this.promise,v)},m.prototype.otherCallRejected=function(v){u(this.promise,this.onRejected,v)},a.resolve=function(v,w){var k=b(x,w);if(k.status==="error")return a.reject(v,k.value);var S=k.value;if(S)h(v,S);else{v.state=c,v.outcome=w;for(var C=-1,O=v.queue.length;++C<O;)v.queue[C].callFulfilled(w)}return v},a.reject=function(v,w){v.state=l,v.outcome=w;for(var k=-1,S=v.queue.length;++k<S;)v.queue[k].callRejected(w);return v},f.resolve=function(v){return v instanceof this?v:a.resolve(new this(s),v)},f.reject=function(v){var w=new this(s);return a.reject(w,v)},f.all=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=v.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),O=0,N=-1,I=new this(s);++N<k;)D(v[N],N);return I;function D(L,Z){w.resolve(L).then(function(j){C[Z]=j,++O!==k||S||(S=!0,a.resolve(I,C))},function(j){S||(S=!0,a.reject(I,j))})}},f.race=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=v.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,O=new this(s);++C<k;)N=v[C],w.resolve(N).then(function(I){S||(S=!0,a.resolve(O,I))},function(I){S||(S=!0,a.reject(O,I))});var N;return O}},{immediate:36}],38:[function(r,n,o){var i={};(0,r("./lib/utils/common").assign)(i,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,o){var i=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,f=0,m=-1,u=0,x=8;function h(v){if(!(this instanceof h))return new h(v);this.options=s.assign({level:m,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},v||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(k!==f)throw new Error(l[k]);if(w.header&&i.deflateSetHeader(this.strm,w.header),w.dictionary){var S;if(S=typeof w.dictionary=="string"?a.string2buf(w.dictionary):d.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==f)throw new Error(l[k]);this._dict_set=!0}}function b(v,w){var k=new h(w);if(k.push(v,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(v,w){var k,S,C=this.strm,O=this.options.chunkSize;if(this.ended)return!1;S=w===~~w?w:w===!0?4:0,typeof v=="string"?C.input=a.string2buf(v):d.call(v)==="[object ArrayBuffer]"?C.input=new Uint8Array(v):C.input=v,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(O),C.next_out=0,C.avail_out=O),(k=i.deflate(C,S))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):S!==2||(this.onEnd(f),!(C.avail_out=0))},h.prototype.onData=function(v){this.chunks.push(v)},h.prototype.onEnd=function(v){v===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},o.Deflate=h,o.deflate=b,o.deflateRaw=function(v,w){return(w=w||{}).raw=!0,b(v,w)},o.gzip=function(v,w){return(w=w||{}).gzip=!0,b(v,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,o){var i=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),f=r("./zlib/gzheader"),m=Object.prototype.toString;function u(h){if(!(this instanceof u))return new u(h);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},h||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||h&&h.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var v=i.inflateInit2(this.strm,b.windowBits);if(v!==l.Z_OK)throw new Error(c[v]);this.header=new f,i.inflateGetHeader(this.strm,this.header)}function x(h,b){var v=new u(b);if(v.push(h,!0),v.err)throw v.msg||c[v.err];return v.result}u.prototype.push=function(h,b){var v,w,k,S,C,O,N=this.strm,I=this.options.chunkSize,D=this.options.dictionary,L=!1;if(this.ended)return!1;w=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof h=="string"?N.input=a.binstring2buf(h):m.call(h)==="[object ArrayBuffer]"?N.input=new Uint8Array(h):N.input=h,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new s.Buf8(I),N.next_out=0,N.avail_out=I),(v=i.inflate(N,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&D&&(O=typeof D=="string"?a.string2buf(D):m.call(D)==="[object ArrayBuffer]"?new Uint8Array(D):D,v=i.inflateSetDictionary(this.strm,O)),v===l.Z_BUF_ERROR&&L===!0&&(v=l.Z_OK,L=!1),v!==l.Z_STREAM_END&&v!==l.Z_OK)return this.onEnd(v),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&v!==l.Z_STREAM_END&&(N.avail_in!==0||w!==l.Z_FINISH&&w!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(N.output,N.next_out),S=N.next_out-k,C=a.buf2string(N.output,k),N.next_out=S,N.avail_out=I-S,S&&s.arraySet(N.output,N.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(L=!0)}while((0<N.avail_in||N.avail_out===0)&&v!==l.Z_STREAM_END);return v===l.Z_STREAM_END&&(w=l.Z_FINISH),w===l.Z_FINISH?(v=i.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l.Z_OK):w!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(N.avail_out=0))},u.prototype.onData=function(h){this.chunks.push(h)},u.prototype.onEnd=function(h){h===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},o.Inflate=u,o.inflate=x,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,x(h,b)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(l[f]=d[f])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,f,m){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+f),m);else for(var u=0;u<f;u++)l[m+u]=c[d+u]},flattenChunks:function(l){var c,d,f,m,u,x;for(c=f=0,d=l.length;c<d;c++)f+=l[c].length;for(x=new Uint8Array(f),c=m=0,d=l.length;c<d;c++)u=l[c],x.set(u,m),m+=u.length;return x}},a={arraySet:function(l,c,d,f,m){for(var u=0;u<f;u++)l[m+u]=c[d+u]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(r,n,o){var i=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(f,m){if(m<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(f,m));for(var u="",x=0;x<m;x++)u+=String.fromCharCode(f[x]);return u}l[254]=l[254]=1,o.string2buf=function(f){var m,u,x,h,b,v=f.length,w=0;for(h=0;h<v;h++)(64512&(u=f.charCodeAt(h)))==55296&&h+1<v&&(64512&(x=f.charCodeAt(h+1)))==56320&&(u=65536+(u-55296<<10)+(x-56320),h++),w+=u<128?1:u<2048?2:u<65536?3:4;for(m=new i.Buf8(w),h=b=0;b<w;h++)(64512&(u=f.charCodeAt(h)))==55296&&h+1<v&&(64512&(x=f.charCodeAt(h+1)))==56320&&(u=65536+(u-55296<<10)+(x-56320),h++),u<128?m[b++]=u:(u<2048?m[b++]=192|u>>>6:(u<65536?m[b++]=224|u>>>12:(m[b++]=240|u>>>18,m[b++]=128|u>>>12&63),m[b++]=128|u>>>6&63),m[b++]=128|63&u);return m},o.buf2binstring=function(f){return d(f,f.length)},o.binstring2buf=function(f){for(var m=new i.Buf8(f.length),u=0,x=m.length;u<x;u++)m[u]=f.charCodeAt(u);return m},o.buf2string=function(f,m){var u,x,h,b,v=m||f.length,w=new Array(2*v);for(u=x=0;u<v;)if((h=f[u++])<128)w[x++]=h;else if(4<(b=l[h]))w[x++]=65533,u+=b-1;else{for(h&=b===2?31:b===3?15:7;1<b&&u<v;)h=h<<6|63&f[u++],b--;1<b?w[x++]=65533:h<65536?w[x++]=h:(h-=65536,w[x++]=55296|h>>10&1023,w[x++]=56320|1023&h)}return d(w,x)},o.utf8border=function(f,m){var u;for((m=m||f.length)>f.length&&(m=f.length),u=m-1;0<=u&&(192&f[u])==128;)u--;return u<0||u===0?m:u+l[f[u]]>m?u:m}},{"./common":41}],43:[function(r,n,o){n.exports=function(i,s,a,l){for(var c=65535&i|0,d=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--f;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();n.exports=function(s,a,l,c){var d=i,f=c+l;s^=-1;for(var m=c;m<f;m++)s=s>>>8^d[255&(s^a[m])];return-1^s}},{}],46:[function(r,n,o){var i,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),f=0,m=4,u=0,x=-2,h=-1,b=4,v=2,w=8,k=9,S=286,C=30,O=19,N=2*S+1,I=15,D=3,L=258,Z=L+D+1,j=42,F=113,y=1,H=2,Q=3,$=4;function V(g,B){return g.msg=d[B],B}function Y(g){return(g<<1)-(4<g?9:0)}function J(g){for(var B=g.length;0<=--B;)g[B]=0}function z(g){var B=g.state,W=B.pending;W>g.avail_out&&(W=g.avail_out),W!==0&&(s.arraySet(g.output,B.pending_buf,B.pending_out,W,g.next_out),g.next_out+=W,B.pending_out+=W,g.total_out+=W,g.avail_out-=W,B.pending-=W,B.pending===0&&(B.pending_out=0))}function P(g,B){a._tr_flush_block(g,0<=g.block_start?g.block_start:-1,g.strstart-g.block_start,B),g.block_start=g.strstart,z(g.strm)}function K(g,B){g.pending_buf[g.pending++]=B}function G(g,B){g.pending_buf[g.pending++]=B>>>8&255,g.pending_buf[g.pending++]=255&B}function te(g,B){var W,E,A=g.max_chain_length,R=g.strstart,X=g.prev_length,U=g.nice_match,M=g.strstart>g.w_size-Z?g.strstart-(g.w_size-Z):0,q=g.window,ne=g.w_mask,re=g.prev,ae=g.strstart+L,he=q[R+X-1],me=q[R+X];g.prev_length>=g.good_match&&(A>>=2),U>g.lookahead&&(U=g.lookahead);do if(q[(W=B)+X]===me&&q[W+X-1]===he&&q[W]===q[R]&&q[++W]===q[R+1]){R+=2,W++;do;while(q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&q[++R]===q[++W]&&R<ae);if(E=L-(ae-R),R=ae-L,X<E){if(g.match_start=B,U<=(X=E))break;he=q[R+X-1],me=q[R+X]}}while((B=re[B&ne])>M&&--A!=0);return X<=g.lookahead?X:g.lookahead}function ue(g){var B,W,E,A,R,X,U,M,q,ne,re=g.w_size;do{if(A=g.window_size-g.lookahead-g.strstart,g.strstart>=re+(re-Z)){for(s.arraySet(g.window,g.window,re,re,0),g.match_start-=re,g.strstart-=re,g.block_start-=re,B=W=g.hash_size;E=g.head[--B],g.head[B]=re<=E?E-re:0,--W;);for(B=W=re;E=g.prev[--B],g.prev[B]=re<=E?E-re:0,--W;);A+=re}if(g.strm.avail_in===0)break;if(X=g.strm,U=g.window,M=g.strstart+g.lookahead,q=A,ne=void 0,ne=X.avail_in,q<ne&&(ne=q),W=ne===0?0:(X.avail_in-=ne,s.arraySet(U,X.input,X.next_in,ne,M),X.state.wrap===1?X.adler=l(X.adler,U,ne,M):X.state.wrap===2&&(X.adler=c(X.adler,U,ne,M)),X.next_in+=ne,X.total_in+=ne,ne),g.lookahead+=W,g.lookahead+g.insert>=D)for(R=g.strstart-g.insert,g.ins_h=g.window[R],g.ins_h=(g.ins_h<<g.hash_shift^g.window[R+1])&g.hash_mask;g.insert&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[R+D-1])&g.hash_mask,g.prev[R&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=R,R++,g.insert--,!(g.lookahead+g.insert<D)););}while(g.lookahead<Z&&g.strm.avail_in!==0)}function ee(g,B){for(var W,E;;){if(g.lookahead<Z){if(ue(g),g.lookahead<Z&&B===f)return y;if(g.lookahead===0)break}if(W=0,g.lookahead>=D&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+D-1])&g.hash_mask,W=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),W!==0&&g.strstart-W<=g.w_size-Z&&(g.match_length=te(g,W)),g.match_length>=D)if(E=a._tr_tally(g,g.strstart-g.match_start,g.match_length-D),g.lookahead-=g.match_length,g.match_length<=g.max_lazy_match&&g.lookahead>=D){for(g.match_length--;g.strstart++,g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+D-1])&g.hash_mask,W=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart,--g.match_length!=0;);g.strstart++}else g.strstart+=g.match_length,g.match_length=0,g.ins_h=g.window[g.strstart],g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+1])&g.hash_mask;else E=a._tr_tally(g,0,g.window[g.strstart]),g.lookahead--,g.strstart++;if(E&&(P(g,!1),g.strm.avail_out===0))return y}return g.insert=g.strstart<D-1?g.strstart:D-1,B===m?(P(g,!0),g.strm.avail_out===0?Q:$):g.last_lit&&(P(g,!1),g.strm.avail_out===0)?y:H}function ie(g,B){for(var W,E,A;;){if(g.lookahead<Z){if(ue(g),g.lookahead<Z&&B===f)return y;if(g.lookahead===0)break}if(W=0,g.lookahead>=D&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+D-1])&g.hash_mask,W=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),g.prev_length=g.match_length,g.prev_match=g.match_start,g.match_length=D-1,W!==0&&g.prev_length<g.max_lazy_match&&g.strstart-W<=g.w_size-Z&&(g.match_length=te(g,W),g.match_length<=5&&(g.strategy===1||g.match_length===D&&4096<g.strstart-g.match_start)&&(g.match_length=D-1)),g.prev_length>=D&&g.match_length<=g.prev_length){for(A=g.strstart+g.lookahead-D,E=a._tr_tally(g,g.strstart-1-g.prev_match,g.prev_length-D),g.lookahead-=g.prev_length-1,g.prev_length-=2;++g.strstart<=A&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+D-1])&g.hash_mask,W=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),--g.prev_length!=0;);if(g.match_available=0,g.match_length=D-1,g.strstart++,E&&(P(g,!1),g.strm.avail_out===0))return y}else if(g.match_available){if((E=a._tr_tally(g,0,g.window[g.strstart-1]))&&P(g,!1),g.strstart++,g.lookahead--,g.strm.avail_out===0)return y}else g.match_available=1,g.strstart++,g.lookahead--}return g.match_available&&(E=a._tr_tally(g,0,g.window[g.strstart-1]),g.match_available=0),g.insert=g.strstart<D-1?g.strstart:D-1,B===m?(P(g,!0),g.strm.avail_out===0?Q:$):g.last_lit&&(P(g,!1),g.strm.avail_out===0)?y:H}function se(g,B,W,E,A){this.good_length=g,this.max_lazy=B,this.nice_length=W,this.max_chain=E,this.func=A}function oe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*N),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*O+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(I+1),this.heap=new s.Buf16(2*S+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),J(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function le(g){var B;return g&&g.state?(g.total_in=g.total_out=0,g.data_type=v,(B=g.state).pending=0,B.pending_out=0,B.wrap<0&&(B.wrap=-B.wrap),B.status=B.wrap?j:F,g.adler=B.wrap===2?0:1,B.last_flush=f,a._tr_init(B),u):V(g,x)}function fe(g){var B=le(g);return B===u&&(function(W){W.window_size=2*W.w_size,J(W.head),W.max_lazy_match=i[W.level].max_lazy,W.good_match=i[W.level].good_length,W.nice_match=i[W.level].nice_length,W.max_chain_length=i[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=D-1,W.match_available=0,W.ins_h=0})(g.state),B}function xe(g,B,W,E,A,R){if(!g)return x;var X=1;if(B===h&&(B=6),E<0?(X=0,E=-E):15<E&&(X=2,E-=16),A<1||k<A||W!==w||E<8||15<E||B<0||9<B||R<0||b<R)return V(g,x);E===8&&(E=9);var U=new oe;return(g.state=U).strm=g,U.wrap=X,U.gzhead=null,U.w_bits=E,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=A+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+D-1)/D),U.window=new s.Buf8(2*U.w_size),U.head=new s.Buf16(U.hash_size),U.prev=new s.Buf16(U.w_size),U.lit_bufsize=1<<A+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new s.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=B,U.strategy=R,U.method=W,fe(g)}i=[new se(0,0,0,0,function(g,B){var W=65535;for(W>g.pending_buf_size-5&&(W=g.pending_buf_size-5);;){if(g.lookahead<=1){if(ue(g),g.lookahead===0&&B===f)return y;if(g.lookahead===0)break}g.strstart+=g.lookahead,g.lookahead=0;var E=g.block_start+W;if((g.strstart===0||g.strstart>=E)&&(g.lookahead=g.strstart-E,g.strstart=E,P(g,!1),g.strm.avail_out===0)||g.strstart-g.block_start>=g.w_size-Z&&(P(g,!1),g.strm.avail_out===0))return y}return g.insert=0,B===m?(P(g,!0),g.strm.avail_out===0?Q:$):(g.strstart>g.block_start&&(P(g,!1),g.strm.avail_out),y)}),new se(4,4,8,4,ee),new se(4,5,16,8,ee),new se(4,6,32,32,ee),new se(4,4,16,16,ie),new se(8,16,32,32,ie),new se(8,16,128,128,ie),new se(8,32,128,256,ie),new se(32,128,258,1024,ie),new se(32,258,258,4096,ie)],o.deflateInit=function(g,B){return xe(g,B,w,15,8,0)},o.deflateInit2=xe,o.deflateReset=fe,o.deflateResetKeep=le,o.deflateSetHeader=function(g,B){return g&&g.state?g.state.wrap!==2?x:(g.state.gzhead=B,u):x},o.deflate=function(g,B){var W,E,A,R;if(!g||!g.state||5<B||B<0)return g?V(g,x):x;if(E=g.state,!g.output||!g.input&&g.avail_in!==0||E.status===666&&B!==m)return V(g,g.avail_out===0?-5:x);if(E.strm=g,W=E.last_flush,E.last_flush=B,E.status===j)if(E.wrap===2)g.adler=0,K(E,31),K(E,139),K(E,8),E.gzhead?(K(E,(E.gzhead.text?1:0)+(E.gzhead.hcrc?2:0)+(E.gzhead.extra?4:0)+(E.gzhead.name?8:0)+(E.gzhead.comment?16:0)),K(E,255&E.gzhead.time),K(E,E.gzhead.time>>8&255),K(E,E.gzhead.time>>16&255),K(E,E.gzhead.time>>24&255),K(E,E.level===9?2:2<=E.strategy||E.level<2?4:0),K(E,255&E.gzhead.os),E.gzhead.extra&&E.gzhead.extra.length&&(K(E,255&E.gzhead.extra.length),K(E,E.gzhead.extra.length>>8&255)),E.gzhead.hcrc&&(g.adler=c(g.adler,E.pending_buf,E.pending,0)),E.gzindex=0,E.status=69):(K(E,0),K(E,0),K(E,0),K(E,0),K(E,0),K(E,E.level===9?2:2<=E.strategy||E.level<2?4:0),K(E,3),E.status=F);else{var X=w+(E.w_bits-8<<4)<<8;X|=(2<=E.strategy||E.level<2?0:E.level<6?1:E.level===6?2:3)<<6,E.strstart!==0&&(X|=32),X+=31-X%31,E.status=F,G(E,X),E.strstart!==0&&(G(E,g.adler>>>16),G(E,65535&g.adler)),g.adler=1}if(E.status===69)if(E.gzhead.extra){for(A=E.pending;E.gzindex<(65535&E.gzhead.extra.length)&&(E.pending!==E.pending_buf_size||(E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),z(g),A=E.pending,E.pending!==E.pending_buf_size));)K(E,255&E.gzhead.extra[E.gzindex]),E.gzindex++;E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),E.gzindex===E.gzhead.extra.length&&(E.gzindex=0,E.status=73)}else E.status=73;if(E.status===73)if(E.gzhead.name){A=E.pending;do{if(E.pending===E.pending_buf_size&&(E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),z(g),A=E.pending,E.pending===E.pending_buf_size)){R=1;break}R=E.gzindex<E.gzhead.name.length?255&E.gzhead.name.charCodeAt(E.gzindex++):0,K(E,R)}while(R!==0);E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),R===0&&(E.gzindex=0,E.status=91)}else E.status=91;if(E.status===91)if(E.gzhead.comment){A=E.pending;do{if(E.pending===E.pending_buf_size&&(E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),z(g),A=E.pending,E.pending===E.pending_buf_size)){R=1;break}R=E.gzindex<E.gzhead.comment.length?255&E.gzhead.comment.charCodeAt(E.gzindex++):0,K(E,R)}while(R!==0);E.gzhead.hcrc&&E.pending>A&&(g.adler=c(g.adler,E.pending_buf,E.pending-A,A)),R===0&&(E.status=103)}else E.status=103;if(E.status===103&&(E.gzhead.hcrc?(E.pending+2>E.pending_buf_size&&z(g),E.pending+2<=E.pending_buf_size&&(K(E,255&g.adler),K(E,g.adler>>8&255),g.adler=0,E.status=F)):E.status=F),E.pending!==0){if(z(g),g.avail_out===0)return E.last_flush=-1,u}else if(g.avail_in===0&&Y(B)<=Y(W)&&B!==m)return V(g,-5);if(E.status===666&&g.avail_in!==0)return V(g,-5);if(g.avail_in!==0||E.lookahead!==0||B!==f&&E.status!==666){var U=E.strategy===2?(function(M,q){for(var ne;;){if(M.lookahead===0&&(ue(M),M.lookahead===0)){if(q===f)return y;break}if(M.match_length=0,ne=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ne&&(P(M,!1),M.strm.avail_out===0))return y}return M.insert=0,q===m?(P(M,!0),M.strm.avail_out===0?Q:$):M.last_lit&&(P(M,!1),M.strm.avail_out===0)?y:H})(E,B):E.strategy===3?(function(M,q){for(var ne,re,ae,he,me=M.window;;){if(M.lookahead<=L){if(ue(M),M.lookahead<=L&&q===f)return y;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=D&&0<M.strstart&&(re=me[ae=M.strstart-1])===me[++ae]&&re===me[++ae]&&re===me[++ae]){he=M.strstart+L;do;while(re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&re===me[++ae]&&ae<he);M.match_length=L-(he-ae),M.match_length>M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=D?(ne=a._tr_tally(M,1,M.match_length-D),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ne=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ne&&(P(M,!1),M.strm.avail_out===0))return y}return M.insert=0,q===m?(P(M,!0),M.strm.avail_out===0?Q:$):M.last_lit&&(P(M,!1),M.strm.avail_out===0)?y:H})(E,B):i[E.level].func(E,B);if(U!==Q&&U!==$||(E.status=666),U===y||U===Q)return g.avail_out===0&&(E.last_flush=-1),u;if(U===H&&(B===1?a._tr_align(E):B!==5&&(a._tr_stored_block(E,0,0,!1),B===3&&(J(E.head),E.lookahead===0&&(E.strstart=0,E.block_start=0,E.insert=0))),z(g),g.avail_out===0))return E.last_flush=-1,u}return B!==m?u:E.wrap<=0?1:(E.wrap===2?(K(E,255&g.adler),K(E,g.adler>>8&255),K(E,g.adler>>16&255),K(E,g.adler>>24&255),K(E,255&g.total_in),K(E,g.total_in>>8&255),K(E,g.total_in>>16&255),K(E,g.total_in>>24&255)):(G(E,g.adler>>>16),G(E,65535&g.adler)),z(g),0<E.wrap&&(E.wrap=-E.wrap),E.pending!==0?u:1)},o.deflateEnd=function(g){var B;return g&&g.state?(B=g.state.status)!==j&&B!==69&&B!==73&&B!==91&&B!==103&&B!==F&&B!==666?V(g,x):(g.state=null,B===F?V(g,-3):u):x},o.deflateSetDictionary=function(g,B){var W,E,A,R,X,U,M,q,ne=B.length;if(!g||!g.state||(R=(W=g.state).wrap)===2||R===1&&W.status!==j||W.lookahead)return x;for(R===1&&(g.adler=l(g.adler,B,ne,0)),W.wrap=0,ne>=W.w_size&&(R===0&&(J(W.head),W.strstart=0,W.block_start=0,W.insert=0),q=new s.Buf8(W.w_size),s.arraySet(q,B,ne-W.w_size,W.w_size,0),B=q,ne=W.w_size),X=g.avail_in,U=g.next_in,M=g.input,g.avail_in=ne,g.next_in=0,g.input=B,ue(W);W.lookahead>=D;){for(E=W.strstart,A=W.lookahead-(D-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[E+D-1])&W.hash_mask,W.prev[E&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=E,E++,--A;);W.strstart=E,W.lookahead=D-1,ue(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=D-1,W.match_available=0,g.next_in=U,g.input=M,g.avail_in=X,W.wrap=R,u},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,o){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,o){n.exports=function(i,s){var a,l,c,d,f,m,u,x,h,b,v,w,k,S,C,O,N,I,D,L,Z,j,F,y,H;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,H=i.output,f=d-(s-i.avail_out),m=d+(i.avail_out-257),u=a.dmax,x=a.wsize,h=a.whave,b=a.wnext,v=a.window,w=a.hold,k=a.bits,S=a.lencode,C=a.distcode,O=(1<<a.lenbits)-1,N=(1<<a.distbits)-1;e:do{k<15&&(w+=y[l++]<<k,k+=8,w+=y[l++]<<k,k+=8),I=S[w&O];t:for(;;){if(w>>>=D=I>>>24,k-=D,(D=I>>>16&255)===0)H[d++]=65535&I;else{if(!(16&D)){if((64&D)==0){I=S[(65535&I)+(w&(1<<D)-1)];continue t}if(32&D){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}L=65535&I,(D&=15)&&(k<D&&(w+=y[l++]<<k,k+=8),L+=w&(1<<D)-1,w>>>=D,k-=D),k<15&&(w+=y[l++]<<k,k+=8,w+=y[l++]<<k,k+=8),I=C[w&N];r:for(;;){if(w>>>=D=I>>>24,k-=D,!(16&(D=I>>>16&255))){if((64&D)==0){I=C[(65535&I)+(w&(1<<D)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(Z=65535&I,k<(D&=15)&&(w+=y[l++]<<k,(k+=8)<D&&(w+=y[l++]<<k,k+=8)),u<(Z+=w&(1<<D)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=D,k-=D,(D=d-f)<Z){if(h<(D=Z-D)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(F=v,(j=0)===b){if(j+=x-D,D<L){for(L-=D;H[d++]=v[j++],--D;);j=d-Z,F=H}}else if(b<D){if(j+=x+b-D,(D-=b)<L){for(L-=D;H[d++]=v[j++],--D;);if(j=0,b<L){for(L-=D=b;H[d++]=v[j++],--D;);j=d-Z,F=H}}}else if(j+=b-D,D<L){for(L-=D;H[d++]=v[j++],--D;);j=d-Z,F=H}for(;2<L;)H[d++]=F[j++],H[d++]=F[j++],H[d++]=F[j++],L-=3;L&&(H[d++]=F[j++],1<L&&(H[d++]=F[j++]))}else{for(j=d-Z;H[d++]=H[j++],H[d++]=H[j++],H[d++]=H[j++],2<(L-=3););L&&(H[d++]=H[j++],1<L&&(H[d++]=H[j++]))}break}}break}}while(l<c&&d<m);l-=L=k>>3,w&=(1<<(k-=L<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=d<m?m-d+257:257-(d-m),a.hold=w,a.bits=k}},{}],49:[function(r,n,o){var i=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,f=2,m=0,u=-2,x=1,h=852,b=592;function v(j){return(j>>>24&255)+(j>>>8&65280)+((65280&j)<<8)+((255&j)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(j){var F;return j&&j.state?(F=j.state,j.total_in=j.total_out=F.total=0,j.msg="",F.wrap&&(j.adler=1&F.wrap),F.mode=x,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new i.Buf32(h),F.distcode=F.distdyn=new i.Buf32(b),F.sane=1,F.back=-1,m):u}function S(j){var F;return j&&j.state?((F=j.state).wsize=0,F.whave=0,F.wnext=0,k(j)):u}function C(j,F){var y,H;return j&&j.state?(H=j.state,F<0?(y=0,F=-F):(y=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?u:(H.window!==null&&H.wbits!==F&&(H.window=null),H.wrap=y,H.wbits=F,S(j))):u}function O(j,F){var y,H;return j?(H=new w,(j.state=H).window=null,(y=C(j,F))!==m&&(j.state=null),y):u}var N,I,D=!0;function L(j){if(D){var F;for(N=new i.Buf32(512),I=new i.Buf32(32),F=0;F<144;)j.lens[F++]=8;for(;F<256;)j.lens[F++]=9;for(;F<280;)j.lens[F++]=7;for(;F<288;)j.lens[F++]=8;for(c(d,j.lens,0,288,N,0,j.work,{bits:9}),F=0;F<32;)j.lens[F++]=5;c(f,j.lens,0,32,I,0,j.work,{bits:5}),D=!1}j.lencode=N,j.lenbits=9,j.distcode=I,j.distbits=5}function Z(j,F,y,H){var Q,$=j.state;return $.window===null&&($.wsize=1<<$.wbits,$.wnext=0,$.whave=0,$.window=new i.Buf8($.wsize)),H>=$.wsize?(i.arraySet($.window,F,y-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(H<(Q=$.wsize-$.wnext)&&(Q=H),i.arraySet($.window,F,y-H,Q,$.wnext),(H-=Q)?(i.arraySet($.window,F,y-H,H,0),$.wnext=H,$.whave=$.wsize):($.wnext+=Q,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=Q))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(j){return O(j,15)},o.inflateInit2=O,o.inflate=function(j,F){var y,H,Q,$,V,Y,J,z,P,K,G,te,ue,ee,ie,se,oe,le,fe,xe,g,B,W,E,A=0,R=new i.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!j||!j.state||!j.output||!j.input&&j.avail_in!==0)return u;(y=j.state).mode===12&&(y.mode=13),V=j.next_out,Q=j.output,J=j.avail_out,$=j.next_in,H=j.input,Y=j.avail_in,z=y.hold,P=y.bits,K=Y,G=J,B=m;e:for(;;)switch(y.mode){case x:if(y.wrap===0){y.mode=13;break}for(;P<16;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(2&y.wrap&&z===35615){R[y.check=0]=255&z,R[1]=z>>>8&255,y.check=a(y.check,R,2,0),P=z=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&z)<<8)+(z>>8))%31){j.msg="incorrect header check",y.mode=30;break}if((15&z)!=8){j.msg="unknown compression method",y.mode=30;break}if(P-=4,g=8+(15&(z>>>=4)),y.wbits===0)y.wbits=g;else if(g>y.wbits){j.msg="invalid window size",y.mode=30;break}y.dmax=1<<g,j.adler=y.check=1,y.mode=512&z?10:12,P=z=0;break;case 2:for(;P<16;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(y.flags=z,(255&y.flags)!=8){j.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){j.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=z>>8&1),512&y.flags&&(R[0]=255&z,R[1]=z>>>8&255,y.check=a(y.check,R,2,0)),P=z=0,y.mode=3;case 3:for(;P<32;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.head&&(y.head.time=z),512&y.flags&&(R[0]=255&z,R[1]=z>>>8&255,R[2]=z>>>16&255,R[3]=z>>>24&255,y.check=a(y.check,R,4,0)),P=z=0,y.mode=4;case 4:for(;P<16;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.head&&(y.head.xflags=255&z,y.head.os=z>>8),512&y.flags&&(R[0]=255&z,R[1]=z>>>8&255,y.check=a(y.check,R,2,0)),P=z=0,y.mode=5;case 5:if(1024&y.flags){for(;P<16;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.length=z,y.head&&(y.head.extra_len=z),512&y.flags&&(R[0]=255&z,R[1]=z>>>8&255,y.check=a(y.check,R,2,0)),P=z=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Y<(te=y.length)&&(te=Y),te&&(y.head&&(g=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,H,$,te,g)),512&y.flags&&(y.check=a(y.check,H,te,$)),Y-=te,$+=te,y.length-=te),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Y===0)break e;for(te=0;g=H[$+te++],y.head&&g&&y.length<65536&&(y.head.name+=String.fromCharCode(g)),g&&te<Y;);if(512&y.flags&&(y.check=a(y.check,H,te,$)),Y-=te,$+=te,g)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Y===0)break e;for(te=0;g=H[$+te++],y.head&&g&&y.length<65536&&(y.head.comment+=String.fromCharCode(g)),g&&te<Y;);if(512&y.flags&&(y.check=a(y.check,H,te,$)),Y-=te,$+=te,g)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;P<16;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(z!==(65535&y.check)){j.msg="header crc mismatch",y.mode=30;break}P=z=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),j.adler=y.check=0,y.mode=12;break;case 10:for(;P<32;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}j.adler=y.check=v(z),P=z=0,y.mode=11;case 11:if(y.havedict===0)return j.next_out=V,j.avail_out=J,j.next_in=$,j.avail_in=Y,y.hold=z,y.bits=P,2;j.adler=y.check=1,y.mode=12;case 12:if(F===5||F===6)break e;case 13:if(y.last){z>>>=7&P,P-=7&P,y.mode=27;break}for(;P<3;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}switch(y.last=1&z,P-=1,3&(z>>>=1)){case 0:y.mode=14;break;case 1:if(L(y),y.mode=20,F!==6)break;z>>>=2,P-=2;break e;case 2:y.mode=17;break;case 3:j.msg="invalid block type",y.mode=30}z>>>=2,P-=2;break;case 14:for(z>>>=7&P,P-=7&P;P<32;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if((65535&z)!=(z>>>16^65535)){j.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&z,P=z=0,y.mode=15,F===6)break e;case 15:y.mode=16;case 16:if(te=y.length){if(Y<te&&(te=Y),J<te&&(te=J),te===0)break e;i.arraySet(Q,H,$,te,V),Y-=te,$+=te,J-=te,V+=te,y.length-=te;break}y.mode=12;break;case 17:for(;P<14;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(y.nlen=257+(31&z),z>>>=5,P-=5,y.ndist=1+(31&z),z>>>=5,P-=5,y.ncode=4+(15&z),z>>>=4,P-=4,286<y.nlen||30<y.ndist){j.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;P<3;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.lens[X[y.have++]]=7&z,z>>>=3,P-=3}for(;y.have<19;)y.lens[X[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,W={bits:y.lenbits},B=c(0,y.lens,0,19,y.lencode,0,y.work,W),y.lenbits=W.bits,B){j.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;se=(A=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&A,!((ie=A>>>24)<=P);){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(oe<16)z>>>=ie,P-=ie,y.lens[y.have++]=oe;else{if(oe===16){for(E=ie+2;P<E;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(z>>>=ie,P-=ie,y.have===0){j.msg="invalid bit length repeat",y.mode=30;break}g=y.lens[y.have-1],te=3+(3&z),z>>>=2,P-=2}else if(oe===17){for(E=ie+3;P<E;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}P-=ie,g=0,te=3+(7&(z>>>=ie)),z>>>=3,P-=3}else{for(E=ie+7;P<E;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}P-=ie,g=0,te=11+(127&(z>>>=ie)),z>>>=7,P-=7}if(y.have+te>y.nlen+y.ndist){j.msg="invalid bit length repeat",y.mode=30;break}for(;te--;)y.lens[y.have++]=g}}if(y.mode===30)break;if(y.lens[256]===0){j.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,W={bits:y.lenbits},B=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,W),y.lenbits=W.bits,B){j.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,W={bits:y.distbits},B=c(f,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,W),y.distbits=W.bits,B){j.msg="invalid distances set",y.mode=30;break}if(y.mode=20,F===6)break e;case 20:y.mode=21;case 21:if(6<=Y&&258<=J){j.next_out=V,j.avail_out=J,j.next_in=$,j.avail_in=Y,y.hold=z,y.bits=P,l(j,G),V=j.next_out,Q=j.output,J=j.avail_out,$=j.next_in,H=j.input,Y=j.avail_in,z=y.hold,P=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;se=(A=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&A,!((ie=A>>>24)<=P);){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(se&&(240&se)==0){for(le=ie,fe=se,xe=oe;se=(A=y.lencode[xe+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&A,!(le+(ie=A>>>24)<=P);){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}z>>>=le,P-=le,y.back+=le}if(z>>>=ie,P-=ie,y.back+=ie,y.length=oe,se===0){y.mode=26;break}if(32&se){y.back=-1,y.mode=12;break}if(64&se){j.msg="invalid literal/length code",y.mode=30;break}y.extra=15&se,y.mode=22;case 22:if(y.extra){for(E=y.extra;P<E;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.length+=z&(1<<y.extra)-1,z>>>=y.extra,P-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;se=(A=y.distcode[z&(1<<y.distbits)-1])>>>16&255,oe=65535&A,!((ie=A>>>24)<=P);){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if((240&se)==0){for(le=ie,fe=se,xe=oe;se=(A=y.distcode[xe+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&A,!(le+(ie=A>>>24)<=P);){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}z>>>=le,P-=le,y.back+=le}if(z>>>=ie,P-=ie,y.back+=ie,64&se){j.msg="invalid distance code",y.mode=30;break}y.offset=oe,y.extra=15&se,y.mode=24;case 24:if(y.extra){for(E=y.extra;P<E;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}y.offset+=z&(1<<y.extra)-1,z>>>=y.extra,P-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){j.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(J===0)break e;if(te=G-J,y.offset>te){if((te=y.offset-te)>y.whave&&y.sane){j.msg="invalid distance too far back",y.mode=30;break}ue=te>y.wnext?(te-=y.wnext,y.wsize-te):y.wnext-te,te>y.length&&(te=y.length),ee=y.window}else ee=Q,ue=V-y.offset,te=y.length;for(J<te&&(te=J),J-=te,y.length-=te;Q[V++]=ee[ue++],--te;);y.length===0&&(y.mode=21);break;case 26:if(J===0)break e;Q[V++]=y.length,J--,y.mode=21;break;case 27:if(y.wrap){for(;P<32;){if(Y===0)break e;Y--,z|=H[$++]<<P,P+=8}if(G-=J,j.total_out+=G,y.total+=G,G&&(j.adler=y.check=y.flags?a(y.check,Q,G,V-G):s(y.check,Q,G,V-G)),G=J,(y.flags?z:v(z))!==y.check){j.msg="incorrect data check",y.mode=30;break}P=z=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;P<32;){if(Y===0)break e;Y--,z+=H[$++]<<P,P+=8}if(z!==(4294967295&y.total)){j.msg="incorrect length check",y.mode=30;break}P=z=0}y.mode=29;case 29:B=1;break e;case 30:B=-3;break e;case 31:return-4;case 32:default:return u}return j.next_out=V,j.avail_out=J,j.next_in=$,j.avail_in=Y,y.hold=z,y.bits=P,(y.wsize||G!==j.avail_out&&y.mode<30&&(y.mode<27||F!==4))&&Z(j,j.output,j.next_out,G-j.avail_out)?(y.mode=31,-4):(K-=j.avail_in,G-=j.avail_out,j.total_in+=K,j.total_out+=G,y.total+=G,y.wrap&&G&&(j.adler=y.check=y.flags?a(y.check,Q,G,j.next_out-G):s(y.check,Q,G,j.next_out-G)),j.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(K==0&&G===0||F===4)&&B===m&&(B=-5),B)},o.inflateEnd=function(j){if(!j||!j.state)return u;var F=j.state;return F.window&&(F.window=null),j.state=null,m},o.inflateGetHeader=function(j,F){var y;return j&&j.state?(2&(y=j.state).wrap)==0?u:((y.head=F).done=!1,m):u},o.inflateSetDictionary=function(j,F){var y,H=F.length;return j&&j.state?(y=j.state).wrap!==0&&y.mode!==11?u:y.mode===11&&s(1,F,H,0)!==y.check?-3:Z(j,F,H,H)?(y.mode=31,-4):(y.havedict=1,m):u},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,o){var i=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,f,m,u,x,h,b,v){var w,k,S,C,O,N,I,D,L,Z=v.bits,j=0,F=0,y=0,H=0,Q=0,$=0,V=0,Y=0,J=0,z=0,P=null,K=0,G=new i.Buf16(16),te=new i.Buf16(16),ue=null,ee=0;for(j=0;j<=15;j++)G[j]=0;for(F=0;F<u;F++)G[f[m+F]]++;for(Q=Z,H=15;1<=H&&G[H]===0;H--);if(H<Q&&(Q=H),H===0)return x[h++]=20971520,x[h++]=20971520,v.bits=1,0;for(y=1;y<H&&G[y]===0;y++);for(Q<y&&(Q=y),j=Y=1;j<=15;j++)if(Y<<=1,(Y-=G[j])<0)return-1;if(0<Y&&(d===0||H!==1))return-1;for(te[1]=0,j=1;j<15;j++)te[j+1]=te[j]+G[j];for(F=0;F<u;F++)f[m+F]!==0&&(b[te[f[m+F]]++]=F);if(N=d===0?(P=ue=b,19):d===1?(P=s,K-=257,ue=a,ee-=257,256):(P=l,ue=c,-1),j=y,O=h,V=F=z=0,S=-1,C=(J=1<<($=Q))-1,d===1&&852<J||d===2&&592<J)return 1;for(;;){for(I=j-V,L=b[F]<N?(D=0,b[F]):b[F]>N?(D=ue[ee+b[F]],P[K+b[F]]):(D=96,0),w=1<<j-V,y=k=1<<$;x[O+(z>>V)+(k-=w)]=I<<24|D<<16|L|0,k!==0;);for(w=1<<j-1;z&w;)w>>=1;if(w!==0?(z&=w-1,z+=w):z=0,F++,--G[j]==0){if(j===H)break;j=f[m+b[F]]}if(Q<j&&(z&C)!==S){for(V===0&&(V=Q),O+=y,Y=1<<($=j-V);$+V<H&&!((Y-=G[$+V])<=0);)$++,Y<<=1;if(J+=1<<$,d===1&&852<J||d===2&&592<J)return 1;x[S=z&C]=Q<<24|$<<16|O-h|0}}return z!==0&&(x[O+z]=j-V<<24|64<<16|0),v.bits=Q,0}},{"../utils/common":41}],51:[function(r,n,o){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,o){var i=r("../utils/common"),s=0,a=1;function l(A){for(var R=A.length;0<=--R;)A[R]=0}var c=0,d=29,f=256,m=f+1+d,u=30,x=19,h=2*m+1,b=15,v=16,w=7,k=256,S=16,C=17,O=18,N=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z=new Array(2*(m+2));l(Z);var j=new Array(2*u);l(j);var F=new Array(512);l(F);var y=new Array(256);l(y);var H=new Array(d);l(H);var Q,$,V,Y=new Array(u);function J(A,R,X,U,M){this.static_tree=A,this.extra_bits=R,this.extra_base=X,this.elems=U,this.max_length=M,this.has_stree=A&&A.length}function z(A,R){this.dyn_tree=A,this.max_code=0,this.stat_desc=R}function P(A){return A<256?F[A]:F[256+(A>>>7)]}function K(A,R){A.pending_buf[A.pending++]=255&R,A.pending_buf[A.pending++]=R>>>8&255}function G(A,R,X){A.bi_valid>v-X?(A.bi_buf|=R<<A.bi_valid&65535,K(A,A.bi_buf),A.bi_buf=R>>v-A.bi_valid,A.bi_valid+=X-v):(A.bi_buf|=R<<A.bi_valid&65535,A.bi_valid+=X)}function te(A,R,X){G(A,X[2*R],X[2*R+1])}function ue(A,R){for(var X=0;X|=1&A,A>>>=1,X<<=1,0<--R;);return X>>>1}function ee(A,R,X){var U,M,q=new Array(b+1),ne=0;for(U=1;U<=b;U++)q[U]=ne=ne+X[U-1]<<1;for(M=0;M<=R;M++){var re=A[2*M+1];re!==0&&(A[2*M]=ue(q[re]++,re))}}function ie(A){var R;for(R=0;R<m;R++)A.dyn_ltree[2*R]=0;for(R=0;R<u;R++)A.dyn_dtree[2*R]=0;for(R=0;R<x;R++)A.bl_tree[2*R]=0;A.dyn_ltree[2*k]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function se(A){8<A.bi_valid?K(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function oe(A,R,X,U){var M=2*R,q=2*X;return A[M]<A[q]||A[M]===A[q]&&U[R]<=U[X]}function le(A,R,X){for(var U=A.heap[X],M=X<<1;M<=A.heap_len&&(M<A.heap_len&&oe(R,A.heap[M+1],A.heap[M],A.depth)&&M++,!oe(R,U,A.heap[M],A.depth));)A.heap[X]=A.heap[M],X=M,M<<=1;A.heap[X]=U}function fe(A,R,X){var U,M,q,ne,re=0;if(A.last_lit!==0)for(;U=A.pending_buf[A.d_buf+2*re]<<8|A.pending_buf[A.d_buf+2*re+1],M=A.pending_buf[A.l_buf+re],re++,U===0?te(A,M,R):(te(A,(q=y[M])+f+1,R),(ne=N[q])!==0&&G(A,M-=H[q],ne),te(A,q=P(--U),X),(ne=I[q])!==0&&G(A,U-=Y[q],ne)),re<A.last_lit;);te(A,k,R)}function xe(A,R){var X,U,M,q=R.dyn_tree,ne=R.stat_desc.static_tree,re=R.stat_desc.has_stree,ae=R.stat_desc.elems,he=-1;for(A.heap_len=0,A.heap_max=h,X=0;X<ae;X++)q[2*X]!==0?(A.heap[++A.heap_len]=he=X,A.depth[X]=0):q[2*X+1]=0;for(;A.heap_len<2;)q[2*(M=A.heap[++A.heap_len]=he<2?++he:0)]=1,A.depth[M]=0,A.opt_len--,re&&(A.static_len-=ne[2*M+1]);for(R.max_code=he,X=A.heap_len>>1;1<=X;X--)le(A,q,X);for(M=ae;X=A.heap[1],A.heap[1]=A.heap[A.heap_len--],le(A,q,1),U=A.heap[1],A.heap[--A.heap_max]=X,A.heap[--A.heap_max]=U,q[2*M]=q[2*X]+q[2*U],A.depth[M]=(A.depth[X]>=A.depth[U]?A.depth[X]:A.depth[U])+1,q[2*X+1]=q[2*U+1]=M,A.heap[1]=M++,le(A,q,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(me,ve){var st,je,Ct,Ee,sr,It,Ye=ve.dyn_tree,Yn=ve.max_code,Kn=ve.stat_desc.static_tree,hi=ve.stat_desc.has_stree,pi=ve.stat_desc.extra_bits,Zn=ve.stat_desc.extra_base,Ae=ve.stat_desc.max_length,Oe=0;for(Ee=0;Ee<=b;Ee++)me.bl_count[Ee]=0;for(Ye[2*me.heap[me.heap_max]+1]=0,st=me.heap_max+1;st<h;st++)Ae<(Ee=Ye[2*Ye[2*(je=me.heap[st])+1]+1]+1)&&(Ee=Ae,Oe++),Ye[2*je+1]=Ee,Yn<je||(me.bl_count[Ee]++,sr=0,Zn<=je&&(sr=pi[je-Zn]),It=Ye[2*je],me.opt_len+=It*(Ee+sr),hi&&(me.static_len+=It*(Kn[2*je+1]+sr)));if(Oe!==0){do{for(Ee=Ae-1;me.bl_count[Ee]===0;)Ee--;me.bl_count[Ee]--,me.bl_count[Ee+1]+=2,me.bl_count[Ae]--,Oe-=2}while(0<Oe);for(Ee=Ae;Ee!==0;Ee--)for(je=me.bl_count[Ee];je!==0;)Yn<(Ct=me.heap[--st])||(Ye[2*Ct+1]!==Ee&&(me.opt_len+=(Ee-Ye[2*Ct+1])*Ye[2*Ct],Ye[2*Ct+1]=Ee),je--)}})(A,R),ee(q,he,A.bl_count)}function g(A,R,X){var U,M,q=-1,ne=R[1],re=0,ae=7,he=4;for(ne===0&&(ae=138,he=3),R[2*(X+1)+1]=65535,U=0;U<=X;U++)M=ne,ne=R[2*(U+1)+1],++re<ae&&M===ne||(re<he?A.bl_tree[2*M]+=re:M!==0?(M!==q&&A.bl_tree[2*M]++,A.bl_tree[2*S]++):re<=10?A.bl_tree[2*C]++:A.bl_tree[2*O]++,q=M,he=(re=0)===ne?(ae=138,3):M===ne?(ae=6,3):(ae=7,4))}function B(A,R,X){var U,M,q=-1,ne=R[1],re=0,ae=7,he=4;for(ne===0&&(ae=138,he=3),U=0;U<=X;U++)if(M=ne,ne=R[2*(U+1)+1],!(++re<ae&&M===ne)){if(re<he)for(;te(A,M,A.bl_tree),--re!=0;);else M!==0?(M!==q&&(te(A,M,A.bl_tree),re--),te(A,S,A.bl_tree),G(A,re-3,2)):re<=10?(te(A,C,A.bl_tree),G(A,re-3,3)):(te(A,O,A.bl_tree),G(A,re-11,7));q=M,he=(re=0)===ne?(ae=138,3):M===ne?(ae=6,3):(ae=7,4)}}l(Y);var W=!1;function E(A,R,X,U){G(A,(c<<1)+(U?1:0),3),(function(M,q,ne,re){se(M),K(M,ne),K(M,~ne),i.arraySet(M.pending_buf,M.window,q,ne,M.pending),M.pending+=ne})(A,R,X)}o._tr_init=function(A){W||((function(){var R,X,U,M,q,ne=new Array(b+1);for(M=U=0;M<d-1;M++)for(H[M]=U,R=0;R<1<<N[M];R++)y[U++]=M;for(y[U-1]=M,M=q=0;M<16;M++)for(Y[M]=q,R=0;R<1<<I[M];R++)F[q++]=M;for(q>>=7;M<u;M++)for(Y[M]=q<<7,R=0;R<1<<I[M]-7;R++)F[256+q++]=M;for(X=0;X<=b;X++)ne[X]=0;for(R=0;R<=143;)Z[2*R+1]=8,R++,ne[8]++;for(;R<=255;)Z[2*R+1]=9,R++,ne[9]++;for(;R<=279;)Z[2*R+1]=7,R++,ne[7]++;for(;R<=287;)Z[2*R+1]=8,R++,ne[8]++;for(ee(Z,m+1,ne),R=0;R<u;R++)j[2*R+1]=5,j[2*R]=ue(R,5);Q=new J(Z,N,f+1,m,b),$=new J(j,I,0,u,b),V=new J(new Array(0),D,0,x,w)})(),W=!0),A.l_desc=new z(A.dyn_ltree,Q),A.d_desc=new z(A.dyn_dtree,$),A.bl_desc=new z(A.bl_tree,V),A.bi_buf=0,A.bi_valid=0,ie(A)},o._tr_stored_block=E,o._tr_flush_block=function(A,R,X,U){var M,q,ne=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=(function(re){var ae,he=4093624447;for(ae=0;ae<=31;ae++,he>>>=1)if(1&he&&re.dyn_ltree[2*ae]!==0)return s;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return a;for(ae=32;ae<f;ae++)if(re.dyn_ltree[2*ae]!==0)return a;return s})(A)),xe(A,A.l_desc),xe(A,A.d_desc),ne=(function(re){var ae;for(g(re,re.dyn_ltree,re.l_desc.max_code),g(re,re.dyn_dtree,re.d_desc.max_code),xe(re,re.bl_desc),ae=x-1;3<=ae&&re.bl_tree[2*L[ae]+1]===0;ae--);return re.opt_len+=3*(ae+1)+5+5+4,ae})(A),M=A.opt_len+3+7>>>3,(q=A.static_len+3+7>>>3)<=M&&(M=q)):M=q=X+5,X+4<=M&&R!==-1?E(A,R,X,U):A.strategy===4||q===M?(G(A,2+(U?1:0),3),fe(A,Z,j)):(G(A,4+(U?1:0),3),(function(re,ae,he,me){var ve;for(G(re,ae-257,5),G(re,he-1,5),G(re,me-4,4),ve=0;ve<me;ve++)G(re,re.bl_tree[2*L[ve]+1],3);B(re,re.dyn_ltree,ae-1),B(re,re.dyn_dtree,he-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,ne+1),fe(A,A.dyn_ltree,A.dyn_dtree)),ie(A),U&&se(A)},o._tr_tally=function(A,R,X){return A.pending_buf[A.d_buf+2*A.last_lit]=R>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&R,A.pending_buf[A.l_buf+A.last_lit]=255&X,A.last_lit++,R===0?A.dyn_ltree[2*X]++:(A.matches++,R--,A.dyn_ltree[2*(y[X]+f+1)]++,A.dyn_dtree[2*P(R)]++),A.last_lit===A.lit_bufsize-1},o._tr_align=function(A){G(A,2,3),te(A,k,Z),(function(R){R.bi_valid===16?(K(R,R.bi_buf),R.bi_buf=0,R.bi_valid=0):8<=R.bi_valid&&(R.pending_buf[R.pending++]=255&R.bi_buf,R.bi_buf>>=8,R.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(r,n,o){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,d,f,m=1,u={},x=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){w(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(f+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){w(S.data)},function(S){d.port2.postMessage(S)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(S){var C=h.createElement("script");C.onreadystatechange=function(){w(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(w,0,S)},b.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),O=0;O<C.length;O++)C[O]=arguments[O+1];var N={callback:S,args:C};return u[m]=N,l(m),m++},b.clearImmediate=v}function v(S){delete u[S]}function w(S){if(x)setTimeout(w,0,S);else{var C=u[S];if(C){x=!0;try{(function(O){var N=O.callback,I=O.args;switch(I.length){case 0:N();break;case 1:N(I[0]);break;case 2:N(I[0],I[1]);break;case 3:N(I[0],I[1],I[2]);break;default:N.apply(a,I)}})(C)}finally{v(S),x=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(f)===0&&w(+S.data.slice(f.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof mt<"u"?mt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Gn)),Gn.exports}var zc=Nc();const jc=Ac(zc);var Fr={exports:{}},Tc=Fr.exports,vi;function Oc(){return vi||(vi=1,(function(e,t){(function(r,n){n()})(Tc,function(){function r(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,d,f){var m=new XMLHttpRequest;m.open("GET",c),m.responseType="blob",m.onload=function(){l(m.response,d,f)},m.onerror=function(){console.error("could not download file")},m.send()}function o(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof mt=="object"&&mt.global===mt?mt:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,d,f){var m=s.URL||s.webkitURL,u=document.createElement("a");d=d||c.name||"download",u.download=d,u.rel="noopener",typeof c=="string"?(u.href=c,u.origin===location.origin?i(u):o(u.href)?n(c,d,f):i(u,u.target="_blank")):(u.href=m.createObjectURL(c),setTimeout(function(){m.revokeObjectURL(u.href)},4e4),setTimeout(function(){i(u)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,f){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,f),d);else if(o(c))n(c,d,f);else{var m=document.createElement("a");m.href=c,m.target="_blank",setTimeout(function(){i(m)})}}:function(c,d,f,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof c=="string")return n(c,d,f);var u=c.type==="application/octet-stream",x=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||u&&x||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var k=b.result;k=h?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=k:location=k,m=null},b.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,w=v.createObjectURL(c);m?m.location=w:location.href=w,m=null,setTimeout(function(){v.revokeObjectURL(w)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Fr)),Fr.exports}var xi=Oc();const wi=async(e,t)=>{const r=new jc,n=r.folder("config");n==null||n.file("site.json",JSON.stringify(e.site,null,2)),n==null||n.file("theme.json",JSON.stringify(e.theme,null,2)),n==null||n.file("menu.json",JSON.stringify(e.menu,null,2));const o=r.folder("pages");o==null||o.file(`${t}.json`,JSON.stringify(e.page,null,2));const i=await r.generateAsync({type:"blob"});xi.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},yi=(e,t,r)=>{const{pages:n,...o}=e.site,i={page:e.page,site:o,menu:e.menu,theme:e.theme},a=`<script id="jp-baked-state" type="application/json">${JSON.stringify(i)}<\/script>`,l=r.replace("</head>",`${a}</head>`),c=new Blob([`<!DOCTYPE html>${l}`],{type:"text/html;charset=utf-8"});xi.saveAs(c,`${t}.html`)};function ki(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ki(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Pc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ki(e))&&(n&&(n+=" "),n+=t);return n}const Ic=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Dc=(e,t)=>({classGroupId:e,validator:t}),Si=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Br="-",_i=[],Rc="arbitrary..",Mc=e=>{const t=Fc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Lc(s);const a=s.split(Br),l=a[0]===""&&a.length>1?1:0;return Ci(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Ic(c,l):l:c||_i}return r[s]||_i}}},Ci=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Ci(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Br):e.slice(t).join(Br),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},Lc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Rc+n:void 0})(),Fc=e=>{const{theme:t,classGroups:r}=e;return Bc(r,t)},Bc=(e,t)=>{const r=Si();for(const n in e){const o=e[n];Xn(o,r,n,t)}return r},Xn=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Uc(s,t,r,n)}},Uc=(e,t,r,n)=>{if(typeof e=="string"){Wc(e,t,r);return}if(typeof e=="function"){$c(e,t,r,n);return}Hc(e,t,r,n)},Wc=(e,t,r)=>{const n=e===""?t:Ei(t,e);n.classGroupId=r},$c=(e,t,r,n)=>{if(Vc(e)){Xn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Dc(r,e))},Hc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Xn(l,Ei(t,a),r,n)}},Ei=(e,t)=>{let r=e;const n=t.split(Br),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Si(),r.nextPart.set(s,a)),r=a}return r},Vc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},qn="!",Ai=":",Kc=[],Ni=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Zc=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let h=0;h<d;h++){const b=o[h];if(s===0&&a===0){if(b===Ai){i.push(o.slice(l,h)),l=h+1;continue}if(b==="/"){c=h;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const f=i.length===0?o:o.slice(l);let m=f,u=!1;f.endsWith(qn)?(m=f.slice(0,-1),u=!0):f.startsWith(qn)&&(m=f.slice(1),u=!0);const x=c&&c>l?c-l:void 0;return Ni(i,u,m,x)};if(t){const o=t+Ai,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Ni(Kc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Gc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Xc=e=>({cache:Yc(e.cacheSize),parseClassName:Zc(e),sortModifiers:Gc(e),...Mc(e)}),qc=/\s+/,Jc=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(qc);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:m,hasImportantModifier:u,baseClassName:x,maybePostfixModifierPosition:h}=r(d);if(f){l=d+(l.length>0?" "+l:l);continue}let b=!!h,v=n(b?x.substring(0,h):x);if(!v){if(!b){l=d+(l.length>0?" "+l:l);continue}if(v=n(x),!v){l=d+(l.length>0?" "+l:l);continue}b=!1}const w=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=u?w+qn:w,S=k+v;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(v,b);for(let O=0;O<C.length;++O){const N=C[O];s.push(k+N)}l=d+(l.length>0?" "+l:l)}return l},Qc=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=zi(r))&&(o&&(o+=" "),o+=n);return o},zi=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=zi(e[n]))&&(r&&(r+=" "),r+=t);return r},ed=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,f)=>f(d),e());return r=Xc(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=Jc(l,r);return o(l,d),d};return i=s,(...l)=>i(Qc(...l))},td=[],Ne=e=>{const t=r=>r[e]||td;return t.isThemeGetter=!0,t},ji=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ti=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rd=/^\d+\/\d+$/,nd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,od=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,id=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ad=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dt=e=>rd.test(e),ge=e=>!!e&&!Number.isNaN(Number(e)),gt=e=>!!e&&Number.isInteger(Number(e)),Jn=e=>e.endsWith("%")&&ge(e.slice(0,-1)),ct=e=>nd.test(e),ld=()=>!0,cd=e=>od.test(e)&&!id.test(e),Oi=()=>!1,dd=e=>sd.test(e),ud=e=>ad.test(e),fd=e=>!ce(e)&&!de(e),hd=e=>Rt(e,Mi,Oi),ce=e=>ji.test(e),zt=e=>Rt(e,Li,cd),Qn=e=>Rt(e,vd,ge),Pi=e=>Rt(e,Di,Oi),pd=e=>Rt(e,Ri,ud),Ur=e=>Rt(e,Fi,dd),de=e=>Ti.test(e),lr=e=>Mt(e,Li),md=e=>Mt(e,xd),Ii=e=>Mt(e,Di),gd=e=>Mt(e,Mi),bd=e=>Mt(e,Ri),Wr=e=>Mt(e,Fi,!0),Rt=(e,t,r)=>{const n=ji.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Mt=(e,t,r=!1)=>{const n=Ti.exec(e);return n?n[1]?t(n[1]):r:!1},Di=e=>e==="position"||e==="percentage",Ri=e=>e==="image"||e==="url",Mi=e=>e==="length"||e==="size"||e==="bg-size",Li=e=>e==="length",vd=e=>e==="number",xd=e=>e==="family-name",Fi=e=>e==="shadow",wd=ed(()=>{const e=Ne("color"),t=Ne("font"),r=Ne("text"),n=Ne("font-weight"),o=Ne("tracking"),i=Ne("leading"),s=Ne("breakpoint"),a=Ne("container"),l=Ne("spacing"),c=Ne("radius"),d=Ne("shadow"),f=Ne("inset-shadow"),m=Ne("text-shadow"),u=Ne("drop-shadow"),x=Ne("blur"),h=Ne("perspective"),b=Ne("aspect"),v=Ne("ease"),w=Ne("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),de,ce],O=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],I=()=>[de,ce,l],D=()=>[Dt,"full","auto",...I()],L=()=>[gt,"none","subgrid",de,ce],Z=()=>["auto",{span:["full",gt,de,ce]},gt,de,ce],j=()=>[gt,"auto",de,ce],F=()=>["auto","min","max","fr",de,ce],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...I()],$=()=>[Dt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],V=()=>[e,de,ce],Y=()=>[...S(),Ii,Pi,{position:[de,ce]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",gd,hd,{size:[de,ce]}],P=()=>[Jn,lr,zt],K=()=>["","none","full",c,de,ce],G=()=>["",ge,lr,zt],te=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[ge,Jn,Ii,Pi],ie=()=>["","none",x,de,ce],se=()=>["none",ge,de,ce],oe=()=>["none",ge,de,ce],le=()=>[ge,de,ce],fe=()=>[Dt,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ct],breakpoint:[ct],color:[ld],container:[ct],"drop-shadow":[ct],ease:["in","out","in-out"],font:[fd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ct],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ct],shadow:[ct],spacing:["px",ge],text:[ct],"text-shadow":[ct],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dt,ce,de,b]}],container:["container"],columns:[{columns:[ge,ce,de,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[gt,"auto",de,ce]}],basis:[{basis:[Dt,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ge,Dt,"auto","initial","none",ce]}],grow:[{grow:["",ge,de,ce]}],shrink:[{shrink:["",ge,de,ce]}],order:[{order:[gt,"first","last","none",de,ce]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[a,"screen",...$()]}],"min-w":[{"min-w":[a,"screen","none",...$()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,lr,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,de,Qn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jn,ce]}],"font-family":[{font:[md,ce,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,ce]}],"line-clamp":[{"line-clamp":[ge,"none",de,Qn]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",de,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[ge,"from-font","auto",de,zt]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[ge,"auto",de,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gt,de,ce],radial:["",de,ce],conic:[gt,de,ce]},bd,pd]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ge,de,ce]}],"outline-w":[{outline:["",ge,lr,zt]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,Wr,Ur]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",f,Wr,Ur]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[ge,zt]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,Wr,Ur]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[ge,de,ce]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[de,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ce]}],filter:[{filter:["","none",de,ce]}],blur:[{blur:ie()}],brightness:[{brightness:[ge,de,ce]}],contrast:[{contrast:[ge,de,ce]}],"drop-shadow":[{"drop-shadow":["","none",u,Wr,Ur]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",ge,de,ce]}],"hue-rotate":[{"hue-rotate":[ge,de,ce]}],invert:[{invert:["",ge,de,ce]}],saturate:[{saturate:[ge,de,ce]}],sepia:[{sepia:["",ge,de,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ce]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ge,de,ce]}],"backdrop-contrast":[{"backdrop-contrast":[ge,de,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ge,de,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ge,de,ce]}],"backdrop-invert":[{"backdrop-invert":["",ge,de,ce]}],"backdrop-opacity":[{"backdrop-opacity":[ge,de,ce]}],"backdrop-saturate":[{"backdrop-saturate":[ge,de,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",ge,de,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ge,"initial",de,ce]}],ease:[{ease:["linear","initial",v,de,ce]}],delay:[{delay:[ge,de,ce]}],animate:[{animate:["none",w,de,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,de,ce]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[de,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ce]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[ge,lr,zt,Qn]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function pe(...e){return wd(Pc(e))}var $r={exports:{}},cr={};/**
|
|
11
|
+
*/var wi;function Ic(){return wi||(wi=1,(function(e,t){(function(r){e.exports=r()})(function(){return(function r(n,o,i){function s(c,d){if(!o[c]){if(!n[c]){var u=typeof Lr=="function"&&Lr;if(!d&&u)return u(c,!0);if(a)return a(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var f=o[c]={exports:{}};n[c][0].call(f.exports,function(v){var h=n[c][1][v];return s(h||v)},f,f.exports,r,n,o,i)}return o[c].exports}for(var a=typeof Lr=="function"&&Lr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(r,n,o){var i=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,d,u,m,f,v,h,b=[],g=0,x=l.length,k=x,_=i.getTypeOf(l)!=="string";g<l.length;)k=x-g,u=_?(c=l[g++],d=g<x?l[g++]:0,g<x?l[g++]:0):(c=l.charCodeAt(g++),d=g<x?l.charCodeAt(g++):0,g<x?l.charCodeAt(g++):0),m=c>>2,f=(3&c)<<4|d>>4,v=1<k?(15&d)<<2|u>>6:64,h=2<k?63&u:64,b.push(a.charAt(m)+a.charAt(f)+a.charAt(v)+a.charAt(h));return b.join("")},o.decode=function(l){var c,d,u,m,f,v,h=0,b=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var x,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(x=s.uint8array?new Uint8Array(0|k):new Array(0|k);h<l.length;)c=a.indexOf(l.charAt(h++))<<2|(m=a.indexOf(l.charAt(h++)))>>4,d=(15&m)<<4|(f=a.indexOf(l.charAt(h++)))>>2,u=(3&f)<<6|(v=a.indexOf(l.charAt(h++))),x[b++]=c,f!==64&&(x[b++]=d),v!==64&&(x[b++]=u);return x}},{"./support":30,"./utils":32}],2:[function(r,n,o){var i=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,u,m,f,v){this.compressedSize=d,this.uncompressedSize=u,this.crc32=m,this.compression=f,this.compressedContent=v}c.prototype={getContentWorker:function(){var d=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),u=this;return d.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,u,m){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(u.compressWorker(m)).pipe(new l("compressedSize")).withStreamInfo("compression",u)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,o){var i=r("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,o){var i=r("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,d,u,m){var f=s,v=m+u;c^=-1;for(var h=m;h<v;h++)c=c>>>8^f[255&(c^d[h])];return-1^c})(0|l,a,a.length,0):(function(c,d,u,m){var f=s,v=m+u;c^=-1;for(var h=m;h<v;h++)c=c>>>8^f[255&(c^d.charCodeAt(h))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(r,n,o){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=i?"uint8array":"array";function d(u,m){l.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=m,this.meta={}}o.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,u.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(m){u.push({data:m,meta:u.meta})}},o.compressWorker=function(u){return new d("Deflate",u)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,o){function i(f,v){var h,b="";for(h=0;h<v;h++)b+=String.fromCharCode(255&f),f>>>=8;return b}function s(f,v,h,b,g,x){var k,_,C=f.file,I=f.compression,A=x!==c.utf8encode,D=a.transformTo("string",x(C.name)),R=a.transformTo("string",c.utf8encode(C.name)),F=C.comment,Y=a.transformTo("string",x(F)),N=a.transformTo("string",c.utf8encode(F)),M=R.length!==C.name.length,y=N.length!==F.length,B="",te="",U="",$=C.dir,Z=C.date,ne={crc32:0,compressedSize:0,uncompressedSize:0};v&&!h||(ne.crc32=f.crc32,ne.compressedSize=f.compressedSize,ne.uncompressedSize=f.uncompressedSize);var z=0;v&&(z|=8),A||!M&&!y||(z|=2048);var L=0,K=0;$&&(L|=16),g==="UNIX"?(K=798,L|=(function(ee,ue){var re=ee;return ee||(re=ue?16893:33204),(65535&re)<<16})(C.unixPermissions,$)):(K=20,L|=(function(ee){return 63&(ee||0)})(C.dosPermissions)),k=Z.getUTCHours(),k<<=6,k|=Z.getUTCMinutes(),k<<=5,k|=Z.getUTCSeconds()/2,_=Z.getUTCFullYear()-1980,_<<=4,_|=Z.getUTCMonth()+1,_<<=5,_|=Z.getUTCDate(),M&&(te=i(1,1)+i(d(D),4)+R,B+="up"+i(te.length,2)+te),y&&(U=i(1,1)+i(d(Y),4)+N,B+="uc"+i(U.length,2)+U);var q="";return q+=`
|
|
12
|
+
\0`,q+=i(z,2),q+=I.magic,q+=i(k,2),q+=i(_,2),q+=i(ne.crc32,4),q+=i(ne.compressedSize,4),q+=i(ne.uncompressedSize,4),q+=i(D.length,2),q+=i(B.length,2),{fileRecord:u.LOCAL_FILE_HEADER+q+D+B,dirRecord:u.CENTRAL_FILE_HEADER+i(K,2)+q+i(Y.length,2)+"\0\0\0\0"+i(L,4)+i(b,4)+D+B+Y}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),u=r("../signature");function m(f,v,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=h,this.encodeFileName=b,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,l),m.prototype.push=function(f){var v=f.meta.percent||0,h=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:h?(v+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var v=this.streamFiles&&!f.file.dir;if(v){var h=s(f,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(f){this.accumulate=!1;var v=this.streamFiles&&!f.file.dir,h=s(f,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),v)this.push({data:(function(b){return u.DATA_DESCRIPTOR+i(b.crc32,4)+i(b.compressedSize,4)+i(b.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var f=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var h=this.bytesWritten-f,b=(function(g,x,k,_,C){var I=a.transformTo("string",C(_));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(x,4)+i(k,4)+i(I.length,2)+I})(this.dirRecords.length,h,f,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(f){this._sources.push(f);var v=this;return f.on("data",function(h){v.processChunk(h)}),f.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),f.on("error",function(h){v.error(h)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(f){var v=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var h=0;h<v.length;h++)try{v[h].error(f)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,v=0;v<f.length;v++)f[v].lock()},n.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,o){var i=r("../compressions"),s=r("./ZipFileWorker");o.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),u=0;try{a.forEach(function(m,f){u++;var v=(function(x,k){var _=x||k,C=i[_];if(!C)throw new Error(_+" is not a valid compression method !");return C})(f.options.compression,l.compression),h=f.options.compressionOptions||l.compressionOptions||{},b=f.dir,g=f.date;f._compressWorker(v,h).withStreamInfo("file",{name:m,dir:b,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(d)}),d.entriesCount=u}catch(m){d.error(m)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=r("./object")).loadAsync=r("./load"),i.support=r("./support"),i.defaults=r("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=r("./external"),n.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,o){var i=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function u(m){return new s.Promise(function(f,v){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){v(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}n.exports=function(m,f){var v=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",m,!0,f.optimizedBinaryString,f.base64).then(function(h){var b=new l(f);return b.load(h),b}).then(function(h){var b=[s.Promise.resolve(h)],g=h.files;if(f.checkCRC32)for(var x=0;x<g.length;x++)b.push(u(g[x]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),g=b.files,x=0;x<g.length;x++){var k=g[x],_=k.fileNameStr,C=i.resolve(k.fileNameStr);v.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(v.file(C).unsafeOriginalName=_)}return b.zipComment.length&&(v.comment=b.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,o){var i=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,o){var i=r("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var d=this;a.on("data",function(u,m){d.push(u)||d._helper.pause(),c&&c(m)}).on("error",function(u){d.emit("error",u)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(r,n,o){function i(C,I,A){var D,R=a.getTypeOf(I),F=a.extend(A||{},d);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(C=g(C)),F.createFolders&&(D=b(C))&&x.call(this,D,!0);var Y=R==="string"&&F.binary===!1&&F.base64===!1;A&&A.binary!==void 0||(F.binary=!Y),(I instanceof u&&I.uncompressedSize===0||F.dir||!I||I.length===0)&&(F.base64=!1,F.binary=!0,I="",F.compression="STORE",R="string");var N=null;N=I instanceof u||I instanceof l?I:v.isNode&&v.isStream(I)?new h(C,I):a.prepareContent(C,I,F.binary,F.optimizedBinaryString,F.base64);var M=new m(C,N,F);this.files[C]=M}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),u=r("./compressedObject"),m=r("./zipObject"),f=r("./generate"),v=r("./nodejsUtils"),h=r("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var I=C.lastIndexOf("/");return 0<I?C.substring(0,I):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},x=function(C,I){return I=I!==void 0?I:d.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:I}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var I,A,D;for(I in this.files)D=this.files[I],(A=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&C(A,D)},filter:function(C){var I=[];return this.forEach(function(A,D){C(A,D)&&I.push(D)}),I},file:function(C,I,A){if(arguments.length!==1)return C=this.root+C,i.call(this,C,I,A),this;if(k(C)){var D=C;return this.filter(function(F,Y){return!Y.dir&&D.test(F)})}var R=this.files[this.root+C];return R&&!R.dir?R:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(R,F){return F.dir&&C.test(R)});var I=this.root+C,A=x.call(this,I),D=this.clone();return D.root=A.name,D},remove:function(C){C=this.root+C;var I=this.files[C];if(I||(C.slice(-1)!=="/"&&(C+="/"),I=this.files[C]),I&&!I.dir)delete this.files[C];else for(var A=this.filter(function(R,F){return F.name.slice(0,C.length)===C}),D=0;D<A.length;D++)delete this.files[A[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var I,A={};try{if((A=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var D=A.comment||this.comment||"";I=f.generateWorker(this,A,D)}catch(R){(I=new l("error")).error(R)}return new c(I,A.type||"string",A.mimeType)},generateAsync:function(C,I){return this.generateInternalStream(C).accumulate(I)},generateNodeStream:function(C,I){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(I)}};n.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,o){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===d&&this.data[m+3]===u)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&d===m[2]&&u===m[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,o){var i=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,o){var i=r("./Uint8ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,o){var i=r("./ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,o){var i=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(u){var m=i.getTypeOf(u);return i.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new c(u):s.uint8array?new d(i.transformTo("uint8array",u)):new a(i.transformTo("array",u)):new l(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,o){var i=r("./GenericWorker"),s=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,o){var i=r("./GenericWorker"),s=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=i.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=i},{}],29:[function(r,n,o){var i=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),u=null;if(c.nodestream)try{u=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(v,h){return new d.Promise(function(b,g){var x=[],k=v._internalType,_=v._outputType,C=v._mimeType;v.on("data",function(I,A){x.push(I),h&&h(A)}).on("error",function(I){x=[],g(I)}).on("end",function(){try{var I=(function(A,D,R){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),R);case"base64":return l.encode(D);default:return i.transformTo(A,D)}})(_,(function(A,D){var R,F=0,Y=null,N=0;for(R=0;R<D.length;R++)N+=D[R].length;switch(A){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(Y=new Uint8Array(N),R=0;R<D.length;R++)Y.set(D[R],F),F+=D[R].length;return Y;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,x),C);b(I)}catch(A){g(A)}x=[]}).resume()})}function f(v,h,b){var g=h;switch(h){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=h,this._mimeType=b,i.checkSupport(g),this._worker=v.pipe(new s(g)),v.lock()}catch(x){this._worker=new a("error"),this._worker.error(x)}}f.prototype={accumulate:function(v){return m(this,v)},on:function(v,h){var b=this;return v==="data"?this._worker.on(v,function(g){h.call(b,g.data,g.meta)}):this._worker.on(v,function(){i.delay(h,arguments,b)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},v)}},n.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,o){for(var i=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function u(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(v){var h,b,g,x,k,_=v.length,C=0;for(x=0;x<_;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),x=k=0;k<C;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),b<128?h[k++]=b:(b<2048?h[k++]=192|b>>>6:(b<65536?h[k++]=224|b>>>12:(h[k++]=240|b>>>18,h[k++]=128|b>>>12&63),h[k++]=128|b>>>6&63),h[k++]=128|63&b);return h})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(v){var h,b,g,x,k=v.length,_=new Array(2*k);for(h=b=0;h<k;)if((g=v[h++])<128)_[b++]=g;else if(4<(x=c[g]))_[b++]=65533,h+=x-1;else{for(g&=x===2?31:x===3?15:7;1<x&&h<k;)g=g<<6|63&v[h++],x--;1<x?_[b++]=65533:g<65536?_[b++]=g:(g-=65536,_[b++]=55296|g>>10&1023,_[b++]=56320|1023&g)}return _.length!==b&&(_.subarray?_=_.subarray(0,b):_.length=b),i.applyFromCharCode(_)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(u,l),u.prototype.processChunk=function(f){var v=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=v;(v=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),v.set(h,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var b=(function(x,k){var _;for((k=k||x.length)>x.length&&(k=x.length),_=k-1;0<=_&&(192&x[_])==128;)_--;return _<0||_===0?k:_+c[x[_]]>k?_:k})(v),g=v;b!==v.length&&(s.uint8array?(g=v.subarray(0,b),this.leftOver=v.subarray(b,v.length)):(g=v.slice(0,b),this.leftOver=v.slice(b,v.length))),this.push({data:o.utf8decode(g),meta:f.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=u,i.inherits(m,l),m.prototype.processChunk=function(f){this.push({data:o.utf8encode(f.data),meta:f.meta})},o.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,o){var i=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(h){return h}function d(h,b){for(var g=0;g<h.length;++g)b[g]=255&h.charCodeAt(g);return b}r("setimmediate"),o.newBlob=function(h,b){o.checkSupport("blob");try{return new Blob([h],{type:b})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(h),g.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(h,b,g){var x=[],k=0,_=h.length;if(_<=g)return String.fromCharCode.apply(null,h);for(;k<_;)b==="array"||b==="nodebuffer"?x.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+g,_)))):x.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+g,_)))),k+=g;return x.join("")},stringifyByChar:function(h){for(var b="",g=0;g<h.length;g++)b+=String.fromCharCode(h[g]);return b},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(h){var b=65536,g=o.getTypeOf(h),x=!0;if(g==="uint8array"?x=u.applyCanBeUsed.uint8array:g==="nodebuffer"&&(x=u.applyCanBeUsed.nodebuffer),x)for(;1<b;)try{return u.stringifyByChunk(h,g,b)}catch{b=Math.floor(b/2)}return u.stringifyByChar(h)}function f(h,b){for(var g=0;g<h.length;g++)b[g]=h[g];return b}o.applyFromCharCode=m;var v={};v.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return v.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},v.array={string:m,array:c,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(h)}},v.arraybuffer={string:function(h){return m(new Uint8Array(h))},array:function(h){return f(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:c,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(new Uint8Array(h))}},v.uint8array={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:c,nodebuffer:function(h){return a.newBufferFrom(h)}},v.nodebuffer={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return v.nodebuffer.uint8array(h).buffer},uint8array:function(h){return f(h,new Uint8Array(h.length))},nodebuffer:c},o.transformTo=function(h,b){if(b=b||"",!h)return b;o.checkSupport(h);var g=o.getTypeOf(b);return v[g][h](b)},o.resolve=function(h){for(var b=h.split("/"),g=[],x=0;x<b.length;x++){var k=b[x];k==="."||k===""&&x!==0&&x!==b.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(h)?"nodebuffer":i.uint8array&&h instanceof Uint8Array?"uint8array":i.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(h){if(!i[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(h){var b,g,x="";for(g=0;g<(h||"").length;g++)x+="\\x"+((b=h.charCodeAt(g))<16?"0":"")+b.toString(16).toUpperCase();return x},o.delay=function(h,b,g){setImmediate(function(){h.apply(g||null,b||[])})},o.inherits=function(h,b){function g(){}g.prototype=b.prototype,h.prototype=new g},o.extend=function(){var h,b,g={};for(h=0;h<arguments.length;h++)for(b in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],b)&&g[b]===void 0&&(g[b]=arguments[h][b]);return g},o.prepareContent=function(h,b,g,x,k){return l.Promise.resolve(b).then(function(_){return i.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,I){var A=new FileReader;A.onload=function(D){C(D.target.result)},A.onerror=function(D){I(D.target.error)},A.readAsArrayBuffer(_)}):_}).then(function(_){var C=o.getTypeOf(_);return C?(C==="arraybuffer"?_=o.transformTo("uint8array",_):C==="string"&&(k?_=s.decode(_):g&&x!==!0&&(_=(function(I){return d(I,i.uint8array?new Uint8Array(I.length):new Array(I.length))})(_))),_):l.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(u){this.files=[],this.loadOptions=u}d.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(u)+")")}},isSignature:function(u,m){var f=this.reader.index;this.reader.setIndex(u);var v=this.reader.readString(4)===m;return this.reader.setIndex(f),v},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",f=s.transformTo(m,u);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u,m,f,v=this.zip64EndOfCentralSize-44;0<v;)u=this.reader.readInt(2),m=this.reader.readInt(4),f=this.reader.readData(m),this.zip64ExtensibleData[u]={id:u,length:m,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,m;for(u=0;u<this.files.length;u++)m=this.files[u],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(u=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(u<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(u);var m=u;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(u=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var v=m-f;if(0<v)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(u){this.reader=i(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),u=r("./support");function m(f,v){this.options=f,this.loadOptions=v}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var v,h;if(f.skip(22),this.fileNameLength=f.readInt(2),h=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=(function(b){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===b)return d[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,v,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var v=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(v),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var v,h,b,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)v=f.readInt(2),h=f.readInt(2),b=f.readData(h),this.extraFields[v]={id:v,length:h,value:b};f.setIndex(g)},handleUTF8:function(){var f=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var h=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var v=i(f.value);return v.readInt(1)!==1||l(this.fileName)!==v.readInt(4)?null:c.utf8decode(v.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var v=i(f.value);return v.readInt(1)!==1||l(this.fileComment)!==v.readInt(4)?null:c.utf8decode(v.readData(f.length-5))}return null}},n.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,o){function i(v,h,b){this.name=v,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=h,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");i.prototype={internalStream:function(v){var h=null,b="string";try{if(!v)throw new Error("No output type specified.");var g=(b=v.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var x=!this._dataBinary;x&&!g&&(h=h.pipe(new l.Utf8EncodeWorker)),!x&&g&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(v,h){return this.internalStream(v).accumulate(h)},nodeStream:function(v,h){return this.internalStream(v||"nodebuffer").toNodejsStream(h)},_compressWorker:function(v,h){if(this._data instanceof c&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,v,h)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<u.length;f++)i.prototype[u[f]]=m;n.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,d=new l(v),u=i.document.createTextNode("");d.observe(u,{characterData:!0}),s=function(){u.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var h=i.document.createElement("script");h.onreadystatechange=function(){v(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(v,0)};else{var m=new i.MessageChannel;m.port1.onmessage=v,s=function(){m.port2.postMessage(0)}}var f=[];function v(){var h,b;a=!0;for(var g=f.length;g;){for(b=f,f=[],h=-1;++h<g;)b[h]();g=f.length}a=!1}n.exports=function(h){f.push(h)!==1||a||s()}}).call(this,typeof pt<"u"?pt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,o){var i=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function u(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,g!==s&&h(this,g)}function m(g,x,k){this.promise=g,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,x,k){i(function(){var _;try{_=x(k)}catch(C){return a.reject(g,C)}_===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,_)})}function v(g){var x=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof x=="function")return function(){x.apply(g,arguments)}}function h(g,x){var k=!1;function _(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var I=b(function(){x(C,_)});I.status==="error"&&_(I.value)}function b(g,x){var k={};try{k.value=g(x),k.status="success"}catch(_){k.status="error",k.value=_}return k}(n.exports=u).prototype.finally=function(g){if(typeof g!="function")return this;var x=this.constructor;return this.then(function(k){return x.resolve(g()).then(function(){return k})},function(k){return x.resolve(g()).then(function(){throw k})})},u.prototype.catch=function(g){return this.then(null,g)},u.prototype.then=function(g,x){if(typeof g!="function"&&this.state===c||typeof x!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===c?g:x,this.outcome):this.queue.push(new m(k,g,x)),k},m.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},m.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},m.prototype.callRejected=function(g){a.reject(this.promise,g)},m.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,x){var k=b(v,x);if(k.status==="error")return a.reject(g,k.value);var _=k.value;if(_)h(g,_);else{g.state=c,g.outcome=x;for(var C=-1,I=g.queue.length;++C<I;)g.queue[C].callFulfilled(x)}return g},a.reject=function(g,x){g.state=l,g.outcome=x;for(var k=-1,_=g.queue.length;++k<_;)g.queue[k].callRejected(x);return g},u.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},u.reject=function(g){var x=new this(s);return a.reject(x,g)},u.all=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=new Array(k),I=0,A=-1,D=new this(s);++A<k;)R(g[A],A);return D;function R(F,Y){x.resolve(F).then(function(N){C[Y]=N,++I!==k||_||(_=!0,a.resolve(D,C))},function(N){_||(_=!0,a.reject(D,N))})}},u.race=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=-1,I=new this(s);++C<k;)A=g[C],x.resolve(A).then(function(D){_||(_=!0,a.resolve(I,D))},function(D){_||(_=!0,a.reject(I,D))});var A;return I}},{immediate:36}],38:[function(r,n,o){var i={};(0,r("./lib/utils/common").assign)(i,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,o){var i=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,u=0,m=-1,f=0,v=8;function h(g){if(!(this instanceof h))return new h(g);this.options=s.assign({level:m,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(k!==u)throw new Error(l[k]);if(x.header&&i.deflateSetHeader(this.strm,x.header),x.dictionary){var _;if(_=typeof x.dictionary=="string"?a.string2buf(x.dictionary):d.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(k=i.deflateSetDictionary(this.strm,_))!==u)throw new Error(l[k]);this._dict_set=!0}}function b(g,x){var k=new h(x);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(g,x){var k,_,C=this.strm,I=this.options.chunkSize;if(this.ended)return!1;_=x===~~x?x:x===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(I),C.next_out=0,C.avail_out=I),(k=i.deflate(C,_))!==1&&k!==u)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return _===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===u):_!==2||(this.onEnd(u),!(C.avail_out=0))},h.prototype.onData=function(g){this.chunks.push(g)},h.prototype.onEnd=function(g){g===u&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=h,o.deflate=b,o.deflateRaw=function(g,x){return(x=x||{}).raw=!0,b(g,x)},o.gzip=function(g,x){return(x=x||{}).gzip=!0,b(g,x)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,o){var i=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),u=r("./zlib/gzheader"),m=Object.prototype.toString;function f(h){if(!(this instanceof f))return new f(h);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},h||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||h&&h.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,b.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function v(h,b){var g=new f(b);if(g.push(h,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(h,b){var g,x,k,_,C,I,A=this.strm,D=this.options.chunkSize,R=this.options.dictionary,F=!1;if(this.ended)return!1;x=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof h=="string"?A.input=a.binstring2buf(h):m.call(h)==="[object ArrayBuffer]"?A.input=new Uint8Array(h):A.input=h,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new s.Buf8(D),A.next_out=0,A.avail_out=D),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(I=typeof R=="string"?a.string2buf(R):m.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,g=i.inflateSetDictionary(this.strm,I)),g===l.Z_BUF_ERROR&&F===!0&&(g=l.Z_OK,F=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);A.next_out&&(A.avail_out!==0&&g!==l.Z_STREAM_END&&(A.avail_in!==0||x!==l.Z_FINISH&&x!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),_=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=_,A.avail_out=D-_,_&&s.arraySet(A.output,A.output,k,_,0),this.onData(C)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(F=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(x=l.Z_FINISH),x===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):x!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(h){this.chunks.push(h)},f.prototype.onEnd=function(h){h===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},o.Inflate=f,o.inflate=v,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,v(h,b)},o.ungzip=v},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var u in d)d.hasOwnProperty(u)&&(l[u]=d[u])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,u,m){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+u),m);else for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){var c,d,u,m,f,v;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(v=new Uint8Array(u),c=m=0,d=l.length;c<d;c++)f=l[c],v.set(f,m),m+=f.length;return v}},a={arraySet:function(l,c,d,u,m){for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(r,n,o){var i=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(u,m){if(m<65537&&(u.subarray&&a||!u.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(u,m));for(var f="",v=0;v<m;v++)f+=String.fromCharCode(u[v]);return f}l[254]=l[254]=1,o.string2buf=function(u){var m,f,v,h,b,g=u.length,x=0;for(h=0;h<g;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-56320),h++),x+=f<128?1:f<2048?2:f<65536?3:4;for(m=new i.Buf8(x),h=b=0;b<x;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-56320),h++),f<128?m[b++]=f:(f<2048?m[b++]=192|f>>>6:(f<65536?m[b++]=224|f>>>12:(m[b++]=240|f>>>18,m[b++]=128|f>>>12&63),m[b++]=128|f>>>6&63),m[b++]=128|63&f);return m},o.buf2binstring=function(u){return d(u,u.length)},o.binstring2buf=function(u){for(var m=new i.Buf8(u.length),f=0,v=m.length;f<v;f++)m[f]=u.charCodeAt(f);return m},o.buf2string=function(u,m){var f,v,h,b,g=m||u.length,x=new Array(2*g);for(f=v=0;f<g;)if((h=u[f++])<128)x[v++]=h;else if(4<(b=l[h]))x[v++]=65533,f+=b-1;else{for(h&=b===2?31:b===3?15:7;1<b&&f<g;)h=h<<6|63&u[f++],b--;1<b?x[v++]=65533:h<65536?x[v++]=h:(h-=65536,x[v++]=55296|h>>10&1023,x[v++]=56320|1023&h)}return d(x,v)},o.utf8border=function(u,m){var f;for((m=m||u.length)>u.length&&(m=u.length),f=m-1;0<=f&&(192&u[f])==128;)f--;return f<0||f===0?m:f+l[u[f]]>m?f:m}},{"./common":41}],43:[function(r,n,o){n.exports=function(i,s,a,l){for(var c=65535&i|0,d=i>>>16&65535|0,u=0;a!==0;){for(a-=u=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--u;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();n.exports=function(s,a,l,c){var d=i,u=c+l;s^=-1;for(var m=c;m<u;m++)s=s>>>8^d[255&(s^a[m])];return-1^s}},{}],46:[function(r,n,o){var i,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),u=0,m=4,f=0,v=-2,h=-1,b=4,g=2,x=8,k=9,_=286,C=30,I=19,A=2*_+1,D=15,R=3,F=258,Y=F+R+1,N=42,M=113,y=1,B=2,te=3,U=4;function $(w,X){return w.msg=d[X],X}function Z(w){return(w<<1)-(4<w?9:0)}function ne(w){for(var X=w.length;0<=--X;)w[X]=0}function z(w){var X=w.state,H=X.pending;H>w.avail_out&&(H=w.avail_out),H!==0&&(s.arraySet(w.output,X.pending_buf,X.pending_out,H,w.next_out),w.next_out+=H,X.pending_out+=H,w.total_out+=H,w.avail_out-=H,X.pending-=H,X.pending===0&&(X.pending_out=0))}function L(w,X){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,X),w.block_start=w.strstart,z(w.strm)}function K(w,X){w.pending_buf[w.pending++]=X}function q(w,X){w.pending_buf[w.pending++]=X>>>8&255,w.pending_buf[w.pending++]=255&X}function ee(w,X){var H,T,S=w.max_chain_length,P=w.strstart,W=w.prev_length,G=w.nice_match,O=w.strstart>w.w_size-Y?w.strstart-(w.w_size-Y):0,V=w.window,J=w.w_mask,Q=w.prev,se=w.strstart+F,pe=V[P+W-1],he=V[P+W];w.prev_length>=w.good_match&&(S>>=2),G>w.lookahead&&(G=w.lookahead);do if(V[(H=X)+W]===he&&V[H+W-1]===pe&&V[H]===V[P]&&V[++H]===V[P+1]){P+=2,H++;do;while(V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&P<se);if(T=F-(se-P),P=se-F,W<T){if(w.match_start=X,G<=(W=T))break;pe=V[P+W-1],he=V[P+W]}}while((X=Q[X&J])>O&&--S!=0);return W<=w.lookahead?W:w.lookahead}function ue(w){var X,H,T,S,P,W,G,O,V,J,Q=w.w_size;do{if(S=w.window_size-w.lookahead-w.strstart,w.strstart>=Q+(Q-Y)){for(s.arraySet(w.window,w.window,Q,Q,0),w.match_start-=Q,w.strstart-=Q,w.block_start-=Q,X=H=w.hash_size;T=w.head[--X],w.head[X]=Q<=T?T-Q:0,--H;);for(X=H=Q;T=w.prev[--X],w.prev[X]=Q<=T?T-Q:0,--H;);S+=Q}if(w.strm.avail_in===0)break;if(W=w.strm,G=w.window,O=w.strstart+w.lookahead,V=S,J=void 0,J=W.avail_in,V<J&&(J=V),H=J===0?0:(W.avail_in-=J,s.arraySet(G,W.input,W.next_in,J,O),W.state.wrap===1?W.adler=l(W.adler,G,J,O):W.state.wrap===2&&(W.adler=c(W.adler,G,J,O)),W.next_in+=J,W.total_in+=J,J),w.lookahead+=H,w.lookahead+w.insert>=R)for(P=w.strstart-w.insert,w.ins_h=w.window[P],w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+R-1])&w.hash_mask,w.prev[P&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=P,P++,w.insert--,!(w.lookahead+w.insert<R)););}while(w.lookahead<Y&&w.strm.avail_in!==0)}function re(w,X){for(var H,T;;){if(w.lookahead<Y){if(ue(w),w.lookahead<Y&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=R&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),H!==0&&w.strstart-H<=w.w_size-Y&&(w.match_length=ee(w,H)),w.match_length>=R)if(T=a._tr_tally(w,w.strstart-w.match_start,w.match_length-R),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=R){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else T=a._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(T&&(L(w,!1),w.strm.avail_out===0))return y}return w.insert=w.strstart<R-1?w.strstart:R-1,X===m?(L(w,!0),w.strm.avail_out===0?te:U):w.last_lit&&(L(w,!1),w.strm.avail_out===0)?y:B}function ie(w,X){for(var H,T,S;;){if(w.lookahead<Y){if(ue(w),w.lookahead<Y&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=R&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=R-1,H!==0&&w.prev_length<w.max_lazy_match&&w.strstart-H<=w.w_size-Y&&(w.match_length=ee(w,H),w.match_length<=5&&(w.strategy===1||w.match_length===R&&4096<w.strstart-w.match_start)&&(w.match_length=R-1)),w.prev_length>=R&&w.match_length<=w.prev_length){for(S=w.strstart+w.lookahead-R,T=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-R),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=S&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=R-1,w.strstart++,T&&(L(w,!1),w.strm.avail_out===0))return y}else if(w.match_available){if((T=a._tr_tally(w,0,w.window[w.strstart-1]))&&L(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return y}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(T=a._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<R-1?w.strstart:R-1,X===m?(L(w,!0),w.strm.avail_out===0?te:U):w.last_lit&&(L(w,!1),w.strm.avail_out===0)?y:B}function ae(w,X,H,T,S){this.good_length=w,this.max_lazy=X,this.nice_length=H,this.max_chain=T,this.func=S}function oe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*A),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*I+1)),ne(this.dyn_ltree),ne(this.dyn_dtree),ne(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(D+1),this.heap=new s.Buf16(2*_+1),ne(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*_+1),ne(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function le(w){var X;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=g,(X=w.state).pending=0,X.pending_out=0,X.wrap<0&&(X.wrap=-X.wrap),X.status=X.wrap?N:M,w.adler=X.wrap===2?0:1,X.last_flush=u,a._tr_init(X),f):$(w,v)}function fe(w){var X=le(w);return X===f&&(function(H){H.window_size=2*H.w_size,ne(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=R-1,H.match_available=0,H.ins_h=0})(w.state),X}function ve(w,X,H,T,S,P){if(!w)return v;var W=1;if(X===h&&(X=6),T<0?(W=0,T=-T):15<T&&(W=2,T-=16),S<1||k<S||H!==x||T<8||15<T||X<0||9<X||P<0||b<P)return $(w,v);T===8&&(T=9);var G=new oe;return(w.state=G).strm=w,G.wrap=W,G.gzhead=null,G.w_bits=T,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=S+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+R-1)/R),G.window=new s.Buf8(2*G.w_size),G.head=new s.Buf16(G.hash_size),G.prev=new s.Buf16(G.w_size),G.lit_bufsize=1<<S+6,G.pending_buf_size=4*G.lit_bufsize,G.pending_buf=new s.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=X,G.strategy=P,G.method=H,fe(w)}i=[new ae(0,0,0,0,function(w,X){var H=65535;for(H>w.pending_buf_size-5&&(H=w.pending_buf_size-5);;){if(w.lookahead<=1){if(ue(w),w.lookahead===0&&X===u)return y;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var T=w.block_start+H;if((w.strstart===0||w.strstart>=T)&&(w.lookahead=w.strstart-T,w.strstart=T,L(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-Y&&(L(w,!1),w.strm.avail_out===0))return y}return w.insert=0,X===m?(L(w,!0),w.strm.avail_out===0?te:U):(w.strstart>w.block_start&&(L(w,!1),w.strm.avail_out),y)}),new ae(4,4,8,4,re),new ae(4,5,16,8,re),new ae(4,6,32,32,re),new ae(4,4,16,16,ie),new ae(8,16,32,32,ie),new ae(8,16,128,128,ie),new ae(8,32,128,256,ie),new ae(32,128,258,1024,ie),new ae(32,258,258,4096,ie)],o.deflateInit=function(w,X){return ve(w,X,x,15,8,0)},o.deflateInit2=ve,o.deflateReset=fe,o.deflateResetKeep=le,o.deflateSetHeader=function(w,X){return w&&w.state?w.state.wrap!==2?v:(w.state.gzhead=X,f):v},o.deflate=function(w,X){var H,T,S,P;if(!w||!w.state||5<X||X<0)return w?$(w,v):v;if(T=w.state,!w.output||!w.input&&w.avail_in!==0||T.status===666&&X!==m)return $(w,w.avail_out===0?-5:v);if(T.strm=w,H=T.last_flush,T.last_flush=X,T.status===N)if(T.wrap===2)w.adler=0,K(T,31),K(T,139),K(T,8),T.gzhead?(K(T,(T.gzhead.text?1:0)+(T.gzhead.hcrc?2:0)+(T.gzhead.extra?4:0)+(T.gzhead.name?8:0)+(T.gzhead.comment?16:0)),K(T,255&T.gzhead.time),K(T,T.gzhead.time>>8&255),K(T,T.gzhead.time>>16&255),K(T,T.gzhead.time>>24&255),K(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),K(T,255&T.gzhead.os),T.gzhead.extra&&T.gzhead.extra.length&&(K(T,255&T.gzhead.extra.length),K(T,T.gzhead.extra.length>>8&255)),T.gzhead.hcrc&&(w.adler=c(w.adler,T.pending_buf,T.pending,0)),T.gzindex=0,T.status=69):(K(T,0),K(T,0),K(T,0),K(T,0),K(T,0),K(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),K(T,3),T.status=M);else{var W=x+(T.w_bits-8<<4)<<8;W|=(2<=T.strategy||T.level<2?0:T.level<6?1:T.level===6?2:3)<<6,T.strstart!==0&&(W|=32),W+=31-W%31,T.status=M,q(T,W),T.strstart!==0&&(q(T,w.adler>>>16),q(T,65535&w.adler)),w.adler=1}if(T.status===69)if(T.gzhead.extra){for(S=T.pending;T.gzindex<(65535&T.gzhead.extra.length)&&(T.pending!==T.pending_buf_size||(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending!==T.pending_buf_size));)K(T,255&T.gzhead.extra[T.gzindex]),T.gzindex++;T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),T.gzindex===T.gzhead.extra.length&&(T.gzindex=0,T.status=73)}else T.status=73;if(T.status===73)if(T.gzhead.name){S=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending===T.pending_buf_size)){P=1;break}P=T.gzindex<T.gzhead.name.length?255&T.gzhead.name.charCodeAt(T.gzindex++):0,K(T,P)}while(P!==0);T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),P===0&&(T.gzindex=0,T.status=91)}else T.status=91;if(T.status===91)if(T.gzhead.comment){S=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending===T.pending_buf_size)){P=1;break}P=T.gzindex<T.gzhead.comment.length?255&T.gzhead.comment.charCodeAt(T.gzindex++):0,K(T,P)}while(P!==0);T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),P===0&&(T.status=103)}else T.status=103;if(T.status===103&&(T.gzhead.hcrc?(T.pending+2>T.pending_buf_size&&z(w),T.pending+2<=T.pending_buf_size&&(K(T,255&w.adler),K(T,w.adler>>8&255),w.adler=0,T.status=M)):T.status=M),T.pending!==0){if(z(w),w.avail_out===0)return T.last_flush=-1,f}else if(w.avail_in===0&&Z(X)<=Z(H)&&X!==m)return $(w,-5);if(T.status===666&&w.avail_in!==0)return $(w,-5);if(w.avail_in!==0||T.lookahead!==0||X!==u&&T.status!==666){var G=T.strategy===2?(function(O,V){for(var J;;){if(O.lookahead===0&&(ue(O),O.lookahead===0)){if(V===u)return y;break}if(O.match_length=0,J=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,J&&(L(O,!1),O.strm.avail_out===0))return y}return O.insert=0,V===m?(L(O,!0),O.strm.avail_out===0?te:U):O.last_lit&&(L(O,!1),O.strm.avail_out===0)?y:B})(T,X):T.strategy===3?(function(O,V){for(var J,Q,se,pe,he=O.window;;){if(O.lookahead<=F){if(ue(O),O.lookahead<=F&&V===u)return y;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=R&&0<O.strstart&&(Q=he[se=O.strstart-1])===he[++se]&&Q===he[++se]&&Q===he[++se]){pe=O.strstart+F;do;while(Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&se<pe);O.match_length=F-(pe-se),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=R?(J=a._tr_tally(O,1,O.match_length-R),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(J=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),J&&(L(O,!1),O.strm.avail_out===0))return y}return O.insert=0,V===m?(L(O,!0),O.strm.avail_out===0?te:U):O.last_lit&&(L(O,!1),O.strm.avail_out===0)?y:B})(T,X):i[T.level].func(T,X);if(G!==te&&G!==U||(T.status=666),G===y||G===te)return w.avail_out===0&&(T.last_flush=-1),f;if(G===B&&(X===1?a._tr_align(T):X!==5&&(a._tr_stored_block(T,0,0,!1),X===3&&(ne(T.head),T.lookahead===0&&(T.strstart=0,T.block_start=0,T.insert=0))),z(w),w.avail_out===0))return T.last_flush=-1,f}return X!==m?f:T.wrap<=0?1:(T.wrap===2?(K(T,255&w.adler),K(T,w.adler>>8&255),K(T,w.adler>>16&255),K(T,w.adler>>24&255),K(T,255&w.total_in),K(T,w.total_in>>8&255),K(T,w.total_in>>16&255),K(T,w.total_in>>24&255)):(q(T,w.adler>>>16),q(T,65535&w.adler)),z(w),0<T.wrap&&(T.wrap=-T.wrap),T.pending!==0?f:1)},o.deflateEnd=function(w){var X;return w&&w.state?(X=w.state.status)!==N&&X!==69&&X!==73&&X!==91&&X!==103&&X!==M&&X!==666?$(w,v):(w.state=null,X===M?$(w,-3):f):v},o.deflateSetDictionary=function(w,X){var H,T,S,P,W,G,O,V,J=X.length;if(!w||!w.state||(P=(H=w.state).wrap)===2||P===1&&H.status!==N||H.lookahead)return v;for(P===1&&(w.adler=l(w.adler,X,J,0)),H.wrap=0,J>=H.w_size&&(P===0&&(ne(H.head),H.strstart=0,H.block_start=0,H.insert=0),V=new s.Buf8(H.w_size),s.arraySet(V,X,J-H.w_size,H.w_size,0),X=V,J=H.w_size),W=w.avail_in,G=w.next_in,O=w.input,w.avail_in=J,w.next_in=0,w.input=X,ue(H);H.lookahead>=R;){for(T=H.strstart,S=H.lookahead-(R-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[T+R-1])&H.hash_mask,H.prev[T&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=T,T++,--S;);H.strstart=T,H.lookahead=R-1,ue(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=R-1,H.match_available=0,w.next_in=G,w.input=O,w.avail_in=W,H.wrap=P,f},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,o){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,o){n.exports=function(i,s){var a,l,c,d,u,m,f,v,h,b,g,x,k,_,C,I,A,D,R,F,Y,N,M,y,B;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,B=i.output,u=d-(s-i.avail_out),m=d+(i.avail_out-257),f=a.dmax,v=a.wsize,h=a.whave,b=a.wnext,g=a.window,x=a.hold,k=a.bits,_=a.lencode,C=a.distcode,I=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),D=_[x&I];t:for(;;){if(x>>>=R=D>>>24,k-=R,(R=D>>>16&255)===0)B[d++]=65535&D;else{if(!(16&R)){if((64&R)==0){D=_[(65535&D)+(x&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}F=65535&D,(R&=15)&&(k<R&&(x+=y[l++]<<k,k+=8),F+=x&(1<<R)-1,x>>>=R,k-=R),k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),D=C[x&A];r:for(;;){if(x>>>=R=D>>>24,k-=R,!(16&(R=D>>>16&255))){if((64&R)==0){D=C[(65535&D)+(x&(1<<R)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(Y=65535&D,k<(R&=15)&&(x+=y[l++]<<k,(k+=8)<R&&(x+=y[l++]<<k,k+=8)),f<(Y+=x&(1<<R)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(x>>>=R,k-=R,(R=d-u)<Y){if(h<(R=Y-R)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=g,(N=0)===b){if(N+=v-R,R<F){for(F-=R;B[d++]=g[N++],--R;);N=d-Y,M=B}}else if(b<R){if(N+=v+b-R,(R-=b)<F){for(F-=R;B[d++]=g[N++],--R;);if(N=0,b<F){for(F-=R=b;B[d++]=g[N++],--R;);N=d-Y,M=B}}}else if(N+=b-R,R<F){for(F-=R;B[d++]=g[N++],--R;);N=d-Y,M=B}for(;2<F;)B[d++]=M[N++],B[d++]=M[N++],B[d++]=M[N++],F-=3;F&&(B[d++]=M[N++],1<F&&(B[d++]=M[N++]))}else{for(N=d-Y;B[d++]=B[N++],B[d++]=B[N++],B[d++]=B[N++],2<(F-=3););F&&(B[d++]=B[N++],1<F&&(B[d++]=B[N++]))}break}}break}}while(l<c&&d<m);l-=F=k>>3,x&=(1<<(k-=F<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=d<m?m-d+257:257-(d-m),a.hold=x,a.bits=k}},{}],49:[function(r,n,o){var i=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,u=2,m=0,f=-2,v=1,h=852,b=592;function g(N){return(N>>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function x(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(N){var M;return N&&N.state?(M=N.state,N.total_in=N.total_out=M.total=0,N.msg="",M.wrap&&(N.adler=1&M.wrap),M.mode=v,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(h),M.distcode=M.distdyn=new i.Buf32(b),M.sane=1,M.back=-1,m):f}function _(N){var M;return N&&N.state?((M=N.state).wsize=0,M.whave=0,M.wnext=0,k(N)):f}function C(N,M){var y,B;return N&&N.state?(B=N.state,M<0?(y=0,M=-M):(y=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?f:(B.window!==null&&B.wbits!==M&&(B.window=null),B.wrap=y,B.wbits=M,_(N))):f}function I(N,M){var y,B;return N?(B=new x,(N.state=B).window=null,(y=C(N,M))!==m&&(N.state=null),y):f}var A,D,R=!0;function F(N){if(R){var M;for(A=new i.Buf32(512),D=new i.Buf32(32),M=0;M<144;)N.lens[M++]=8;for(;M<256;)N.lens[M++]=9;for(;M<280;)N.lens[M++]=7;for(;M<288;)N.lens[M++]=8;for(c(d,N.lens,0,288,A,0,N.work,{bits:9}),M=0;M<32;)N.lens[M++]=5;c(u,N.lens,0,32,D,0,N.work,{bits:5}),R=!1}N.lencode=A,N.lenbits=9,N.distcode=D,N.distbits=5}function Y(N,M,y,B){var te,U=N.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new i.Buf8(U.wsize)),B>=U.wsize?(i.arraySet(U.window,M,y-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(B<(te=U.wsize-U.wnext)&&(te=B),i.arraySet(U.window,M,y-B,te,U.wnext),(B-=te)?(i.arraySet(U.window,M,y-B,B,0),U.wnext=B,U.whave=U.wsize):(U.wnext+=te,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=te))),0}o.inflateReset=_,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(N){return I(N,15)},o.inflateInit2=I,o.inflate=function(N,M){var y,B,te,U,$,Z,ne,z,L,K,q,ee,ue,re,ie,ae,oe,le,fe,ve,w,X,H,T,S=0,P=new i.Buf8(4),W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return f;(y=N.state).mode===12&&(y.mode=13),$=N.next_out,te=N.output,ne=N.avail_out,U=N.next_in,B=N.input,Z=N.avail_in,z=y.hold,L=y.bits,K=Z,q=ne,X=m;e:for(;;)switch(y.mode){case v:if(y.wrap===0){y.mode=13;break}for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(2&y.wrap&&z===35615){P[y.check=0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0),L=z=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",y.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",y.mode=30;break}if(L-=4,w=8+(15&(z>>>=4)),y.wbits===0)y.wbits=w;else if(w>y.wbits){N.msg="invalid window size",y.mode=30;break}y.dmax=1<<w,N.adler=y.check=1,y.mode=512&z?10:12,L=z=0;break;case 2:for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(y.flags=z,(255&y.flags)!=8){N.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){N.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=z>>8&1),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0,y.mode=3;case 3:for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.head&&(y.head.time=z),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,P[2]=z>>>16&255,P[3]=z>>>24&255,y.check=a(y.check,P,4,0)),L=z=0,y.mode=4;case 4:for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.head&&(y.head.xflags=255&z,y.head.os=z>>8),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0,y.mode=5;case 5:if(1024&y.flags){for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.length=z,y.head&&(y.head.extra_len=z),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Z<(ee=y.length)&&(ee=Z),ee&&(y.head&&(w=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,B,U,ee,w)),512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,y.length-=ee),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Z===0)break e;for(ee=0;w=B[U+ee++],y.head&&w&&y.length<65536&&(y.head.name+=String.fromCharCode(w)),w&&ee<Z;);if(512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,w)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Z===0)break e;for(ee=0;w=B[U+ee++],y.head&&w&&y.length<65536&&(y.head.comment+=String.fromCharCode(w)),w&&ee<Z;);if(512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,w)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z!==(65535&y.check)){N.msg="header crc mismatch",y.mode=30;break}L=z=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),N.adler=y.check=0,y.mode=12;break;case 10:for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}N.adler=y.check=g(z),L=z=0,y.mode=11;case 11:if(y.havedict===0)return N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,2;N.adler=y.check=1,y.mode=12;case 12:if(M===5||M===6)break e;case 13:if(y.last){z>>>=7&L,L-=7&L,y.mode=27;break}for(;L<3;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}switch(y.last=1&z,L-=1,3&(z>>>=1)){case 0:y.mode=14;break;case 1:if(F(y),y.mode=20,M!==6)break;z>>>=2,L-=2;break e;case 2:y.mode=17;break;case 3:N.msg="invalid block type",y.mode=30}z>>>=2,L-=2;break;case 14:for(z>>>=7&L,L-=7&L;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if((65535&z)!=(z>>>16^65535)){N.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&z,L=z=0,y.mode=15,M===6)break e;case 15:y.mode=16;case 16:if(ee=y.length){if(Z<ee&&(ee=Z),ne<ee&&(ee=ne),ee===0)break e;i.arraySet(te,B,U,ee,$),Z-=ee,U+=ee,ne-=ee,$+=ee,y.length-=ee;break}y.mode=12;break;case 17:for(;L<14;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(y.nlen=257+(31&z),z>>>=5,L-=5,y.ndist=1+(31&z),z>>>=5,L-=5,y.ncode=4+(15&z),z>>>=4,L-=4,286<y.nlen||30<y.ndist){N.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;L<3;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.lens[W[y.have++]]=7&z,z>>>=3,L-=3}for(;y.have<19;)y.lens[W[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,H={bits:y.lenbits},X=c(0,y.lens,0,19,y.lencode,0,y.work,H),y.lenbits=H.bits,X){N.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;ae=(S=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(oe<16)z>>>=ie,L-=ie,y.lens[y.have++]=oe;else{if(oe===16){for(T=ie+2;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z>>>=ie,L-=ie,y.have===0){N.msg="invalid bit length repeat",y.mode=30;break}w=y.lens[y.have-1],ee=3+(3&z),z>>>=2,L-=2}else if(oe===17){for(T=ie+3;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}L-=ie,w=0,ee=3+(7&(z>>>=ie)),z>>>=3,L-=3}else{for(T=ie+7;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}L-=ie,w=0,ee=11+(127&(z>>>=ie)),z>>>=7,L-=7}if(y.have+ee>y.nlen+y.ndist){N.msg="invalid bit length repeat",y.mode=30;break}for(;ee--;)y.lens[y.have++]=w}}if(y.mode===30)break;if(y.lens[256]===0){N.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,H={bits:y.lenbits},X=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,H),y.lenbits=H.bits,X){N.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,H={bits:y.distbits},X=c(u,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,H),y.distbits=H.bits,X){N.msg="invalid distances set",y.mode=30;break}if(y.mode=20,M===6)break e;case 20:y.mode=21;case 21:if(6<=Z&&258<=ne){N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,l(N,q),$=N.next_out,te=N.output,ne=N.avail_out,U=N.next_in,B=N.input,Z=N.avail_in,z=y.hold,L=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ae=(S=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(ae&&(240&ae)==0){for(le=ie,fe=ae,ve=oe;ae=(S=y.lencode[ve+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&S,!(le+(ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}z>>>=le,L-=le,y.back+=le}if(z>>>=ie,L-=ie,y.back+=ie,y.length=oe,ae===0){y.mode=26;break}if(32&ae){y.back=-1,y.mode=12;break}if(64&ae){N.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ae,y.mode=22;case 22:if(y.extra){for(T=y.extra;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.length+=z&(1<<y.extra)-1,z>>>=y.extra,L-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ae=(S=y.distcode[z&(1<<y.distbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if((240&ae)==0){for(le=ie,fe=ae,ve=oe;ae=(S=y.distcode[ve+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&S,!(le+(ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}z>>>=le,L-=le,y.back+=le}if(z>>>=ie,L-=ie,y.back+=ie,64&ae){N.msg="invalid distance code",y.mode=30;break}y.offset=oe,y.extra=15&ae,y.mode=24;case 24:if(y.extra){for(T=y.extra;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.offset+=z&(1<<y.extra)-1,z>>>=y.extra,L-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){N.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(ne===0)break e;if(ee=q-ne,y.offset>ee){if((ee=y.offset-ee)>y.whave&&y.sane){N.msg="invalid distance too far back",y.mode=30;break}ue=ee>y.wnext?(ee-=y.wnext,y.wsize-ee):y.wnext-ee,ee>y.length&&(ee=y.length),re=y.window}else re=te,ue=$-y.offset,ee=y.length;for(ne<ee&&(ee=ne),ne-=ee,y.length-=ee;te[$++]=re[ue++],--ee;);y.length===0&&(y.mode=21);break;case 26:if(ne===0)break e;te[$++]=y.length,ne--,y.mode=21;break;case 27:if(y.wrap){for(;L<32;){if(Z===0)break e;Z--,z|=B[U++]<<L,L+=8}if(q-=ne,N.total_out+=q,y.total+=q,q&&(N.adler=y.check=y.flags?a(y.check,te,q,$-q):s(y.check,te,q,$-q)),q=ne,(y.flags?z:g(z))!==y.check){N.msg="incorrect data check",y.mode=30;break}L=z=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z!==(4294967295&y.total)){N.msg="incorrect length check",y.mode=30;break}L=z=0}y.mode=29;case 29:X=1;break e;case 30:X=-3;break e;case 31:return-4;case 32:default:return f}return N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,(y.wsize||q!==N.avail_out&&y.mode<30&&(y.mode<27||M!==4))&&Y(N,N.output,N.next_out,q-N.avail_out)?(y.mode=31,-4):(K-=N.avail_in,q-=N.avail_out,N.total_in+=K,N.total_out+=q,y.total+=q,y.wrap&&q&&(N.adler=y.check=y.flags?a(y.check,te,q,N.next_out-q):s(y.check,te,q,N.next_out-q)),N.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(K==0&&q===0||M===4)&&X===m&&(X=-5),X)},o.inflateEnd=function(N){if(!N||!N.state)return f;var M=N.state;return M.window&&(M.window=null),N.state=null,m},o.inflateGetHeader=function(N,M){var y;return N&&N.state?(2&(y=N.state).wrap)==0?f:((y.head=M).done=!1,m):f},o.inflateSetDictionary=function(N,M){var y,B=M.length;return N&&N.state?(y=N.state).wrap!==0&&y.mode!==11?f:y.mode===11&&s(1,M,B,0)!==y.check?-3:Y(N,M,B,B)?(y.mode=31,-4):(y.havedict=1,m):f},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,o){var i=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,u,m,f,v,h,b,g){var x,k,_,C,I,A,D,R,F,Y=g.bits,N=0,M=0,y=0,B=0,te=0,U=0,$=0,Z=0,ne=0,z=0,L=null,K=0,q=new i.Buf16(16),ee=new i.Buf16(16),ue=null,re=0;for(N=0;N<=15;N++)q[N]=0;for(M=0;M<f;M++)q[u[m+M]]++;for(te=Y,B=15;1<=B&&q[B]===0;B--);if(B<te&&(te=B),B===0)return v[h++]=20971520,v[h++]=20971520,g.bits=1,0;for(y=1;y<B&&q[y]===0;y++);for(te<y&&(te=y),N=Z=1;N<=15;N++)if(Z<<=1,(Z-=q[N])<0)return-1;if(0<Z&&(d===0||B!==1))return-1;for(ee[1]=0,N=1;N<15;N++)ee[N+1]=ee[N]+q[N];for(M=0;M<f;M++)u[m+M]!==0&&(b[ee[u[m+M]]++]=M);if(A=d===0?(L=ue=b,19):d===1?(L=s,K-=257,ue=a,re-=257,256):(L=l,ue=c,-1),N=y,I=h,$=M=z=0,_=-1,C=(ne=1<<(U=te))-1,d===1&&852<ne||d===2&&592<ne)return 1;for(;;){for(D=N-$,F=b[M]<A?(R=0,b[M]):b[M]>A?(R=ue[re+b[M]],L[K+b[M]]):(R=96,0),x=1<<N-$,y=k=1<<U;v[I+(z>>$)+(k-=x)]=D<<24|R<<16|F|0,k!==0;);for(x=1<<N-1;z&x;)x>>=1;if(x!==0?(z&=x-1,z+=x):z=0,M++,--q[N]==0){if(N===B)break;N=u[m+b[M]]}if(te<N&&(z&C)!==_){for($===0&&($=te),I+=y,Z=1<<(U=N-$);U+$<B&&!((Z-=q[U+$])<=0);)U++,Z<<=1;if(ne+=1<<U,d===1&&852<ne||d===2&&592<ne)return 1;v[_=z&C]=te<<24|U<<16|I-h|0}}return z!==0&&(v[I+z]=N-$<<24|64<<16|0),g.bits=te,0}},{"../utils/common":41}],51:[function(r,n,o){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,o){var i=r("../utils/common"),s=0,a=1;function l(S){for(var P=S.length;0<=--P;)S[P]=0}var c=0,d=29,u=256,m=u+1+d,f=30,v=19,h=2*m+1,b=15,g=16,x=7,k=256,_=16,C=17,I=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=new Array(2*(m+2));l(Y);var N=new Array(2*f);l(N);var M=new Array(512);l(M);var y=new Array(256);l(y);var B=new Array(d);l(B);var te,U,$,Z=new Array(f);function ne(S,P,W,G,O){this.static_tree=S,this.extra_bits=P,this.extra_base=W,this.elems=G,this.max_length=O,this.has_stree=S&&S.length}function z(S,P){this.dyn_tree=S,this.max_code=0,this.stat_desc=P}function L(S){return S<256?M[S]:M[256+(S>>>7)]}function K(S,P){S.pending_buf[S.pending++]=255&P,S.pending_buf[S.pending++]=P>>>8&255}function q(S,P,W){S.bi_valid>g-W?(S.bi_buf|=P<<S.bi_valid&65535,K(S,S.bi_buf),S.bi_buf=P>>g-S.bi_valid,S.bi_valid+=W-g):(S.bi_buf|=P<<S.bi_valid&65535,S.bi_valid+=W)}function ee(S,P,W){q(S,W[2*P],W[2*P+1])}function ue(S,P){for(var W=0;W|=1&S,S>>>=1,W<<=1,0<--P;);return W>>>1}function re(S,P,W){var G,O,V=new Array(b+1),J=0;for(G=1;G<=b;G++)V[G]=J=J+W[G-1]<<1;for(O=0;O<=P;O++){var Q=S[2*O+1];Q!==0&&(S[2*O]=ue(V[Q]++,Q))}}function ie(S){var P;for(P=0;P<m;P++)S.dyn_ltree[2*P]=0;for(P=0;P<f;P++)S.dyn_dtree[2*P]=0;for(P=0;P<v;P++)S.bl_tree[2*P]=0;S.dyn_ltree[2*k]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function ae(S){8<S.bi_valid?K(S,S.bi_buf):0<S.bi_valid&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function oe(S,P,W,G){var O=2*P,V=2*W;return S[O]<S[V]||S[O]===S[V]&&G[P]<=G[W]}function le(S,P,W){for(var G=S.heap[W],O=W<<1;O<=S.heap_len&&(O<S.heap_len&&oe(P,S.heap[O+1],S.heap[O],S.depth)&&O++,!oe(P,G,S.heap[O],S.depth));)S.heap[W]=S.heap[O],W=O,O<<=1;S.heap[W]=G}function fe(S,P,W){var G,O,V,J,Q=0;if(S.last_lit!==0)for(;G=S.pending_buf[S.d_buf+2*Q]<<8|S.pending_buf[S.d_buf+2*Q+1],O=S.pending_buf[S.l_buf+Q],Q++,G===0?ee(S,O,P):(ee(S,(V=y[O])+u+1,P),(J=A[V])!==0&&q(S,O-=B[V],J),ee(S,V=L(--G),W),(J=D[V])!==0&&q(S,G-=Z[V],J)),Q<S.last_lit;);ee(S,k,P)}function ve(S,P){var W,G,O,V=P.dyn_tree,J=P.stat_desc.static_tree,Q=P.stat_desc.has_stree,se=P.stat_desc.elems,pe=-1;for(S.heap_len=0,S.heap_max=h,W=0;W<se;W++)V[2*W]!==0?(S.heap[++S.heap_len]=pe=W,S.depth[W]=0):V[2*W+1]=0;for(;S.heap_len<2;)V[2*(O=S.heap[++S.heap_len]=pe<2?++pe:0)]=1,S.depth[O]=0,S.opt_len--,Q&&(S.static_len-=J[2*O+1]);for(P.max_code=pe,W=S.heap_len>>1;1<=W;W--)le(S,V,W);for(O=se;W=S.heap[1],S.heap[1]=S.heap[S.heap_len--],le(S,V,1),G=S.heap[1],S.heap[--S.heap_max]=W,S.heap[--S.heap_max]=G,V[2*O]=V[2*W]+V[2*G],S.depth[O]=(S.depth[W]>=S.depth[G]?S.depth[W]:S.depth[G])+1,V[2*W+1]=V[2*G+1]=O,S.heap[1]=O++,le(S,V,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],(function(he,Ae){var Se,ze,St,Ee,sr,Pt,Ze=Ae.dyn_tree,Yn=Ae.max_code,Zn=Ae.stat_desc.static_tree,mi=Ae.stat_desc.has_stree,gi=Ae.stat_desc.extra_bits,Gn=Ae.stat_desc.extra_base,Ne=Ae.stat_desc.max_length,Ie=0;for(Ee=0;Ee<=b;Ee++)he.bl_count[Ee]=0;for(Ze[2*he.heap[he.heap_max]+1]=0,Se=he.heap_max+1;Se<h;Se++)Ne<(Ee=Ze[2*Ze[2*(ze=he.heap[Se])+1]+1]+1)&&(Ee=Ne,Ie++),Ze[2*ze+1]=Ee,Yn<ze||(he.bl_count[Ee]++,sr=0,Gn<=ze&&(sr=gi[ze-Gn]),Pt=Ze[2*ze],he.opt_len+=Pt*(Ee+sr),mi&&(he.static_len+=Pt*(Zn[2*ze+1]+sr)));if(Ie!==0){do{for(Ee=Ne-1;he.bl_count[Ee]===0;)Ee--;he.bl_count[Ee]--,he.bl_count[Ee+1]+=2,he.bl_count[Ne]--,Ie-=2}while(0<Ie);for(Ee=Ne;Ee!==0;Ee--)for(ze=he.bl_count[Ee];ze!==0;)Yn<(St=he.heap[--Se])||(Ze[2*St+1]!==Ee&&(he.opt_len+=(Ee-Ze[2*St+1])*Ze[2*St],Ze[2*St+1]=Ee),ze--)}})(S,P),re(V,pe,S.bl_count)}function w(S,P,W){var G,O,V=-1,J=P[1],Q=0,se=7,pe=4;for(J===0&&(se=138,pe=3),P[2*(W+1)+1]=65535,G=0;G<=W;G++)O=J,J=P[2*(G+1)+1],++Q<se&&O===J||(Q<pe?S.bl_tree[2*O]+=Q:O!==0?(O!==V&&S.bl_tree[2*O]++,S.bl_tree[2*_]++):Q<=10?S.bl_tree[2*C]++:S.bl_tree[2*I]++,V=O,pe=(Q=0)===J?(se=138,3):O===J?(se=6,3):(se=7,4))}function X(S,P,W){var G,O,V=-1,J=P[1],Q=0,se=7,pe=4;for(J===0&&(se=138,pe=3),G=0;G<=W;G++)if(O=J,J=P[2*(G+1)+1],!(++Q<se&&O===J)){if(Q<pe)for(;ee(S,O,S.bl_tree),--Q!=0;);else O!==0?(O!==V&&(ee(S,O,S.bl_tree),Q--),ee(S,_,S.bl_tree),q(S,Q-3,2)):Q<=10?(ee(S,C,S.bl_tree),q(S,Q-3,3)):(ee(S,I,S.bl_tree),q(S,Q-11,7));V=O,pe=(Q=0)===J?(se=138,3):O===J?(se=6,3):(se=7,4)}}l(Z);var H=!1;function T(S,P,W,G){q(S,(c<<1)+(G?1:0),3),(function(O,V,J,Q){ae(O),K(O,J),K(O,~J),i.arraySet(O.pending_buf,O.window,V,J,O.pending),O.pending+=J})(S,P,W)}o._tr_init=function(S){H||((function(){var P,W,G,O,V,J=new Array(b+1);for(O=G=0;O<d-1;O++)for(B[O]=G,P=0;P<1<<A[O];P++)y[G++]=O;for(y[G-1]=O,O=V=0;O<16;O++)for(Z[O]=V,P=0;P<1<<D[O];P++)M[V++]=O;for(V>>=7;O<f;O++)for(Z[O]=V<<7,P=0;P<1<<D[O]-7;P++)M[256+V++]=O;for(W=0;W<=b;W++)J[W]=0;for(P=0;P<=143;)Y[2*P+1]=8,P++,J[8]++;for(;P<=255;)Y[2*P+1]=9,P++,J[9]++;for(;P<=279;)Y[2*P+1]=7,P++,J[7]++;for(;P<=287;)Y[2*P+1]=8,P++,J[8]++;for(re(Y,m+1,J),P=0;P<f;P++)N[2*P+1]=5,N[2*P]=ue(P,5);te=new ne(Y,A,u+1,m,b),U=new ne(N,D,0,f,b),$=new ne(new Array(0),R,0,v,x)})(),H=!0),S.l_desc=new z(S.dyn_ltree,te),S.d_desc=new z(S.dyn_dtree,U),S.bl_desc=new z(S.bl_tree,$),S.bi_buf=0,S.bi_valid=0,ie(S)},o._tr_stored_block=T,o._tr_flush_block=function(S,P,W,G){var O,V,J=0;0<S.level?(S.strm.data_type===2&&(S.strm.data_type=(function(Q){var se,pe=4093624447;for(se=0;se<=31;se++,pe>>>=1)if(1&pe&&Q.dyn_ltree[2*se]!==0)return s;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return a;for(se=32;se<u;se++)if(Q.dyn_ltree[2*se]!==0)return a;return s})(S)),ve(S,S.l_desc),ve(S,S.d_desc),J=(function(Q){var se;for(w(Q,Q.dyn_ltree,Q.l_desc.max_code),w(Q,Q.dyn_dtree,Q.d_desc.max_code),ve(Q,Q.bl_desc),se=v-1;3<=se&&Q.bl_tree[2*F[se]+1]===0;se--);return Q.opt_len+=3*(se+1)+5+5+4,se})(S),O=S.opt_len+3+7>>>3,(V=S.static_len+3+7>>>3)<=O&&(O=V)):O=V=W+5,W+4<=O&&P!==-1?T(S,P,W,G):S.strategy===4||V===O?(q(S,2+(G?1:0),3),fe(S,Y,N)):(q(S,4+(G?1:0),3),(function(Q,se,pe,he){var Ae;for(q(Q,se-257,5),q(Q,pe-1,5),q(Q,he-4,4),Ae=0;Ae<he;Ae++)q(Q,Q.bl_tree[2*F[Ae]+1],3);X(Q,Q.dyn_ltree,se-1),X(Q,Q.dyn_dtree,pe-1)})(S,S.l_desc.max_code+1,S.d_desc.max_code+1,J+1),fe(S,S.dyn_ltree,S.dyn_dtree)),ie(S),G&&ae(S)},o._tr_tally=function(S,P,W){return S.pending_buf[S.d_buf+2*S.last_lit]=P>>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&P,S.pending_buf[S.l_buf+S.last_lit]=255&W,S.last_lit++,P===0?S.dyn_ltree[2*W]++:(S.matches++,P--,S.dyn_ltree[2*(y[W]+u+1)]++,S.dyn_dtree[2*L(P)]++),S.last_lit===S.lit_bufsize-1},o._tr_align=function(S){q(S,2,3),ee(S,k,Y),(function(P){P.bi_valid===16?(K(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)})(S)}},{"../utils/common":41}],53:[function(r,n,o){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,d,u,m=1,f={},v=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(_){process.nextTick(function(){x(_)})}:(function(){if(s.postMessage&&!s.importScripts){var _=!0,C=s.onmessage;return s.onmessage=function(){_=!1},s.postMessage("","*"),s.onmessage=C,_}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(_){s.postMessage(u+_,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){x(_.data)},function(_){d.port2.postMessage(_)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(_){var C=h.createElement("script");C.onreadystatechange=function(){x(_),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(_){setTimeout(x,0,_)},b.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),I=0;I<C.length;I++)C[I]=arguments[I+1];var A={callback:_,args:C};return f[m]=A,l(m),m++},b.clearImmediate=g}function g(_){delete f[_]}function x(_){if(v)setTimeout(x,0,_);else{var C=f[_];if(C){v=!0;try{(function(I){var A=I.callback,D=I.args;switch(D.length){case 0:A();break;case 1:A(D[0]);break;case 2:A(D[0],D[1]);break;case 3:A(D[0],D[1],D[2]);break;default:A.apply(a,D)}})(C)}finally{g(_),v=!1}}}}function k(_){_.source===s&&typeof _.data=="string"&&_.data.indexOf(u)===0&&x(+_.data.slice(u.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof pt<"u"?pt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Kn)),Kn.exports}var Dc=Ic();const Rc=Pc(Dc);var Mr={exports:{}},Lc=Mr.exports,xi;function Mc(){return xi||(xi=1,(function(e,t){(function(r,n){n()})(Lc,function(){function r(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,d,u){var m=new XMLHttpRequest;m.open("GET",c),m.responseType="blob",m.onload=function(){l(m.response,d,u)},m.onerror=function(){console.error("could not download file")},m.send()}function o(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof pt=="object"&&pt.global===pt?pt:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,d,u){var m=s.URL||s.webkitURL,f=document.createElement("a");d=d||c.name||"download",f.download=d,f.rel="noopener",typeof c=="string"?(f.href=c,f.origin===location.origin?i(f):o(f.href)?n(c,d,u):i(f,f.target="_blank")):(f.href=m.createObjectURL(c),setTimeout(function(){m.revokeObjectURL(f.href)},4e4),setTimeout(function(){i(f)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,u){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,u),d);else if(o(c))n(c,d,u);else{var m=document.createElement("a");m.href=c,m.target="_blank",setTimeout(function(){i(m)})}}:function(c,d,u,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof c=="string")return n(c,d,u);var f=c.type==="application/octet-stream",v=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||f&&v||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var k=b.result;k=h?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=k:location=k,m=null},b.readAsDataURL(c)}else{var g=s.URL||s.webkitURL,x=g.createObjectURL(c);m?m.location=x:location.href=x,m=null,setTimeout(function(){g.revokeObjectURL(x)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Mr)),Mr.exports}var yi=Mc();const ki=async(e,t)=>{const r=new Rc,n=r.folder("config");n==null||n.file("site.json",JSON.stringify(e.site,null,2)),n==null||n.file("theme.json",JSON.stringify(e.theme,null,2)),n==null||n.file("menu.json",JSON.stringify(e.menu,null,2));const o=r.folder("pages");o==null||o.file(`${t}.json`,JSON.stringify(e.page,null,2));const i=await r.generateAsync({type:"blob"});yi.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},_i=(e,t,r)=>{const{pages:n,...o}=e.site,i={page:e.page,site:o,menu:e.menu,theme:e.theme},a=`<script id="jp-baked-state" type="application/json">${JSON.stringify(i)}<\/script>`,l=r.replace("</head>",`${a}</head>`),c=new Blob([`<!DOCTYPE html>${l}`],{type:"text/html;charset=utf-8"});yi.saveAs(c,`${t}.html`)};function Si(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Si(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Si(e))&&(n&&(n+=" "),n+=t);return n}const Bc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Uc=(e,t)=>({classGroupId:e,validator:t}),Ci=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Fr="-",Ei=[],Wc="arbitrary..",$c=e=>{const t=Vc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Hc(s);const a=s.split(Fr),l=a[0]===""&&a.length>1?1:0;return Ni(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Bc(c,l):l:c||Ei}return r[s]||Ei}}},Ni=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Ni(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Fr):e.slice(t).join(Fr),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},Hc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Wc+n:void 0})(),Vc=e=>{const{theme:t,classGroups:r}=e;return Yc(r,t)},Yc=(e,t)=>{const r=Ci();for(const n in e){const o=e[n];Xn(o,r,n,t)}return r},Xn=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Zc(s,t,r,n)}},Zc=(e,t,r,n)=>{if(typeof e=="string"){Gc(e,t,r);return}if(typeof e=="function"){Kc(e,t,r,n);return}Xc(e,t,r,n)},Gc=(e,t,r)=>{const n=e===""?t:Ai(t,e);n.classGroupId=r},Kc=(e,t,r,n)=>{if(qc(e)){Xn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Uc(r,e))},Xc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Xn(l,Ai(t,a),r,n)}},Ai=(e,t)=>{let r=e;const n=t.split(Fr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Ci(),r.nextPart.set(s,a)),r=a}return r},qc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Jc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},qn="!",zi=":",Qc=[],ji=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),ed=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let h=0;h<d;h++){const b=o[h];if(s===0&&a===0){if(b===zi){i.push(o.slice(l,h)),l=h+1;continue}if(b==="/"){c=h;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const u=i.length===0?o:o.slice(l);let m=u,f=!1;u.endsWith(qn)?(m=u.slice(0,-1),f=!0):u.startsWith(qn)&&(m=u.slice(1),f=!0);const v=c&&c>l?c-l:void 0;return ji(i,f,m,v)};if(t){const o=t+zi,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):ji(Qc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},td=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},rd=e=>({cache:Jc(e.cacheSize),parseClassName:ed(e),sortModifiers:td(e),...$c(e)}),nd=/\s+/,od=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(nd);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:h}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let b=!!h,g=n(b?v.substring(0,h):v);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=n(v),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const x=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=f?x+qn:x,_=k+g;if(s.indexOf(_)>-1)continue;s.push(_);const C=o(g,b);for(let I=0;I<C.length;++I){const A=C[I];s.push(k+A)}l=d+(l.length>0?" "+l:l)}return l},id=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ti(r))&&(o&&(o+=" "),o+=n);return o},Ti=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ti(e[n]))&&(r&&(r+=" "),r+=t);return r},sd=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,u)=>u(d),e());return r=rd(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=od(l,r);return o(l,d),d};return i=s,(...l)=>i(id(...l))},ad=[],Te=e=>{const t=r=>r[e]||ad;return t.isThemeGetter=!0,t},Oi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ld=/^\d+\/\d+$/,cd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ud=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>ld.test(e),ge=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),Jn=e=>e.endsWith("%")&&ge(e.slice(0,-1)),lt=e=>cd.test(e),pd=()=>!0,md=e=>dd.test(e)&&!ud.test(e),Ii=()=>!1,gd=e=>fd.test(e),bd=e=>hd.test(e),vd=e=>!ce(e)&&!de(e),wd=e=>Dt(e,Fi,Ii),ce=e=>Oi.test(e),At=e=>Dt(e,Bi,md),Qn=e=>Dt(e,Sd,ge),Di=e=>Dt(e,Li,Ii),xd=e=>Dt(e,Mi,bd),Br=e=>Dt(e,Ui,gd),de=e=>Pi.test(e),lr=e=>Rt(e,Bi),yd=e=>Rt(e,Cd),Ri=e=>Rt(e,Li),kd=e=>Rt(e,Fi),_d=e=>Rt(e,Mi),Ur=e=>Rt(e,Ui,!0),Dt=(e,t,r)=>{const n=Oi.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Rt=(e,t,r=!1)=>{const n=Pi.exec(e);return n?n[1]?t(n[1]):r:!1},Li=e=>e==="position"||e==="percentage",Mi=e=>e==="image"||e==="url",Fi=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",Sd=e=>e==="number",Cd=e=>e==="family-name",Ui=e=>e==="shadow",Ed=sd(()=>{const e=Te("color"),t=Te("font"),r=Te("text"),n=Te("font-weight"),o=Te("tracking"),i=Te("leading"),s=Te("breakpoint"),a=Te("container"),l=Te("spacing"),c=Te("radius"),d=Te("shadow"),u=Te("inset-shadow"),m=Te("text-shadow"),f=Te("drop-shadow"),v=Te("blur"),h=Te("perspective"),b=Te("aspect"),g=Te("ease"),x=Te("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),de,ce],I=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[de,ce,l],R=()=>[It,"full","auto",...D()],F=()=>[mt,"none","subgrid",de,ce],Y=()=>["auto",{span:["full",mt,de,ce]},mt,de,ce],N=()=>[mt,"auto",de,ce],M=()=>["auto","min","max","fr",de,ce],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...D()],U=()=>[It,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],$=()=>[e,de,ce],Z=()=>[..._(),Ri,Di,{position:[de,ce]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",kd,wd,{size:[de,ce]}],L=()=>[Jn,lr,At],K=()=>["","none","full",c,de,ce],q=()=>["",ge,lr,At],ee=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[ge,Jn,Ri,Di],ie=()=>["","none",v,de,ce],ae=()=>["none",ge,de,ce],oe=()=>["none",ge,de,ce],le=()=>[ge,de,ce],fe=()=>[It,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[pd],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[vd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",ge],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",It,ce,de,b]}],container:["container"],columns:[{columns:[ge,ce,de,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",de,ce]}],basis:[{basis:[It,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ge,It,"auto","initial","none",ce]}],grow:[{grow:["",ge,de,ce]}],shrink:[{shrink:["",ge,de,ce]}],order:[{order:[mt,"first","last","none",de,ce]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,lr,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,de,Qn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jn,ce]}],"font-family":[{font:[yd,ce,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,ce]}],"line-clamp":[{"line-clamp":[ge,"none",de,Qn]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",de,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[ge,"from-font","auto",de,At]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[ge,"auto",de,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,de,ce],radial:["",de,ce],conic:[mt,de,ce]},_d,xd]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ge,de,ce]}],"outline-w":[{outline:["",ge,lr,At]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,Ur,Br]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",u,Ur,Br]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[ge,At]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,Ur,Br]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[ge,de,ce]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[de,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ce]}],filter:[{filter:["","none",de,ce]}],blur:[{blur:ie()}],brightness:[{brightness:[ge,de,ce]}],contrast:[{contrast:[ge,de,ce]}],"drop-shadow":[{"drop-shadow":["","none",f,Ur,Br]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",ge,de,ce]}],"hue-rotate":[{"hue-rotate":[ge,de,ce]}],invert:[{invert:["",ge,de,ce]}],saturate:[{saturate:[ge,de,ce]}],sepia:[{sepia:["",ge,de,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ce]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ge,de,ce]}],"backdrop-contrast":[{"backdrop-contrast":[ge,de,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ge,de,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ge,de,ce]}],"backdrop-invert":[{"backdrop-invert":["",ge,de,ce]}],"backdrop-opacity":[{"backdrop-opacity":[ge,de,ce]}],"backdrop-saturate":[{"backdrop-saturate":[ge,de,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",ge,de,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ge,"initial",de,ce]}],ease:[{ease:["linear","initial",g,de,ce]}],delay:[{delay:[ge,de,ce]}],animate:[{animate:["none",x,de,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,de,ce]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[de,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ce]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[ge,lr,At,Qn]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function me(...e){return Ed(Fc(e))}var Wr={exports:{}},cr={};/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
15
15
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/var
|
|
20
|
+
*/var Wi;function Nd(){if(Wi)return cr;Wi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return cr.Fragment=t,cr.jsx=r,cr.jsxs=r,cr}var dr={};/**
|
|
21
21
|
* @license React
|
|
22
22
|
* react-jsx-runtime.development.js
|
|
23
23
|
*
|
|
@@ -25,196 +25,196 @@
|
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/var
|
|
28
|
+
*/var $i;function Ad(){return $i||($i=1,process.env.NODE_ENV!=="production"&&(function(){function e(z){if(z==null)return null;if(typeof z=="function")return z.$$typeof===Y?null:z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case b:return"Fragment";case x:return"Profiler";case g:return"StrictMode";case I:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof z=="object")switch(typeof z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case h:return"Portal";case _:return z.displayName||"Context";case k:return(z._context.displayName||"Context")+".Consumer";case C:var L=z.render;return z=z.displayName,z||(z=L.displayName||L.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case D:return L=z.displayName||null,L!==null?L:e(z.type)||"Memo";case R:L=z._payload,z=z._init;try{return e(z(L))}catch{}}return null}function t(z){return""+z}function r(z){try{t(z);var L=!1}catch{L=!0}if(L){L=console;var K=L.error,q=typeof Symbol=="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return K.call(L,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",q),t(z)}}function n(z){if(z===b)return"<>";if(typeof z=="object"&&z!==null&&z.$$typeof===R)return"<...>";try{var L=e(z);return L?"<"+L+">":"<...>"}catch{return"<...>"}}function o(){var z=N.A;return z===null?null:z.getOwner()}function i(){return Error("react-stack-top-frame")}function s(z){if(M.call(z,"key")){var L=Object.getOwnPropertyDescriptor(z,"key").get;if(L&&L.isReactWarning)return!1}return z.key!==void 0}function a(z,L){function K(){te||(te=!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)",L))}K.isReactWarning=!0,Object.defineProperty(z,"key",{get:K,configurable:!0})}function l(){var z=e(this.type);return U[z]||(U[z]=!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.")),z=this.props.ref,z!==void 0?z:null}function c(z,L,K,q,ee,ue){var re=K.ref;return z={$$typeof:v,type:z,key:L,props:K,_owner:q},(re!==void 0?re:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:l}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function d(z,L,K,q,ee,ue){var re=L.children;if(re!==void 0)if(q)if(y(re)){for(q=0;q<re.length;q++)u(re[q]);Object.freeze&&Object.freeze(re)}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 u(re);if(M.call(L,"key")){re=e(z);var ie=Object.keys(L).filter(function(oe){return oe!=="key"});q=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",ne[re+q]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
29
29
|
let props = %s;
|
|
30
30
|
<%s {...props} />
|
|
31
31
|
React keys must be passed directly to JSX without using spread:
|
|
32
32
|
let props = %s;
|
|
33
|
-
<%s key={someKey} {...props} />`,
|
|
33
|
+
<%s key={someKey} {...props} />`,q,re,ie,re),ne[re+q]=!0)}if(re=null,K!==void 0&&(r(K),re=""+K),s(L)&&(r(L.key),re=""+L.key),"key"in L){K={};for(var ae in L)ae!=="key"&&(K[ae]=L[ae])}else K=L;return re&&a(K,typeof z=="function"?z.displayName||z.name||"Unknown":z),c(z,re,K,o(),ee,ue)}function u(z){m(z)?z._store&&(z._store.validated=1):typeof z=="object"&&z!==null&&z.$$typeof===R&&(z._payload.status==="fulfilled"?m(z._payload.value)&&z._payload.value._store&&(z._payload.value._store.validated=1):z._store&&(z._store.validated=1))}function m(z){return typeof z=="object"&&z!==null&&z.$$typeof===v}var f=j,v=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),N=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,y=Array.isArray,B=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(z){return z()}};var te,U={},$=f.react_stack_bottom_frame.bind(f,i)(),Z=B(n(i)),ne={};dr.Fragment=b,dr.jsx=function(z,L,K){var q=1e4>N.recentlyCreatedOwnerStacks++;return d(z,L,K,!1,q?Error("react-stack-top-frame"):$,q?B(n(z)):Z)},dr.jsxs=function(z,L,K){var q=1e4>N.recentlyCreatedOwnerStacks++;return d(z,L,K,!0,q?Error("react-stack-top-frame"):$,q?B(n(z)):Z)}})()),dr}var Hi;function zd(){return Hi||(Hi=1,process.env.NODE_ENV==="production"?Wr.exports=Nd():Wr.exports=Ad()),Wr.exports}var p=zd();const Vi=j.createContext(void 0),Yi=({config:e,children:t})=>p.jsx(Vi.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets},children:t});function ur(){const e=j.useContext(Vi);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Zi=j.createContext(void 0),$r=({mode:e,children:t})=>(j.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),p.jsx(Zi.Provider,{value:{mode:e},children:t})),Gi=()=>{const e=j.useContext(Zi);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
|
|
34
34
|
* @license lucide-react v0.474.0 - ISC
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the ISC license.
|
|
37
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/const
|
|
38
|
+
*/const jd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ki=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
39
39
|
* @license lucide-react v0.474.0 - ISC
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var
|
|
43
|
+
*/var Td={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
44
44
|
* @license lucide-react v0.474.0 - ISC
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/const
|
|
48
|
+
*/const Od=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>j.createElement("svg",{ref:l,...Td,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ki("lucide",o),...a},[...s.map(([c,d])=>j.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
|
|
49
49
|
* @license lucide-react v0.474.0 - ISC
|
|
50
50
|
*
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const
|
|
53
|
+
*/const ye=(e,t)=>{const r=j.forwardRef(({className:n,...o},i)=>j.createElement(Od,{ref:i,iconNode:t,className:Ki(`lucide-${jd(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
|
|
54
54
|
* @license lucide-react v0.474.0 - ISC
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const
|
|
58
|
+
*/const Pd=ye("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
59
59
|
* @license lucide-react v0.474.0 - ISC
|
|
60
60
|
*
|
|
61
61
|
* This source code is licensed under the ISC license.
|
|
62
62
|
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const
|
|
63
|
+
*/const Id=ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
64
64
|
* @license lucide-react v0.474.0 - ISC
|
|
65
65
|
*
|
|
66
66
|
* This source code is licensed under the ISC license.
|
|
67
67
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const
|
|
68
|
+
*/const Dd=ye("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
69
69
|
* @license lucide-react v0.474.0 - ISC
|
|
70
70
|
*
|
|
71
71
|
* This source code is licensed under the ISC license.
|
|
72
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const
|
|
73
|
+
*/const Rd=ye("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
74
74
|
* @license lucide-react v0.474.0 - ISC
|
|
75
75
|
*
|
|
76
76
|
* This source code is licensed under the ISC license.
|
|
77
77
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const eo=
|
|
78
|
+
*/const eo=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
79
79
|
* @license lucide-react v0.474.0 - ISC
|
|
80
80
|
*
|
|
81
81
|
* This source code is licensed under the ISC license.
|
|
82
82
|
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const
|
|
83
|
+
*/const Hr=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
84
84
|
* @license lucide-react v0.474.0 - ISC
|
|
85
85
|
*
|
|
86
86
|
* This source code is licensed under the ISC license.
|
|
87
87
|
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const
|
|
88
|
+
*/const Ld=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
89
89
|
* @license lucide-react v0.474.0 - ISC
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const to=
|
|
93
|
+
*/const to=ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
94
94
|
* @license lucide-react v0.474.0 - ISC
|
|
95
95
|
*
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
97
97
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const
|
|
98
|
+
*/const Md=ye("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
99
99
|
* @license lucide-react v0.474.0 - ISC
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const
|
|
103
|
+
*/const Xi=ye("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
104
104
|
* @license lucide-react v0.474.0 - ISC
|
|
105
105
|
*
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const
|
|
108
|
+
*/const Fd=ye("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
|
|
109
109
|
* @license lucide-react v0.474.0 - ISC
|
|
110
110
|
*
|
|
111
111
|
* This source code is licensed under the ISC license.
|
|
112
112
|
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const
|
|
113
|
+
*/const Bd=ye("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
114
114
|
* @license lucide-react v0.474.0 - ISC
|
|
115
115
|
*
|
|
116
116
|
* This source code is licensed under the ISC license.
|
|
117
117
|
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const
|
|
118
|
+
*/const Ud=ye("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
119
119
|
* @license lucide-react v0.474.0 - ISC
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the ISC license.
|
|
122
122
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const
|
|
123
|
+
*/const qi=ye("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
124
124
|
* @license lucide-react v0.474.0 - ISC
|
|
125
125
|
*
|
|
126
126
|
* This source code is licensed under the ISC license.
|
|
127
127
|
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const
|
|
128
|
+
*/const Vr=ye("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
129
129
|
* @license lucide-react v0.474.0 - ISC
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const ro=
|
|
133
|
+
*/const ro=ye("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
134
134
|
* @license lucide-react v0.474.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const
|
|
138
|
+
*/const Ji=ye("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
139
139
|
* @license lucide-react v0.474.0 - ISC
|
|
140
140
|
*
|
|
141
141
|
* This source code is licensed under the ISC license.
|
|
142
142
|
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const
|
|
143
|
+
*/const Wd=ye("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
144
144
|
* @license lucide-react v0.474.0 - ISC
|
|
145
145
|
*
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const
|
|
148
|
+
*/const $d=ye("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
149
149
|
* @license lucide-react v0.474.0 - ISC
|
|
150
150
|
*
|
|
151
151
|
* This source code is licensed under the ISC license.
|
|
152
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const no=
|
|
153
|
+
*/const no=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
154
154
|
* @license lucide-react v0.474.0 - ISC
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const
|
|
158
|
+
*/const Hd=ye("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
159
159
|
* @license lucide-react v0.474.0 - ISC
|
|
160
160
|
*
|
|
161
161
|
* This source code is licensed under the ISC license.
|
|
162
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const
|
|
163
|
+
*/const Vd=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
164
164
|
* @license lucide-react v0.474.0 - ISC
|
|
165
165
|
*
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const
|
|
168
|
+
*/const Yd=ye("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
169
169
|
* @license lucide-react v0.474.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const
|
|
173
|
+
*/const Zd=ye("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
174
174
|
* @license lucide-react v0.474.0 - ISC
|
|
175
175
|
*
|
|
176
176
|
* This source code is licensed under the ISC license.
|
|
177
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const
|
|
178
|
+
*/const Gd=ye("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
|
|
179
179
|
* @license lucide-react v0.474.0 - ISC
|
|
180
180
|
*
|
|
181
181
|
* This source code is licensed under the ISC license.
|
|
182
182
|
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const
|
|
183
|
+
*/const Kd=ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
184
184
|
* @license lucide-react v0.474.0 - ISC
|
|
185
185
|
*
|
|
186
186
|
* This source code is licensed under the ISC license.
|
|
187
187
|
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const
|
|
188
|
+
*/const Yr=ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
189
189
|
* @license lucide-react v0.474.0 - ISC
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const
|
|
193
|
+
*/const Xd=ye("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
194
194
|
* @license lucide-react v0.474.0 - ISC
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the ISC license.
|
|
197
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const
|
|
198
|
+
*/const Qi=ye("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
199
199
|
* @license lucide-react v0.474.0 - ISC
|
|
200
200
|
*
|
|
201
201
|
* This source code is licensed under the ISC license.
|
|
202
202
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const Lt=
|
|
203
|
+
*/const Lt=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
204
204
|
* @license lucide-react v0.474.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const Vd=ke("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class Yd extends T.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?p.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[p.jsx(Hd,{className:"text-amber-500",size:32}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),p.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),p.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Kd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return p.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,style:{zIndex:Pe.studioSectionOverlay},className:pe("absolute inset-0 pointer-events-none transition-all duration-200","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:p.jsxs("div",{className:pe("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&p.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:p.jsx(to,{size:12,strokeWidth:2.5})}),p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:p.jsx(Vr,{size:12,strokeWidth:2.5})})]}),p.jsx("span",{className:"shrink-0",children:e}),p.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),p.jsx("span",{className:"shrink-0",children:t})]})})},fr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var w,k;const{mode:a}=Yi(),{registry:l}=ur(),c=a==="studio",d=c&&r===e.id,f=l[e.type],m=e.type==="header"||e.type==="footer"?"global":"local",u=e.type==="header"&&((w=e.settings)==null?void 0:w.sticky);if(!f)return p.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[p.jsx("strong",{children:"Missing Component:"})," ",e.type]});const x=S=>{var j,F,y,H,Q;if(!c)return;S.preventDefault(),S.stopPropagation();const C=S.currentTarget,O=S.clientX,N=S.clientY;if(S.target===C){window.parent.postMessage({type:Ce.SECTION_SELECT,section:{id:e.id,type:e.type,scope:m}},"*");return}const I=document.elementFromPoint(O,N)??S.target;if(!I||!C.contains(I)){window.parent.postMessage({type:Ce.SECTION_SELECT,section:{id:e.id,type:e.type,scope:m}},"*");return}if(I===C){window.parent.postMessage({type:Ce.SECTION_SELECT,section:{id:e.id,type:e.type,scope:m}},"*");return}const D=[];let L=I;for(;L&&L!==C;){const $=(j=L.getAttribute)==null?void 0:j.call(L,"data-jp-item-id"),V=(F=L.getAttribute)==null?void 0:F.call(L,"data-jp-item-field");$&&V&&D.push({fieldKey:V||"items",itemId:$}),L=L.parentElement}if(D.reverse(),D.length===0)for(L=I;L&&L!==C;){const $=(y=L.getAttribute)==null?void 0:y.call(L,"data-jp-field");if($){D.push({fieldKey:$});break}L=L.parentElement}if(D.length===0&&I){let $=null;const V=Y=>{var z,P;const J=Y.getBoundingClientRect();if(J.left<=O&&O<=J.right&&J.top<=N&&N<=J.bottom){for(let K=0;K<Y.children.length;K++)V(Y.children[K]);((z=Y.getAttribute)!=null&&z.call(Y,"data-jp-item-id")||(P=Y.getAttribute)!=null&&P.call(Y,"data-jp-field"))&&($=Y)}};if(V(I),$){const Y=$,J=(H=Y.getAttribute)==null?void 0:H.call(Y,"data-jp-item-id"),z=(Q=Y.getAttribute)==null?void 0:Q.call(Y,"data-jp-field");J&&z?D.push({fieldKey:z||"items",itemId:J}):z&&D.push({fieldKey:z})}}const Z={type:Ce.SECTION_SELECT,section:{id:e.id,type:e.type,scope:m}};if(D.length>0){Z.itemPath=D;const $=D[0];$.itemId!=null?(Z.itemField=$.fieldKey,Z.itemId=$.itemId):Z.itemField=$.fieldKey}window.parent.postMessage(Z,"*")},h=()=>{const S=f;return e.type==="header"&&t?p.jsx(S,{data:e.data,settings:e.settings,menu:t}):p.jsx(S,{data:e.data,settings:e.settings})},b=(k=e.data)==null?void 0:k.anchorId,v=c?d?Pe.studioSelectedSection:u?Pe.studioStickyHeader:void 0:void 0;return p.jsxs("div",{id:b||void 0,"data-section-id":c?e.id:void 0,"data-section-type":c?e.type:void 0,"data-section-scope":c?m:void 0,...c&&d?{"data-jp-selected":!0}:{},onClickCapture:c?x:void 0,style:v!=null?{zIndex:v}:void 0,className:pe("relative w-full",c&&"group cursor-pointer",c&&u&&"sticky top-0"),children:[p.jsx("div",{className:"relative",children:p.jsx(Yd,{type:e.type,children:h()})}),c&&p.jsx(Kd,{type:e.type,scope:m,isSelected:!!d,sectionId:n&&m==="local"?e.id:void 0,sectionIndex:n&&m==="local"?o:void 0,totalSections:n&&m==="local"?i:void 0,onReorder:n&&m==="local"?s:void 0})]})},Zd=e=>{T.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])},Gd="application/json",oo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,v;Zd(e.meta);const[a,l]=T.useState(null),c=T.useRef({}),d=T.useRef(s);d.current=s;const f=w=>{var k;(k=d.current)==null||k.call(d,w)};T.useEffect(()=>{if(!i)return;const w=c.current[i];w&&w.scrollIntoView({behavior:"smooth",block:"center"})},[i]),T.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(N=>N.id),...t.footer?[t.footer.id]:[]],S=new IntersectionObserver(N=>{N.forEach(I=>{var D;if(I.isIntersecting&&I.intersectionRatio>.5){const L=I.target.getAttribute("data-section-id");L&&((D=d.current)==null||D.call(d,L))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const O=requestAnimationFrame(()=>{C||k.forEach(N=>{const I=c.current[N];I&&S.observe(I)})});return()=>{C=!0,cancelAnimationFrame(O),S.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(v=t.footer)==null?void 0:v.id]);const m=(w,k)=>{w.preventDefault(),w.dataTransfer.dropEffect="move",l(k)},u=()=>{l(null)},x=(w,k)=>{if(w.preventDefault(),l(null),!!o)try{const S=w.dataTransfer.getData(Gd),{sectionId:C}=JSON.parse(S);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const w=typeof o=="function",k=e.sections.map((S,C)=>{const O=a===C;return w?p.jsxs("div",{ref:N=>{c.current[S.id]=N},"data-section-id":S.id,style:{position:"relative"},onMouseEnter:()=>f(S.id),children:[p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:Pe.studioReorderDropZone,pointerEvents:"auto",backgroundColor:O?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:O?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:N=>m(N,C),onDragLeave:u,onDrop:N=>x(N,C)}),p.jsx(fr,{section:S,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},S.id):p.jsx("div",{ref:N=>{c.current[S.id]=N},"data-section-id":S.id,onMouseEnter:()=>f(S.id),children:p.jsx(fr,{section:S,selectedId:n})},S.id)});if(w&&k.length>0){const S=e.sections.length,C=a===S;k.push(p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:Pe.studioReorderDropZone,pointerEvents:"auto",backgroundColor:C?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:C?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:O=>m(O,S),onDragLeave:u,onDrop:O=>x(O,S)},"jp-drop-after-last"))}return k};return p.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[t.header!=null&&p.jsx("div",{ref:w=>{c.current[t.header.id]=w},"data-section-id":t.header.id,onMouseEnter:()=>f(t.header.id),children:p.jsx(fr,{section:t.header,menu:r.main,selectedId:n})}),p.jsx("main",{className:"flex-1",children:h()}),t.footer!=null&&p.jsx("div",{ref:w=>{c.current[t.footer.id]=w},"data-section-id":t.footer.id,onMouseEnter:()=>f(t.footer.id),children:p.jsx(fr,{section:t.footer,selectedId:n})})]})},Zr=({mode:e,tenantCss:t,adminCss:r,children:n})=>(T.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),p.jsx(p.Fragment,{children:n}));function Xd(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return T.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Gr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ft(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function io(e){return"nodeType"in e}function Me(e){var t,r;return e?Ft(e)?e:io(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function so(e){const{Document:t}=Me(e);return e instanceof t}function hr(e){return Ft(e)?!1:e instanceof Me(e).HTMLElement}function Ji(e){return e instanceof Me(e).SVGElement}function Bt(e){return e?Ft(e)?e.document:io(e)?so(e)?e:hr(e)||Ji(e)?e.ownerDocument:document:document:document}const Ge=Gr?T.useLayoutEffect:T.useEffect;function Xr(e){const t=T.useRef(e);return Ge(()=>{t.current=e}),T.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function qd(){const e=T.useRef(null),t=T.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=T.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function pr(e,t){t===void 0&&(t=[e]);const r=T.useRef(e);return Ge(()=>{r.current!==e&&(r.current=e)},t),r}function mr(e,t){const r=T.useRef();return T.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function qr(e){const t=Xr(e),r=T.useRef(null),n=T.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function Jr(e){const t=T.useRef();return T.useEffect(()=>{t.current=e},[e]),t.current}let ao={};function gr(e,t){return T.useMemo(()=>{if(t)return t;const r=ao[e]==null?0:ao[e]+1;return ao[e]=r,e+"-"+r},[e,t])}function Qi(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Ut=Qi(1),br=Qi(-1);function Jd(e){return"clientX"in e&&"clientY"in e}function Qr(e){if(!e)return!1;const{KeyboardEvent:t}=Me(e.target);return t&&e instanceof t}function Qd(e){if(!e)return!1;const{TouchEvent:t}=Me(e.target);return t&&e instanceof t}function en(e){if(Qd(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Jd(e)?{x:e.clientX,y:e.clientY}:null}const bt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[bt.Translate.toString(e),bt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),es="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function eu(e){return e.matches(es)?e:e.querySelector(es)}const tu={display:"none"};function ru(e){let{id:t,value:r}=e;return T.createElement("div",{id:t,style:tu},r)}function nu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function ou(){const[e,t]=T.useState("");return{announce:T.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ts=T.createContext(null);function iu(e){const t=T.useContext(ts);T.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function su(){const[e]=T.useState(()=>new Set),t=T.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[T.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const au={draggable:`
|
|
208
|
+
*/const qd=ye("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class Jd extends j.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?p.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[p.jsx(Xd,{className:"text-amber-500",size:32}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),p.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),p.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Qd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return p.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:me("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:p.jsxs("div",{className:me("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&p.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:p.jsx(to,{size:12,strokeWidth:2.5})}),p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:p.jsx(Hr,{size:12,strokeWidth:2.5})})]}),p.jsx("span",{className:"shrink-0",children:e}),p.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),p.jsx("span",{className:"shrink-0",children:t})]})})},fr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var g,x;const{mode:a}=Gi(),{registry:l}=ur(),c=a==="studio",d=c&&r===e.id,u=l[e.type],m=e.type==="header"||e.type==="footer"?"global":"local",f=e.type==="tiptap",v=e.type==="header"&&((g=e.settings)==null?void 0:g.sticky);if(!u)return p.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[p.jsx("strong",{children:"Missing Component:"})," ",e.type]});const h=()=>{const k=u;return e.type==="header"&&t?p.jsx(k,{data:e.data,settings:e.settings,menu:t}):p.jsx(k,{data:e.data,settings:e.settings})},b=(x=e.data)==null?void 0:x.anchorId;return p.jsxs("div",{id:b||void 0,"data-section-id":c?e.id:void 0,"data-section-type":c?e.type:void 0,"data-section-scope":c?m:void 0,...c&&d?{"data-jp-selected":!0}:{},className:me("relative w-full",c&&!f&&"group cursor-pointer",c&&v?"sticky top-0 z-[60]":"relative z-0",d&&"z-[70]"),children:[p.jsx("div",{className:"relative z-0",children:p.jsx(Jd,{type:e.type,children:h()})}),c&&!f&&p.jsx(Qd,{type:e.type,scope:m,isSelected:!!d,sectionId:n&&m==="local"?e.id:void 0,sectionIndex:n&&m==="local"?o:void 0,totalSections:n&&m==="local"?i:void 0,onReorder:n&&m==="local"?s:void 0})]})},eu=e=>{j.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])},tu="application/json",oo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,g;eu(e.meta);const[a,l]=j.useState(null),c=j.useRef({}),d=j.useRef(s);d.current=s;const u=x=>{var k;(k=d.current)==null||k.call(d,x)};j.useEffect(()=>{if(!i)return;const x=c.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),j.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],_=new IntersectionObserver(A=>{A.forEach(D=>{var R;if(D.isIntersecting&&D.intersectionRatio>.5){const F=D.target.getAttribute("data-section-id");F&&((R=d.current)==null||R.call(d,F))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const I=requestAnimationFrame(()=>{C||k.forEach(A=>{const D=c.current[A];D&&_.observe(D)})});return()=>{C=!0,cancelAnimationFrame(I),_.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(g=t.footer)==null?void 0:g.id]);const m=(x,k)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",l(k)},f=()=>{l(null)},v=(x,k)=>{if(x.preventDefault(),l(null),!!o)try{const _=x.dataTransfer.getData(tu),{sectionId:C}=JSON.parse(_);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const x=typeof o=="function",k=e.sections.map((_,C)=>{const I=a===C;return x?p.jsxs("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,style:{position:"relative"},onMouseEnter:()=>u(_.id),children:[p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:I?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:I?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:A=>m(A,C),onDragLeave:f,onDrop:A=>v(A,C)}),p.jsx(fr,{section:_,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},_.id):p.jsx("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,onMouseEnter:()=>u(_.id),children:p.jsx(fr,{section:_,selectedId:n})},_.id)});if(x&&k.length>0){const _=e.sections.length,C=a===_;k.push(p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:C?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:C?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:I=>m(I,_),onDragLeave:f,onDrop:I=>v(I,_)},"jp-drop-after-last"))}return k};return p.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[t.header!=null&&p.jsx("div",{ref:x=>{c.current[t.header.id]=x},"data-section-id":t.header.id,onMouseEnter:()=>u(t.header.id),children:p.jsx(fr,{section:t.header,menu:r.main,selectedId:n})}),p.jsx("main",{className:"flex-1",children:h()}),t.footer!=null&&p.jsx("div",{ref:x=>{c.current[t.footer.id]=x},"data-section-id":t.footer.id,onMouseEnter:()=>u(t.footer.id),children:p.jsx(fr,{section:t.footer,selectedId:n})})]})},Zr=({mode:e,tenantCss:t,adminCss:r,children:n})=>(j.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),p.jsx(p.Fragment,{children:n}));function ru(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Gr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function io(e){return"nodeType"in e}function Le(e){var t,r;return e?Mt(e)?e:io(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function so(e){const{Document:t}=Le(e);return e instanceof t}function hr(e){return Mt(e)?!1:e instanceof Le(e).HTMLElement}function es(e){return e instanceof Le(e).SVGElement}function Ft(e){return e?Mt(e)?e.document:io(e)?so(e)?e:hr(e)||es(e)?e.ownerDocument:document:document:document}const Ke=Gr?j.useLayoutEffect:j.useEffect;function Kr(e){const t=j.useRef(e);return Ke(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function nu(){const e=j.useRef(null),t=j.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function pr(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Ke(()=>{r.current!==e&&(r.current=e)},t),r}function mr(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Xr(e){const t=Kr(e),r=j.useRef(null),n=j.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function qr(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let ao={};function gr(e,t){return j.useMemo(()=>{if(t)return t;const r=ao[e]==null?0:ao[e]+1;return ao[e]=r,e+"-"+r},[e,t])}function ts(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Bt=ts(1),br=ts(-1);function ou(e){return"clientX"in e&&"clientY"in e}function Jr(e){if(!e)return!1;const{KeyboardEvent:t}=Le(e.target);return t&&e instanceof t}function iu(e){if(!e)return!1;const{TouchEvent:t}=Le(e.target);return t&&e instanceof t}function Qr(e){if(iu(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return ou(e)?{x:e.clientX,y:e.clientY}:null}const gt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[gt.Translate.toString(e),gt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),rs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function su(e){return e.matches(rs)?e:e.querySelector(rs)}const au={display:"none"};function lu(e){let{id:t,value:r}=e;return j.createElement("div",{id:t,style:au},r)}function cu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return j.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function du(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ns=j.createContext(null);function uu(e){const t=j.useContext(ns);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function fu(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const hu={draggable:`
|
|
209
209
|
To pick up a draggable item, press the space bar.
|
|
210
210
|
While dragging, use the arrow keys to move the item.
|
|
211
211
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
212
|
-
`},lu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function cu(e){let{announcements:t=lu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=au}=e;const{announce:i,announcement:s}=ou(),a=gr("DndLiveRegion"),[l,c]=T.useState(!1);if(T.useEffect(()=>{c(!0)},[]),iu(T.useMemo(()=>({onDragStart(f){let{active:m}=f;i(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:u}=f;t.onDragMove&&i(t.onDragMove({active:m,over:u}))},onDragOver(f){let{active:m,over:u}=f;i(t.onDragOver({active:m,over:u}))},onDragEnd(f){let{active:m,over:u}=f;i(t.onDragEnd({active:m,over:u}))},onDragCancel(f){let{active:m,over:u}=f;i(t.onDragCancel({active:m,over:u}))}}),[i,t])),!l)return null;const d=T.createElement(T.Fragment,null,T.createElement(ru,{id:n,value:o.draggable}),T.createElement(nu,{id:a,announcement:s}));return r?pt.createPortal(d,r):d}var ze;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ze||(ze={}));function tn(){}function lo(e,t){return T.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function du(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return T.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Xe=Object.freeze({x:0,y:0});function rs(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function uu(e,t){const r=en(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function ns(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function fu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function os(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function is(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ss(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const hu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ss(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=rs(ss(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(ns)},pu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=os(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=os(l),d=o.reduce((m,u,x)=>m+rs(c[x],u),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(ns)};function mu(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,c=e.width*e.height,d=s*a,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const gu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=mu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(fu)};function bu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function as(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xe}function vu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const xu=vu(1);function ls(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function wu(e,t,r){const n=ls(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),c=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const yu={ignoreTransform:!1};function Wt(e,t){t===void 0&&(t=yu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Me(e).getComputedStyle(e);c&&(r=wu(r,c,d))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function cs(e){return Wt(e,{ignoreTransform:!0})}function ku(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Su(e,t){return t===void 0&&(t=Me(e).getComputedStyle(e)),t.position==="fixed"}function _u(e,t){t===void 0&&(t=Me(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function rn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(so(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!hr(o)||Ji(o)||r.includes(o))return r;const i=Me(e).getComputedStyle(o);return o!==e&&_u(o,i)&&r.push(o),Su(o,i)?r:n(o.parentNode)}return e?n(e):r}function ds(e){const[t]=rn(e,1);return t??null}function co(e){return!Gr||!e?null:Ft(e)?e:io(e)?so(e)||e===Bt(e).scrollingElement?window:hr(e)?e:null:null}function us(e){return Ft(e)?e.scrollX:e.scrollLeft}function fs(e){return Ft(e)?e.scrollY:e.scrollTop}function uo(e){return{x:us(e),y:fs(e)}}var Te;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Te||(Te={}));function hs(e){return!Gr||!e?!1:e===document.scrollingElement}function ps(e){const t={x:0,y:0},r=hs(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Cu={x:.2,y:.2};function Eu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Cu);const{isTop:c,isBottom:d,isLeft:f,isRight:m}=ps(e),u={x:0,y:0},x={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(u.y=Te.Backward,x.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(u.y=Te.Forward,x.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(u.x=Te.Forward,x.x=n*Math.abs((t.right-h.width-a)/h.width)):!f&&s<=t.left+h.width&&(u.x=Te.Backward,x.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:u,speed:x}}function Au(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ms(e){return e.reduce((t,r)=>Ut(t,uo(r)),Xe)}function Nu(e){return e.reduce((t,r)=>t+us(r),0)}function zu(e){return e.reduce((t,r)=>t+fs(r),0)}function gs(e,t){if(t===void 0&&(t=Wt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ds(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ju=[["x",["left","right"],Nu],["y",["top","bottom"],zu]];class fo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=rn(r),o=ms(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of ju)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(n),d=o[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Tu(e){const{EventTarget:t}=Me(e);return e instanceof t?e:Bt(e)}function ho(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var He;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(He||(He={}));function bs(e){e.preventDefault()}function Ou(e){e.stopPropagation()}var we;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(we||(we={}));const vs={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},Pu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case we.Right:return{...r,x:r.x+25};case we.Left:return{...r,x:r.x-25};case we.Down:return{...r,y:r.y+25};case we.Up:return{...r,y:r.y-25}}};class po{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new vr(Bt(r)),this.windowListeners=new vr(Me(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(He.Resize,this.handleCancel),this.windowListeners.add(He.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(He.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&gs(n),r(Xe)}handleKeyDown(t){if(Qr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=vs,coordinateGetter:s=Pu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:Xe;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:r,context:n.current,currentCoordinates:d});if(f){const m=br(f,d),u={x:0,y:0},{scrollableAncestors:x}=n.current;for(const h of x){const b=t.code,{isTop:v,isRight:w,isLeft:k,isBottom:S,maxScroll:C,minScroll:O}=ps(h),N=Au(h),I={x:Math.min(b===we.Right?N.right-N.width/2:N.right,Math.max(b===we.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(b===we.Down?N.bottom-N.height/2:N.bottom,Math.max(b===we.Down?N.top:N.top+N.height/2,f.y))},D=b===we.Right&&!w||b===we.Left&&!k,L=b===we.Down&&!S||b===we.Up&&!v;if(D&&I.x!==f.x){const Z=h.scrollLeft+m.x,j=b===we.Right&&Z<=C.x||b===we.Left&&Z>=O.x;if(j&&!m.y){h.scrollTo({left:Z,behavior:a});return}j?u.x=h.scrollLeft-Z:u.x=b===we.Right?h.scrollLeft-C.x:h.scrollLeft-O.x,u.x&&h.scrollBy({left:-u.x,behavior:a});break}else if(L&&I.y!==f.y){const Z=h.scrollTop+m.y,j=b===we.Down&&Z<=C.y||b===we.Up&&Z>=O.y;if(j&&!m.x){h.scrollTo({top:Z,behavior:a});return}j?u.y=h.scrollTop-Z:u.y=b===we.Down?h.scrollTop-C.y:h.scrollTop-O.y,u.y&&h.scrollBy({top:-u.y,behavior:a});break}}this.handleMove(t,Ut(br(f,this.referenceCoordinates),u))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}po.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=vs,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function xs(e){return!!(e&&"distance"in e)}function ws(e){return!!(e&&"delay"in e)}class mo{constructor(t,r,n){var o;n===void 0&&(n=Tu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Bt(s),this.documentListeners=new vr(this.document),this.listeners=new vr(n),this.windowListeners=new vr(Me(s)),this.initialCoordinates=(o=en(i))!=null?o:Xe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(He.Resize,this.handleCancel),this.windowListeners.add(He.DragStart,bs),this.windowListeners.add(He.VisibilityChange,this.handleCancel),this.windowListeners.add(He.ContextMenu,bs),this.documentListeners.add(He.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ws(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(xs(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(He.Click,Ou,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(He.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=en(t))!=null?r:Xe,c=br(o,l);if(!n&&a){if(xs(a)){if(a.tolerance!=null&&ho(c,a.tolerance))return this.handleCancel();if(ho(c,a.distance))return this.handleStart()}if(ws(a)&&ho(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Iu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class go extends mo{constructor(t){const{event:r}=t,n=Bt(r.target);super(t,Iu,n)}}go.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Du={move:{name:"mousemove"},end:{name:"mouseup"}};var bo;(function(e){e[e.RightClick=2]="RightClick"})(bo||(bo={}));class Ru extends mo{constructor(t){super(t,Du,Bt(t.event.target))}}Ru.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===bo.RightClick?!1:(n==null||n({event:r}),!0)}}];const vo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ys extends mo{constructor(t){super(t,vo)}static setup(){return window.addEventListener(vo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(vo.move.name,t)};function t(){}}}ys.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var xr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xr||(xr={}));var nn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nn||(nn={}));function Mu(e){let{acceleration:t,activator:r=xr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=nn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:m}=e;const u=Fu({delta:f,disabled:!i}),[x,h]=qd(),b=T.useRef({x:0,y:0}),v=T.useRef({x:0,y:0}),w=T.useMemo(()=>{switch(r){case xr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xr.DraggableRect:return o}},[r,o,l]),k=T.useRef(null),S=T.useCallback(()=>{const O=k.current;if(!O)return;const N=b.current.x*v.current.x,I=b.current.y*v.current.y;O.scrollBy(N,I)},[]),C=T.useMemo(()=>a===nn.TreeOrder?[...c].reverse():c,[a,c]);T.useEffect(()=>{if(!i||!c.length||!w){h();return}for(const O of C){if((n==null?void 0:n(O))===!1)continue;const N=c.indexOf(O),I=d[N];if(!I)continue;const{direction:D,speed:L}=Eu(O,I,w,t,m);for(const Z of["x","y"])u[Z][D[Z]]||(L[Z]=0,D[Z]=0);if(L.x>0||L.y>0){h(),k.current=O,x(S,s),b.current=L,v.current=D;return}}b.current={x:0,y:0},v.current={x:0,y:0},h()},[t,S,n,h,i,s,JSON.stringify(w),JSON.stringify(u),x,c,C,d,JSON.stringify(m)])}const Lu={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function Fu(e){let{delta:t,disabled:r}=e;const n=Jr(t);return mr(o=>{if(r||!n||!o)return Lu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Te.Backward]:o.x[Te.Backward]||i.x===-1,[Te.Forward]:o.x[Te.Forward]||i.x===1},y:{[Te.Backward]:o.y[Te.Backward]||i.y===-1,[Te.Forward]:o.y[Te.Forward]||i.y===1}}},[r,t,n])}function Bu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return mr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Uu(e,t){return T.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var wr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(wr||(wr={}));var xo;(function(e){e.Optimized="optimized"})(xo||(xo={}));const ks=new Map;function Wu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=T.useState(null),{frequency:a,measure:l,strategy:c}=o,d=T.useRef(e),f=b(),m=pr(f),u=T.useCallback(function(v){v===void 0&&(v=[]),!m.current&&s(w=>w===null?v:w.concat(v.filter(k=>!w.includes(k))))},[m]),x=T.useRef(null),h=mr(v=>{if(f&&!r)return ks;if(!v||v===ks||d.current!==e||i!=null){const w=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){w.set(k.id,k.rect.current);continue}const S=k.node.current,C=S?new fo(l(S),S):null;k.rect.current=C,C&&w.set(k.id,C)}return w}return v},[e,i,r,f,l]);return T.useEffect(()=>{d.current=e},[e]),T.useEffect(()=>{f||u()},[r,f]),T.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),T.useEffect(()=>{f||typeof a!="number"||x.current!==null||(x.current=setTimeout(()=>{u(),x.current=null},a))},[a,f,u,...n]),{droppableRects:h,measureDroppableContainers:u,measuringScheduled:i!=null};function b(){switch(c){case wr.Always:return!1;case wr.BeforeDragging:return r;default:return!r}}}function wo(e,t){return mr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function $u(e,t){return wo(e,t)}function Hu(e){let{callback:t,disabled:r}=e;const n=Xr(t),o=T.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return T.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function on(e){let{callback:t,disabled:r}=e;const n=Xr(t),o=T.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return T.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Vu(e){return new fo(Wt(e),e)}function Ss(e,t,r){t===void 0&&(t=Vu);const[n,o]=T.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=Hu({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=on({callback:i});return Ge(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function Yu(e){const t=wo(e);return as(e,t)}const _s=[];function Ku(e){const t=T.useRef(e),r=mr(n=>e?n&&n!==_s&&e&&t.current&&e.parentNode===t.current.parentNode?n:rn(e):_s,[e]);return T.useEffect(()=>{t.current=e},[e]),r}function Zu(e){const[t,r]=T.useState(null),n=T.useRef(e),o=T.useCallback(i=>{const s=co(i.target);s&&r(a=>a?(a.set(s,uo(s)),new Map(a)):null)},[]);return T.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=co(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,uo(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=co(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),T.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ut(i,s),Xe):ms(e):Xe,[e,t])}function Cs(e,t){t===void 0&&(t=[]);const r=T.useRef(null);return T.useEffect(()=>{r.current=null},t),T.useEffect(()=>{const n=e!==Xe;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?br(e,r.current):Xe}function Gu(e){T.useEffect(()=>{if(!Gr)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Xu(e,t){return T.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Es(e){return T.useMemo(()=>e?ku(e):null,[e])}const As=[];function qu(e,t){t===void 0&&(t=Wt);const[r]=e,n=Es(r?Me(r):null),[o,i]=T.useState(As);function s(){i(()=>e.length?e.map(l=>hs(l)?n:new fo(t(l),l)):As)}const a=on({callback:s});return Ge(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Ns(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hr(t)?t:e}function Ju(e){let{measure:t}=e;const[r,n]=T.useState(null),o=T.useCallback(c=>{for(const{target:d}of c)if(hr(d)){n(f=>{const m=t(d);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),i=on({callback:o}),s=T.useCallback(c=>{const d=Ns(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=qr(s);return T.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const Qu=[{sensor:go,options:{}},{sensor:po,options:{}}],ef={current:{}},sn={draggable:{measure:cs},droppable:{measure:cs,strategy:wr.WhileDragging,frequency:xo.Optimized},dragOverlay:{measure:Wt}};class yr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const tf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new yr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sn,measureDroppableContainers:tn,windowRect:null,measuringScheduled:!1},zs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tn,draggableNodes:new Map,over:null,measureDroppableContainers:tn},kr=T.createContext(zs),js=T.createContext(tf);function rf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yr}}}function nf(e,t){switch(t.type){case ze.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ze.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ze.DragEnd:case ze.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ze.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new yr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case ze.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new yr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case ze.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new yr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function of(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=T.useContext(kr),i=Jr(n),s=Jr(r==null?void 0:r.id);return T.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!Qr(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=eu(d);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Ts(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function sf(e){return T.useMemo(()=>({draggable:{...sn.draggable,...e==null?void 0:e.draggable},droppable:{...sn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function af(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=T.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ge(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=r(c),f=as(d,n);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=ds(c);m&&m.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const an=T.createContext({...Xe,scaleX:1,scaleY:1});var vt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(vt||(vt={}));const lf=T.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=Qu,collisionDetection:f=gu,measuring:m,modifiers:u,...x}=t;const h=T.useReducer(nf,void 0,rf),[b,v]=h,[w,k]=su(),[S,C]=T.useState(vt.Uninitialized),O=S===vt.Initialized,{draggable:{active:N,nodes:I,translate:D},droppable:{containers:L}}=b,Z=N!=null?I.get(N):null,j=T.useRef({initial:null,translated:null}),F=T.useMemo(()=>{var Ae;return N!=null?{id:N,data:(Ae=Z==null?void 0:Z.data)!=null?Ae:ef,rect:j}:null},[N,Z]),y=T.useRef(null),[H,Q]=T.useState(null),[$,V]=T.useState(null),Y=pr(x,Object.values(x)),J=gr("DndDescribedBy",s),z=T.useMemo(()=>L.getEnabled(),[L]),P=sf(m),{droppableRects:K,measureDroppableContainers:G,measuringScheduled:te}=Wu(z,{dragging:O,dependencies:[D.x,D.y],config:P.droppable}),ue=Bu(I,N),ee=T.useMemo(()=>$?en($):null,[$]),ie=Zn(),se=$u(ue,P.draggable.measure);af({activeNode:N!=null?I.get(N):null,config:ie.layoutShiftCompensation,initialRect:se,measure:P.draggable.measure});const oe=Ss(ue,P.draggable.measure,se),le=Ss(ue?ue.parentElement:null),fe=T.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=L.getNodeFor((r=fe.current.over)==null?void 0:r.id),g=Ju({measure:P.dragOverlay.measure}),B=(n=g.nodeRef.current)!=null?n:ue,W=O?(o=g.rect)!=null?o:oe:null,E=!!(g.nodeRef.current&&g.rect),A=Yu(E?null:oe),R=Es(B?Me(B):null),X=Ku(O?xe??ue:null),U=qu(X),M=Ts(u,{transform:{x:D.x-A.x,y:D.y-A.y,scaleX:1,scaleY:1},activatorEvent:$,active:F,activeNodeRect:oe,containerNodeRect:le,draggingNodeRect:W,over:fe.current.over,overlayNodeRect:g.rect,scrollableAncestors:X,scrollableAncestorRects:U,windowRect:R}),q=ee?Ut(ee,D):null,ne=Zu(X),re=Cs(ne),ae=Cs(ne,[oe]),he=Ut(M,re),me=W?xu(W,M):null,ve=F&&me?f({active:F,collisionRect:me,droppableRects:K,droppableContainers:z,pointerCoordinates:q}):null,st=is(ve,"id"),[je,Ct]=T.useState(null),Ee=E?M:Ut(M,ae),sr=bu(Ee,(i=je==null?void 0:je.rect)!=null?i:null,oe),It=T.useRef(null),Ye=T.useCallback((Ae,Oe)=>{let{sensor:We,options:Et}=Oe;if(y.current==null)return;const Ke=I.get(y.current);if(!Ke)return;const $e=Ae.nativeEvent,at=new We({active:y.current,activeNode:Ke,event:$e,options:Et,context:fe,onAbort(De){if(!I.get(De))return;const{onDragAbort:lt}=Y.current,ht={id:De};lt==null||lt(ht),w({type:"onDragAbort",event:ht})},onPending(De,At,lt,ht){if(!I.get(De))return;const{onDragPending:Dr}=Y.current,Nt={id:De,constraint:At,initialCoordinates:lt,offset:ht};Dr==null||Dr(Nt),w({type:"onDragPending",event:Nt})},onStart(De){const At=y.current;if(At==null)return;const lt=I.get(At);if(!lt)return;const{onDragStart:ht}=Y.current,Ir={activatorEvent:$e,active:{id:At,data:lt.data,rect:j}};pt.unstable_batchedUpdates(()=>{ht==null||ht(Ir),C(vt.Initializing),v({type:ze.DragStart,initialCoordinates:De,active:At}),w({type:"onDragStart",event:Ir}),Q(It.current),V($e)})},onMove(De){v({type:ze.DragMove,coordinates:De})},onEnd:ar(ze.DragEnd),onCancel:ar(ze.DragCancel)});It.current=at;function ar(De){return async function(){const{active:lt,collisions:ht,over:Ir,scrollAdjustedTranslate:Dr}=fe.current;let Nt=null;if(lt&&Dr){const{cancelDrop:Rr}=Y.current;Nt={activatorEvent:$e,active:lt,collisions:ht,delta:Dr,over:Ir},De===ze.DragEnd&&typeof Rr=="function"&&await Promise.resolve(Rr(Nt))&&(De=ze.DragCancel)}y.current=null,pt.unstable_batchedUpdates(()=>{v({type:De}),C(vt.Uninitialized),Ct(null),Q(null),V(null),It.current=null;const Rr=De===ze.DragEnd?"onDragEnd":"onDragCancel";if(Nt){const mi=Y.current[Rr];mi==null||mi(Nt),w({type:Rr,event:Nt})}})}}},[I]),Yn=T.useCallback((Ae,Oe)=>(We,Et)=>{const Ke=We.nativeEvent,$e=I.get(Et);if(y.current!==null||!$e||Ke.dndKit||Ke.defaultPrevented)return;const at={active:$e};Ae(We,Oe.options,at)===!0&&(Ke.dndKit={capturedBy:Oe.sensor},y.current=Et,Ye(We,Oe))},[I,Ye]),Kn=Uu(d,Yn);Gu(d),Ge(()=>{oe&&S===vt.Initializing&&C(vt.Initialized)},[oe,S]),T.useEffect(()=>{const{onDragMove:Ae}=Y.current,{active:Oe,activatorEvent:We,collisions:Et,over:Ke}=fe.current;if(!Oe||!We)return;const $e={active:Oe,activatorEvent:We,collisions:Et,delta:{x:he.x,y:he.y},over:Ke};pt.unstable_batchedUpdates(()=>{Ae==null||Ae($e),w({type:"onDragMove",event:$e})})},[he.x,he.y]),T.useEffect(()=>{const{active:Ae,activatorEvent:Oe,collisions:We,droppableContainers:Et,scrollAdjustedTranslate:Ke}=fe.current;if(!Ae||y.current==null||!Oe||!Ke)return;const{onDragOver:$e}=Y.current,at=Et.get(st),ar=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,De={active:Ae,activatorEvent:Oe,collisions:We,delta:{x:Ke.x,y:Ke.y},over:ar};pt.unstable_batchedUpdates(()=>{Ct(ar),$e==null||$e(De),w({type:"onDragOver",event:De})})},[st]),Ge(()=>{fe.current={activatorEvent:$,active:F,activeNode:ue,collisionRect:me,collisions:ve,droppableRects:K,draggableNodes:I,draggingNode:B,draggingNodeRect:W,droppableContainers:L,over:je,scrollableAncestors:X,scrollAdjustedTranslate:he},j.current={initial:W,translated:me}},[F,ue,ve,me,I,B,W,K,L,je,X,he]),Mu({...ie,delta:D,draggingRect:me,pointerCoordinates:q,scrollableAncestors:X,scrollableAncestorRects:U});const hi=T.useMemo(()=>({active:F,activeNode:ue,activeNodeRect:oe,activatorEvent:$,collisions:ve,containerNodeRect:le,dragOverlay:g,draggableNodes:I,droppableContainers:L,droppableRects:K,over:je,measureDroppableContainers:G,scrollableAncestors:X,scrollableAncestorRects:U,measuringConfiguration:P,measuringScheduled:te,windowRect:R}),[F,ue,oe,$,ve,le,g,I,L,K,je,G,X,U,P,te,R]),pi=T.useMemo(()=>({activatorEvent:$,activators:Kn,active:F,activeNodeRect:oe,ariaDescribedById:{draggable:J},dispatch:v,draggableNodes:I,over:je,measureDroppableContainers:G}),[$,Kn,F,oe,v,J,I,je,G]);return T.createElement(ts.Provider,{value:k},T.createElement(kr.Provider,{value:pi},T.createElement(js.Provider,{value:hi},T.createElement(an.Provider,{value:sr},c)),T.createElement(of,{disabled:(a==null?void 0:a.restoreFocus)===!1})),T.createElement(cu,{...a,hiddenTextDescribedById:J}));function Zn(){const Ae=(H==null?void 0:H.autoScrollEnabled)===!1,Oe=typeof l=="object"?l.enabled===!1:l===!1,We=O&&!Ae&&!Oe;return typeof l=="object"?{...l,enabled:We}:{enabled:We}}}),cf=T.createContext(null),Os="button",df="Draggable";function uf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=gr(df),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:m}=T.useContext(kr),{role:u=Os,roleDescription:x="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,v=T.useContext(b?an:cf),[w,k]=qr(),[S,C]=qr(),O=Xu(s,t),N=pr(r);Ge(()=>(f.set(t,{id:t,key:i,node:w,activatorNode:S,data:N}),()=>{const D=f.get(t);D&&D.key===i&&f.delete(t)}),[f,t]);const I=T.useMemo(()=>({role:u,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&u===Os?!0:void 0,"aria-roledescription":x,"aria-describedby":d.draggable}),[n,u,h,b,x,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:I,isDragging:b,listeners:n?void 0:O,node:w,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:v}}function Ps(){return T.useContext(js)}const ff="Droppable",hf={timeout:25};function pf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=gr(ff),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=T.useContext(kr),d=T.useRef({disabled:r}),f=T.useRef(!1),m=T.useRef(null),u=T.useRef(null),{disabled:x,updateMeasurementsFor:h,timeout:b}={...hf,...o},v=pr(h??n),w=T.useCallback(()=>{if(!f.current){f.current=!0;return}u.current!=null&&clearTimeout(u.current),u.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),u.current=null},b)},[b]),k=on({callback:w,disabled:x||!s}),S=T.useCallback((I,D)=>{k&&(D&&(k.unobserve(D),f.current=!1),I&&k.observe(I))},[k]),[C,O]=qr(S),N=pr(t);return T.useEffect(()=>{!k||!C.current||(k.disconnect(),f.current=!1,k.observe(C.current))},[C,k]),T.useEffect(()=>(a({type:ze.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:N}}),()=>a({type:ze.UnregisterDroppable,key:i,id:n})),[n]),T.useEffect(()=>{r!==d.current.disabled&&(a({type:ze.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:s,rect:m,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:O}}function mf(e){let{animation:t,children:r}=e;const[n,o]=T.useState(null),[i,s]=T.useState(null),a=Jr(r);return!r&&!n&&a&&o(a),Ge(()=>{if(!i)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,n,i]),T.createElement(T.Fragment,null,r,n?T.cloneElement(n,{ref:s}):null)}const gf={x:0,y:0,scaleX:1,scaleY:1};function bf(e){let{children:t}=e;return T.createElement(kr.Provider,{value:zs},T.createElement(an.Provider,{value:gf},t))}const vf={position:"fixed",touchAction:"none"},xf=e=>Qr(e)?"transform 250ms ease":void 0,wf=T.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=xf}=e;if(!a)return null;const f=o?c:{...c,scaleX:1,scaleY:1},m={...vf,width:a.width,height:a.height,top:a.top,left:a.left,transform:bt.Transform.toString(f),transformOrigin:o&&n?uu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return T.createElement(r,{className:s,style:m,ref:t},i)}),yf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:bt.Transform.toString(t)},{transform:bt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))r.node.style.setProperty(l,c);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function kf(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Xr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Ns(s);if(!c)return;const{transform:d}=Me(s).getComputedStyle(s),f=ls(d);if(!f)return;const m=typeof t=="function"?t:Sf(t);return gs(l,o.draggable.measure),m({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function Sf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...yf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},m={x:l.x-d.x,y:l.y-d.y,...f},u=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:m}}),[x]=u,h=u[u.length-1];if(JSON.stringify(x)===JSON.stringify(h))return;const b=n==null?void 0:n({active:s,dragOverlay:a,...c}),v=a.node.animate(u,{duration:t,easing:r,fill:"forwards"});return new Promise(w=>{v.onfinish=()=>{b==null||b(),w()}})}}let Is=0;function _f(e){return T.useMemo(()=>{if(e!=null)return Is++,Is},[e])}const Cf=T.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:u,draggableNodes:x,droppableContainers:h,dragOverlay:b,over:v,measuringConfiguration:w,scrollableAncestors:k,scrollableAncestorRects:S,windowRect:C}=Ps(),O=T.useContext(an),N=_f(f==null?void 0:f.id),I=Ts(s,{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:u,draggingNodeRect:b.rect,over:v,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:S,transform:O,windowRect:C}),D=wo(m),L=kf({config:n,draggableNodes:x,droppableContainers:h,measuringConfiguration:w}),Z=D?b.setRef:void 0;return T.createElement(bf,null,T.createElement(mf,{animation:L},f&&N?T.createElement(wf,{key:N,id:f.id,ref:Z,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:c,...o},transform:I},r):null))}),Ef=e=>{let{transform:t}=e;return{...t,x:0}};function Ds(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Af(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function ln(e){return e!==null&&e>=0}function Nf(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function zf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Rs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ds(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},cn={scaleX:1,scaleY:1},jf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const c=i[s];return c?{x:0,y:r<s?c.top+c.height-(a.top+a.height):c.top-a.top,...cn}:null}const l=Tf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...cn}:o<r&&o>=s?{x:0,y:a.height+l,...cn}:{x:0,y:0,...cn}};function Tf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ms="Sortable",Ls=T.createContext({activeIndex:-1,containerId:Ms,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Rs,disabled:{draggable:!1,droppable:!1}});function Of(e){let{children:t,id:r,items:n,strategy:o=Rs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Ps(),f=gr(Ms,r),m=a.rect!==null,u=T.useMemo(()=>n.map(O=>typeof O=="object"&&"id"in O?O.id:O),[n]),x=s!=null,h=s?u.indexOf(s.id):-1,b=c?u.indexOf(c.id):-1,v=T.useRef(u),w=!Nf(u,v.current),k=b!==-1&&h===-1||w,S=zf(i);Ge(()=>{w&&x&&d(u)},[w,u,x,d]),T.useEffect(()=>{v.current=u},[u]);const C=T.useMemo(()=>({activeIndex:h,containerId:f,disabled:S,disableTransforms:k,items:u,overIndex:b,useDragOverlay:m,sortedRects:Af(u,l),strategy:o}),[h,f,S.draggable,S.droppable,k,u,b,l,m,o]);return T.createElement(Ls.Provider,{value:C},t)}const Pf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ds(r,n,o).indexOf(t)},If=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Df={duration:200,easing:"ease"},Fs="transform",Rf=bt.Transition.toString({property:Fs,duration:0,easing:"linear"}),Mf={roleDescription:"sortable"};function Lf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=T.useState(null),a=T.useRef(r);return Ge(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Wt(n.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&s(d)}}r!==a.current&&(a.current=r)},[t,r,n,o]),T.useEffect(()=>{i&&s(null)},[i]),i}function Ff(e){let{animateLayoutChanges:t=If,attributes:r,disabled:n,data:o,getNewIndex:i=Pf,id:s,strategy:a,resizeObserverConfig:l,transition:c=Df}=e;const{items:d,containerId:f,activeIndex:m,disabled:u,disableTransforms:x,sortedRects:h,overIndex:b,useDragOverlay:v,strategy:w}=T.useContext(Ls),k=Bf(n,u),S=d.indexOf(s),C=T.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...o}),[f,o,S,d]),O=T.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:N,node:I,isOver:D,setNodeRef:L}=pf({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:Z,activatorEvent:j,activeNodeRect:F,attributes:y,setNodeRef:H,listeners:Q,isDragging:$,over:V,setActivatorNodeRef:Y,transform:J}=uf({id:s,data:C,attributes:{...Mf,...r},disabled:k.draggable}),z=Xd(L,H),P=!!Z,K=P&&!x&&ln(m)&&ln(b),G=!v&&$,te=G&&K?J:null,ee=K?te??(a??w)({rects:h,activeNodeRect:F,activeIndex:m,overIndex:b,index:S}):null,ie=ln(m)&&ln(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):S,se=Z==null?void 0:Z.id,oe=T.useRef({activeId:se,items:d,newIndex:ie,containerId:f}),le=d!==oe.current.items,fe=t({active:Z,containerId:f,isDragging:$,isSorting:P,id:s,index:S,items:d,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:c,wasDragging:oe.current.activeId!=null}),xe=Lf({disabled:!fe,index:S,node:I,rect:N});return T.useEffect(()=>{P&&oe.current.newIndex!==ie&&(oe.current.newIndex=ie),f!==oe.current.containerId&&(oe.current.containerId=f),d!==oe.current.items&&(oe.current.items=d)},[P,ie,f,d]),T.useEffect(()=>{if(se===oe.current.activeId)return;if(se!=null&&oe.current.activeId==null){oe.current.activeId=se;return}const B=setTimeout(()=>{oe.current.activeId=se},50);return()=>clearTimeout(B)},[se]),{active:Z,activeIndex:m,attributes:y,data:C,rect:N,index:S,newIndex:ie,items:d,isOver:D,isSorting:P,isDragging:$,listeners:Q,node:I,overIndex:b,over:V,setNodeRef:z,setActivatorNodeRef:Y,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:xe??ee,transition:g()};function g(){if(xe||le&&oe.current.newIndex===S)return Rf;if(!(G&&!Qr(j)||!c)&&(P||fe))return bt.Transition.toString({...c,property:Fs})}}function Bf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function dn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Uf=[we.Down,we.Right,we.Up,we.Left],Wf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Uf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(e.code){case we.Down:n.top<m.top&&l.push(f);break;case we.Up:n.top>m.top&&l.push(f);break;case we.Left:n.left>m.left&&l.push(f);break;case we.Right:n.left<m.left&&l.push(f);break}});const c=pu({collisionRect:n,droppableRects:o,droppableContainers:l});let d=is(c,"id");if(d===(s==null?void 0:s.id)&&c.length>1&&(d=c[1].id),d!=null){const f=i.get(r.id),m=i.get(d),u=m?o.get(m.id):null,x=m==null?void 0:m.node.current;if(x&&u&&f&&m){const b=rn(x).some((O,N)=>a[N]!==O),v=Bs(f,m),w=$f(f,m),k=b||!v?{x:0,y:0}:{x:w?n.width-u.width:0,y:w?n.height-u.height:0},S={x:u.left,y:u.top};return k.x&&k.y?S:br(S,k)}}}};function Bs(e,t){return!dn(e)||!dn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function $f(e,t){return!dn(e)||!dn(t)||!Bs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function yo({className:e,type:t,...r}){return p.jsx("input",{type:t,className:pe("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function Hf({className:e,...t}){return p.jsx("textarea",{className:pe("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function Vf({className:e,checked:t,onCheckedChange:r,...n}){return p.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:pe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function jt({className:e,...t}){return p.jsx("label",{className:pe("text-sm font-medium leading-none select-none",e),...t})}function ko(e,[t,r]){return Math.min(r,Math.max(t,e))}function be(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function $t(e,t=[]){let r=[];function n(i,s){const a=_.createContext(s),l=r.length;r=[...r,s];const c=f=>{var v;const{scope:m,children:u,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[l])||a,b=_.useMemo(()=>x,Object.values(x));return p.jsx(h.Provider,{value:b,children:u})};c.displayName=i+"Provider";function d(f,m){var h;const u=((h=m==null?void 0:m[e])==null?void 0:h[l])||a,x=_.useContext(u);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=r.map(s=>_.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Yf(o,...t)]}function Yf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Us(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ws(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Us(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Us(e[o],null)}}}}function _e(...e){return _.useCallback(Ws(...e),e)}function Ht(e){const t=Zf(e),r=_.forwardRef((n,o)=>{const{children:i,...s}=n,a=_.Children.toArray(i),l=a.find(Xf);if(l){const c=l.props.children,d=a.map(f=>f===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:f);return p.jsx(t,{...s,ref:o,children:_.isValidElement(c)?_.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Kf=Ht("Slot");function Zf(e){const t=_.forwardRef((r,n)=>{const{children:o,...i}=r;if(_.isValidElement(o)){const s=Jf(o),a=qf(i,o.props);return o.type!==_.Fragment&&(a.ref=n?Ws(n,s):s),_.cloneElement(o,a)}return _.Children.count(o)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $s=Symbol("radix.slottable");function Gf(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=$s,t}function Xf(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$s}function qf(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Jf(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Qf(e){const t=e+"CollectionProvider",[r,n]=$t(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:v}=h,w=T.useRef(null),k=T.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:w,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=Ht(a),c=T.forwardRef((h,b)=>{const{scope:v,children:w}=h,k=i(a,v),S=_e(b,k.collectionRef);return p.jsx(l,{ref:S,children:w})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ht(d),u=T.forwardRef((h,b)=>{const{scope:v,children:w,...k}=h,S=T.useRef(null),C=_e(b,S),O=i(d,v);return T.useEffect(()=>(O.itemMap.set(S,{ref:S,...k}),()=>void O.itemMap.delete(S))),p.jsx(m,{[f]:"",ref:C,children:w})});u.displayName=d;function x(h){const b=i(e+"CollectionConsumer",h);return T.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const k=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((O,N)=>k.indexOf(O.ref.current)-k.indexOf(N.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:u},x,n]}var eh=_.createContext(void 0);function Hs(e){const t=_.useContext(eh);return e||t||"ltr"}var th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Se=th.reduce((e,t)=>{const r=Ht(`Primitive.${t}`),n=_.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function rh(e,t){e&&Mr.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function nh(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e);_.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var oh="DismissableLayer",So="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",Vs,Ys=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),un=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=_.useContext(Ys),[d,f]=_.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,u]=_.useState({}),x=_e(t,N=>f(N)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(b),w=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=w>=v,C=ch(N=>{const I=N.target,D=[...c.branches].some(L=>L.contains(I));!S||D||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},m),O=dh(N=>{const I=N.target;[...c.branches].some(L=>L.contains(I))||(i==null||i(N),s==null||s(N),N.defaultPrevented||a==null||a())},m);return nh(N=>{w===c.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},m),_.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Vs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ks(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Vs)}},[d,m,r,c]),_.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ks())},[d,c]),_.useEffect(()=>{const N=()=>u({});return document.addEventListener(So,N),()=>document.removeEventListener(So,N)},[]),p.jsx(Se.div,{...l,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,O.onFocusCapture),onBlurCapture:be(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});un.displayName=oh;var ah="DismissableLayerBranch",lh=_.forwardRef((e,t)=>{const r=_.useContext(Ys),n=_.useRef(null),o=_e(t,n);return _.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(Se.div,{...e,ref:o})});lh.displayName=ah;function ch(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Zs(ih,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function dh(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=_.useRef(!1);return _.useEffect(()=>{const o=i=>{i.target&&!n.current&&Zs(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ks(){const e=new CustomEvent(So);document.dispatchEvent(e)}function Zs(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?rh(o,i):o.dispatchEvent(i)}var _o=0;function Gs(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xs()),document.body.insertAdjacentElement("beforeend",e[1]??Xs()),_o++,()=>{_o===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_o--}},[])}function Xs(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Co="focusScope.autoFocusOnMount",Eo="focusScope.autoFocusOnUnmount",qs={bubbles:!1,cancelable:!0},uh="FocusScope",Ao=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=_.useState(null),c=Le(o),d=Le(i),f=_.useRef(null),m=_e(t,h=>l(h)),u=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(n){let h=function(k){if(u.paused||!a)return;const S=k.target;a.contains(S)?f.current=S:xt(f.current,{select:!0})},b=function(k){if(u.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||xt(f.current,{select:!0}))},v=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&xt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const w=new MutationObserver(v);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),w.disconnect()}}},[n,a,u.paused]),_.useEffect(()=>{if(a){ea.add(u);const h=document.activeElement;if(!a.contains(h)){const v=new CustomEvent(Co,qs);a.addEventListener(Co,c),a.dispatchEvent(v),v.defaultPrevented||(fh(bh(Js(a)),{select:!0}),document.activeElement===h&&xt(a))}return()=>{a.removeEventListener(Co,c),setTimeout(()=>{const v=new CustomEvent(Eo,qs);a.addEventListener(Eo,d),a.dispatchEvent(v),v.defaultPrevented||xt(h??document.body,{select:!0}),a.removeEventListener(Eo,d),ea.remove(u)},0)}}},[a,c,d,u]);const x=_.useCallback(h=>{if(!r&&!n||u.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(b&&v){const w=h.currentTarget,[k,S]=hh(w);k&&S?!h.shiftKey&&v===S?(h.preventDefault(),r&&xt(k,{select:!0})):h.shiftKey&&v===k&&(h.preventDefault(),r&&xt(S,{select:!0})):v===w&&h.preventDefault()}},[r,n,u.paused]);return p.jsx(Se.div,{tabIndex:-1,...s,ref:m,onKeyDown:x})});Ao.displayName=uh;function fh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(xt(n,{select:t}),document.activeElement!==r)return}function hh(e){const t=Js(e),r=Qs(t,e),n=Qs(t.reverse(),e);return[r,n]}function Js(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Qs(e,t){for(const r of e)if(!ph(r,{upTo:t}))return r}function ph(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function mh(e){return e instanceof HTMLInputElement&&"select"in e}function xt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&mh(e)&&t&&e.select()}}var ea=gh();function gh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ta(e,t),e.unshift(t)},remove(t){var r;e=ta(e,t),(r=e[0])==null||r.resume()}}}function ta(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bh(e){return e.filter(t=>t.tagName!=="A")}var Ie=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},vh=_[" useId ".trim().toString()]||(()=>{}),xh=0;function Sr(e){const[t,r]=_.useState(vh());return Ie(()=>{r(n=>n??String(xh++))},[e]),t?`radix-${t}`:""}const wh=["top","right","bottom","left"],wt=Math.min,Fe=Math.max,fn=Math.round,hn=Math.floor,et=e=>({x:e,y:e}),yh={left:"right",right:"left",bottom:"top",top:"bottom"},kh={start:"end",end:"start"};function No(e,t,r){return Fe(e,wt(t,r))}function dt(e,t){return typeof e=="function"?e(t):e}function ut(e){return e.split("-")[0]}function Vt(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const Sh=new Set(["top","bottom"]);function tt(e){return Sh.has(ut(e))?"y":"x"}function To(e){return zo(tt(e))}function _h(e,t,r){r===void 0&&(r=!1);const n=Vt(e),o=To(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pn(s)),[s,pn(s)]}function Ch(e){const t=pn(e);return[Oo(e),t,Oo(t)]}function Oo(e){return e.replace(/start|end/g,t=>kh[t])}const ra=["left","right"],na=["right","left"],Eh=["top","bottom"],Ah=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?na:ra:t?ra:na;case"left":case"right":return t?Eh:Ah;default:return[]}}function zh(e,t,r,n){const o=Vt(e);let i=Nh(ut(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Oo)))),i}function pn(e){return e.replace(/left|right|bottom|top/g,t=>yh[t])}function jh(e){return{top:0,right:0,bottom:0,left:0,...e}}function oa(e){return typeof e!="number"?jh(e):{top:e,right:e,bottom:e,left:e}}function mn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ia(e,t,r){let{reference:n,floating:o}=e;const i=tt(t),s=To(t),a=jo(s),l=ut(t),c=i==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let u;switch(l){case"top":u={x:d,y:n.y-o.height};break;case"bottom":u={x:d,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:f};break;case"left":u={x:n.x-o.width,y:f};break;default:u={x:n.x,y:n.y}}switch(Vt(t)){case"start":u[s]-=m*(r&&c?-1:1);break;case"end":u[s]+=m*(r&&c?-1:1);break}return u}async function Th(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:u=0}=dt(t,e),x=oa(u),b=a[m?f==="floating"?"reference":"floating":f],v=mn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:k,strategy:l}):w);return{top:(v.top-C.top+x.top)/S.y,bottom:(C.bottom-v.bottom+x.bottom)/S.y,left:(v.left-C.left+x.left)/S.x,right:(C.right-v.right+x.right)/S.x}}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=ia(c,n,l),m=n,u={},x=0;for(let b=0;b<a.length;b++){var h;const{name:v,fn:w}=a[b],{x:k,y:S,data:C,reset:O}=await w({x:d,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:u,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Th},elements:{reference:e,floating:t}});d=k??d,f=S??f,u={...u,[v]:{...u[v],...C}},O&&x<=50&&(x++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:f}=ia(c,m,l)),b=-1)}return{x:d,y:f,placement:m,strategy:o,middlewareData:u}},Ph=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=dt(e,t)||{};if(c==null)return{};const f=oa(d),m={x:r,y:n},u=To(o),x=jo(u),h=await s.getDimensions(c),b=u==="y",v=b?"top":"left",w=b?"bottom":"right",k=b?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[u]-m[u]-i.floating[x],C=m[u]-i.reference[u],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let N=O?O[k]:0;(!N||!await(s.isElement==null?void 0:s.isElement(O)))&&(N=a.floating[k]||i.floating[x]);const I=S/2-C/2,D=N/2-h[x]/2-1,L=wt(f[v],D),Z=wt(f[w],D),j=L,F=N-h[x]-Z,y=N/2-h[x]/2+I,H=No(j,y,F),Q=!l.arrow&&Vt(o)!=null&&y!==H&&i.reference[x]/2-(y<j?L:Z)-h[x]/2<0,$=Q?y<j?y-j:y-F:0;return{[u]:m[u]+$,data:{[u]:H,centerOffset:y-H-$,...Q&&{alignmentOffset:$}},reset:Q}}}),Ih=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...b}=dt(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=ut(o),w=tt(a),k=ut(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[pn(a)]:Ch(a)),O=x!=="none";!m&&O&&C.push(...zh(a,h,x,S));const N=[a,...C],I=await l.detectOverflow(t,b),D=[];let L=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&D.push(I[v]),f){const y=_h(o,s,S);D.push(I[y[0]],I[y[1]])}if(L=[...L,{placement:o,overflows:D}],!D.every(y=>y<=0)){var Z,j;const y=(((Z=i.flip)==null?void 0:Z.index)||0)+1,H=N[y];if(H&&(!(f==="alignment"?w!==tt(H):!1)||L.every(V=>tt(V.placement)===w?V.overflows[0]>0:!0)))return{data:{index:y,overflows:L},reset:{placement:H}};let Q=(j=L.filter($=>$.overflows[0]<=0).sort(($,V)=>$.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!Q)switch(u){case"bestFit":{var F;const $=(F=L.filter(V=>{if(O){const Y=tt(V.placement);return Y===w||Y==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Y=>Y>0).reduce((Y,J)=>Y+J,0)]).sort((V,Y)=>V[1]-Y[1])[0])==null?void 0:F[0];$&&(Q=$);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}};function sa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aa(e){return wh.some(t=>e[t]>=0)}const Dh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=dt(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=sa(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:aa(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=sa(s,r.floating);return{data:{escapedOffsets:a,escaped:aa(a)}}}default:return{}}}}},la=new Set(["left","top"]);async function Rh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ut(r),a=Vt(r),l=tt(r)==="y",c=la.has(s)?-1:1,d=i&&l?-1:1,f=dt(t,e);let{mainAxis:m,crossAxis:u,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(u=a==="end"?x*-1:x),l?{x:u*d,y:m*c}:{x:m*c,y:u*d}}const Mh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Rh(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Lh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:k}=v;return{x:w,y:k}}},...c}=dt(e,t),d={x:r,y:n},f=await i.detectOverflow(t,c),m=tt(ut(o)),u=zo(m);let x=d[u],h=d[m];if(s){const v=u==="y"?"top":"left",w=u==="y"?"bottom":"right",k=x+f[v],S=x-f[w];x=No(k,x,S)}if(a){const v=m==="y"?"top":"left",w=m==="y"?"bottom":"right",k=h+f[v],S=h-f[w];h=No(k,h,S)}const b=l.fn({...t,[u]:x,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[u]:s,[m]:a}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=dt(e,t),d={x:r,y:n},f=tt(o),m=zo(f);let u=d[m],x=d[f];const h=dt(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",S=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;u<S?u=S:u>C&&(u=C)}if(c){var v,w;const k=m==="y"?"width":"height",S=la.has(ut(o)),C=i.reference[f]-i.floating[k]+(S&&((v=s.offset)==null?void 0:v[f])||0)+(S?0:b.crossAxis),O=i.reference[f]+i.reference[k]+(S?0:((w=s.offset)==null?void 0:w[f])||0)-(S?b.crossAxis:0);x<C?x=C:x>O&&(x=O)}return{[m]:u,[f]:x}}}},Bh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=dt(e,t),d=await s.detectOverflow(t,c),f=ut(o),m=Vt(o),u=tt(o)==="y",{width:x,height:h}=i.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,b=m==="end"?"top":"bottom");const w=h-d.top-d.bottom,k=x-d.left-d.right,S=wt(h-d[b],w),C=wt(x-d[v],k),O=!t.middlewareData.shift;let N=S,I=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=w),O&&!m){const L=Fe(d.left,0),Z=Fe(d.right,0),j=Fe(d.top,0),F=Fe(d.bottom,0);u?I=x-2*(L!==0||Z!==0?L+Z:Fe(d.left,d.right)):N=h-2*(j!==0||F!==0?j+F:Fe(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:N});const D=await s.getDimensions(a.floating);return x!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function gn(){return typeof window<"u"}function Yt(e){return ca(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(ca(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ca(e){return gn()?e instanceof Node||e instanceof Be(e).Node:!1}function qe(e){return gn()?e instanceof Element||e instanceof Be(e).Element:!1}function nt(e){return gn()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function da(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}const Uh=new Set(["inline","contents"]);function _r(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Uh.has(o)}const Wh=new Set(["table","td","th"]);function $h(e){return Wh.has(Yt(e))}const Hh=[":popover-open",":modal"];function bn(e){return Hh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Vh=["transform","translate","scale","rotate","perspective"],Yh=["transform","translate","scale","rotate","perspective","filter"],Kh=["paint","layout","strict","content"];function Po(e){const t=Io(),r=qe(e)?Je(e):e;return Vh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Yh.some(n=>(r.willChange||"").includes(n))||Kh.some(n=>(r.contain||"").includes(n))}function Zh(e){let t=yt(e);for(;nt(t)&&!Kt(t);){if(Po(t))return t;if(bn(t))return null;t=yt(t)}return null}function Io(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gh=new Set(["html","body","#document"]);function Kt(e){return Gh.has(Yt(e))}function Je(e){return Be(e).getComputedStyle(e)}function vn(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yt(e){if(Yt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||da(e)&&e.host||rt(e);return da(t)?t.host:t}function ua(e){const t=yt(e);return Kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&&_r(t)?t:ua(t)}function Cr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ua(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Be(o);if(i){const a=Do(s);return t.concat(s,s.visualViewport||[],_r(o)?o:[],a&&r?Cr(a):[])}return t.concat(o,Cr(o,[],r))}function Do(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fa(e){const t=Je(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=nt(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=fn(r)!==i||fn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ro(e){return qe(e)?e:e.contextElement}function Zt(e){const t=Ro(e);if(!nt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=fa(t);let s=(i?fn(r.width):r.width)/n,a=(i?fn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Xh=et(0);function ha(e){const t=Be(e);return!Io()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Be(e)?!1:t}function Tt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ro(e);let s=et(1);t&&(n?qe(n)&&(s=Zt(n)):s=Zt(e));const a=qh(i,r,n)?ha(i):et(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const m=Be(i),u=n&&qe(n)?Be(n):n;let x=m,h=Do(x);for(;h&&n&&u!==x;){const b=Zt(h),v=h.getBoundingClientRect(),w=Je(h),k=v.left+(h.clientLeft+parseFloat(w.paddingLeft))*b.x,S=v.top+(h.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=k,c+=S,x=Be(h),h=Do(x)}}return mn({width:d,height:f,x:l,y:c})}function xn(e,t){const r=vn(e).scrollLeft;return t?t.left+r:Tt(rt(e)).left+r}function pa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-xn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Jh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=rt(n),a=t?bn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=et(1);const d=et(0),f=nt(n);if((f||!f&&!i)&&((Yt(n)!=="body"||_r(s))&&(l=vn(n)),nt(n))){const u=Tt(n);c=Zt(n),d.x=u.x+n.clientLeft,d.y=u.y+n.clientTop}const m=s&&!f&&!i?pa(s,l):et(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function ep(e){const t=rt(e),r=vn(e),n=e.ownerDocument.body,o=Fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+xn(e);const a=-r.scrollTop;return Je(n).direction==="rtl"&&(s+=Fe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ma=25;function tp(e,t){const r=Be(e),n=rt(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Io();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=xn(n);if(c<=0){const d=n.ownerDocument,f=d.body,m=getComputedStyle(f),u=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(n.clientWidth-f.clientWidth-u);x<=ma&&(i-=x)}else c<=ma&&(i+=c);return{width:i,height:s,x:a,y:l}}const rp=new Set(["absolute","fixed"]);function np(e,t){const r=Tt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=nt(e)?Zt(e):et(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function ga(e,t,r){let n;if(t==="viewport")n=tp(e,r);else if(t==="document")n=ep(rt(e));else if(qe(t))n=np(t,r);else{const o=ha(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mn(n)}function ba(e,t){const r=yt(e);return r===t||!qe(r)||Kt(r)?!1:Je(r).position==="fixed"||ba(r,t)}function op(e,t){const r=t.get(e);if(r)return r;let n=Cr(e,[],!1).filter(a=>qe(a)&&Yt(a)!=="body"),o=null;const i=Je(e).position==="fixed";let s=i?yt(e):e;for(;qe(s)&&!Kt(s);){const a=Je(s),l=Po(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&rp.has(o.position)||_r(s)&&!l&&ba(e,s))?n=n.filter(d=>d!==s):o=a,s=yt(s)}return t.set(e,n),n}function ip(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?bn(t)?[]:op(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const f=ga(t,d,o);return c.top=Fe(f.top,c.top),c.right=wt(f.right,c.right),c.bottom=wt(f.bottom,c.bottom),c.left=Fe(f.left,c.left),c},ga(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sp(e){const{width:t,height:r}=fa(e);return{width:t,height:r}}function ap(e,t,r){const n=nt(t),o=rt(t),i=r==="fixed",s=Tt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);function c(){l.x=xn(o)}if(n||!n&&!i)if((Yt(t)!=="body"||_r(o))&&(a=vn(t)),n){const u=Tt(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?pa(o,a):et(0),f=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:f,y:m,width:s.width,height:s.height}}function Mo(e){return Je(e).position==="static"}function va(e,t){if(!nt(e)||Je(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rt(e)===r&&(r=r.ownerDocument.body),r}function xa(e,t){const r=Be(e);if(bn(e))return r;if(!nt(e)){let o=yt(e);for(;o&&!Kt(o);){if(qe(o)&&!Mo(o))return o;o=yt(o)}return r}let n=va(e,t);for(;n&&$h(n)&&Mo(n);)n=va(n,t);return n&&Kt(n)&&Mo(n)&&!Po(n)?r:n||Zh(e)||r}const lp=async function(e){const t=this.getOffsetParent||xa,r=this.getDimensions,n=await r(e.floating);return{reference:ap(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cp(e){return Je(e).direction==="rtl"}const dp={convertOffsetParentRelativeRectToViewportRelativeRect:Jh,getDocumentElement:rt,getClippingRect:ip,getOffsetParent:xa,getElementRects:lp,getClientRects:Qh,getDimensions:sp,getScale:Zt,isElement:qe,isRTL:cp};function wa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function up(e,t){let r=null,n;const o=rt(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:f,width:m,height:u}=c;if(a||t(),!m||!u)return;const x=hn(f),h=hn(o.clientWidth-(d+m)),b=hn(o.clientHeight-(f+u)),v=hn(d),k={rootMargin:-x+"px "+-h+"px "+-b+"px "+-v+"px",threshold:Fe(0,wt(1,l))||1};let S=!0;function C(O){const N=O[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!wa(c,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,k)}r.observe(e)}return s(!0),i}function fp(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Ro(e),d=o||i?[...c?Cr(c):[],...Cr(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const f=c&&a?up(c,r):null;let m=-1,u=null;s&&(u=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=u)==null||k.observe(t)})),r()}),c&&!l&&u.observe(c),u.observe(t));let x,h=l?Tt(e):null;l&&b();function b(){const v=Tt(e);h&&!wa(h,v)&&r(),h=v,x=requestAnimationFrame(b)}return r(),()=>{var v;d.forEach(w=>{o&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),f==null||f(),(v=u)==null||v.disconnect(),u=null,l&&cancelAnimationFrame(x)}}const hp=Mh,pp=Lh,mp=Ih,gp=Bh,bp=Dh,ya=Ph,vp=Fh,xp=(e,t,r)=>{const n=new Map,o={platform:dp,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var wp=typeof document<"u",yp=function(){},wn=wp?T.useLayoutEffect:yp;function yn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!yn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!yn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ka(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sa(e,t){const r=ka(e);return Math.round(t*r)/r}function Lo(e){const t=_.useRef(e);return wn(()=>{t.current=e}),t}function kp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,u]=_.useState(n);yn(m,n)||u(n);const[x,h]=_.useState(null),[b,v]=_.useState(null),w=_.useCallback(V=>{V!==O.current&&(O.current=V,h(V))},[]),k=_.useCallback(V=>{V!==N.current&&(N.current=V,v(V))},[]),S=i||x,C=s||b,O=_.useRef(null),N=_.useRef(null),I=_.useRef(d),D=l!=null,L=Lo(l),Z=Lo(o),j=Lo(c),F=_.useCallback(()=>{if(!O.current||!N.current)return;const V={placement:t,strategy:r,middleware:m};Z.current&&(V.platform=Z.current),xp(O.current,N.current,V).then(Y=>{const J={...Y,isPositioned:j.current!==!1};y.current&&!yn(I.current,J)&&(I.current=J,Mr.flushSync(()=>{f(J)}))})},[m,t,r,Z,j]);wn(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(V=>({...V,isPositioned:!1})))},[c]);const y=_.useRef(!1);wn(()=>(y.current=!0,()=>{y.current=!1}),[]),wn(()=>{if(S&&(O.current=S),C&&(N.current=C),S&&C){if(L.current)return L.current(S,C,F);F()}},[S,C,F,L,D]);const H=_.useMemo(()=>({reference:O,floating:N,setReference:w,setFloating:k}),[w,k]),Q=_.useMemo(()=>({reference:S,floating:C}),[S,C]),$=_.useMemo(()=>{const V={position:r,left:0,top:0};if(!Q.floating)return V;const Y=Sa(Q.floating,d.x),J=Sa(Q.floating,d.y);return a?{...V,transform:"translate("+Y+"px, "+J+"px)",...ka(Q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Y,top:J}},[r,a,Q.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:F,refs:H,elements:Q,floatingStyles:$}),[d,F,H,Q,$])}const Sp=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ya({element:n.current,padding:o}).fn(r):{}:n?ya({element:n,padding:o}).fn(r):{}}}},_p=(e,t)=>({...hp(e),options:[e,t]}),Cp=(e,t)=>({...pp(e),options:[e,t]}),Ep=(e,t)=>({...vp(e),options:[e,t]}),Ap=(e,t)=>({...mp(e),options:[e,t]}),Np=(e,t)=>({...gp(e),options:[e,t]}),zp=(e,t)=>({...bp(e),options:[e,t]}),jp=(e,t)=>({...Sp(e),options:[e,t]});var Tp="Arrow",_a=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(Se.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});_a.displayName=Tp;var Op=_a;function Pp(e){const[t,r]=_.useState(void 0);return Ie(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Fo="Popper",[Ca,Gt]=$t(Fo),[Ip,Ea]=Ca(Fo),Aa=e=>{const{__scopePopper:t,children:r}=e,[n,o]=_.useState(null);return p.jsx(Ip,{scope:t,anchor:n,onAnchorChange:o,children:r})};Aa.displayName=Fo;var Na="PopperAnchor",za=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ea(Na,r),s=_.useRef(null),a=_e(t,s),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||s.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:p.jsx(Se.div,{...o,ref:a})});za.displayName=Na;var Bo="PopperContent",[Dp,Rp]=Ca(Bo),ja=_.forwardRef((e,t)=>{var ee,ie,se,oe,le,fe;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:u="optimized",onPlaced:x,...h}=e,b=Ea(Bo,r),[v,w]=_.useState(null),k=_e(t,xe=>w(xe)),[S,C]=_.useState(null),O=Pp(S),N=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,D=n+(i!=="center"?"-"+i:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Z=Array.isArray(c)?c:[c],j=Z.length>0,F={padding:L,boundary:Z.filter(Lp),altBoundary:j},{refs:y,floatingStyles:H,placement:Q,isPositioned:$,middlewareData:V}=kp({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>fp(...xe,{animationFrame:u==="always"}),elements:{reference:b.anchor},middleware:[_p({mainAxis:o+I,alignmentAxis:s}),l&&Cp({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ep():void 0,...F}),l&&Ap({...F}),Np({...F,apply:({elements:xe,rects:g,availableWidth:B,availableHeight:W})=>{const{width:E,height:A}=g.reference,R=xe.floating.style;R.setProperty("--radix-popper-available-width",`${B}px`),R.setProperty("--radix-popper-available-height",`${W}px`),R.setProperty("--radix-popper-anchor-width",`${E}px`),R.setProperty("--radix-popper-anchor-height",`${A}px`)}}),S&&jp({element:S,padding:a}),Fp({arrowWidth:N,arrowHeight:I}),m&&zp({strategy:"referenceHidden",...F})]}),[Y,J]=Pa(Q),z=Le(x);Ie(()=>{$&&(z==null||z())},[$,z]);const P=(ee=V.arrow)==null?void 0:ee.x,K=(ie=V.arrow)==null?void 0:ie.y,G=((se=V.arrow)==null?void 0:se.centerOffset)!==0,[te,ue]=_.useState();return Ie(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),p.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:$?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(oe=V.transformOrigin)==null?void 0:oe.x,(le=V.transformOrigin)==null?void 0:le.y].join(" "),...((fe=V.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Dp,{scope:r,placedSide:Y,onArrowChange:C,arrowX:P,arrowY:K,shouldHideArrow:G,children:p.jsx(Se.div,{"data-side":Y,"data-align":J,...h,ref:k,style:{...h.style,animation:$?void 0:"none"}})})})});ja.displayName=Bo;var Ta="PopperArrow",Mp={top:"bottom",right:"left",bottom:"top",left:"right"},Oa=_.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Rp(Ta,n),s=Mp[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Op,{...o,ref:r,style:{...o.style,display:"block"}})})});Oa.displayName=Ta;function Lp(e){return e!==null}var Fp=e=>({name:"transformOrigin",options:e,fn(t){var b,v,w;const{placement:r,rects:n,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Pa(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,u=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",h="";return c==="bottom"?(x=s?f:`${m}px`,h=`${-l}px`):c==="top"?(x=s?f:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(x=`${-l}px`,h=s?f:`${u}px`):c==="left"&&(x=`${n.floating.width+l}px`,h=s?f:`${u}px`),{data:{x,y:h}}}});function Pa(e){const[t,r="center"]=e.split("-");return[t,r]}var Uo=Aa,kn=za,Wo=ja,$o=Oa,Bp="Portal",Sn=_.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=_.useState(!1);Ie(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?pt.createPortal(p.jsx(Se.div,{...n,ref:t}),s):null});Sn.displayName=Bp;var Up=_[" useInsertionEffect ".trim().toString()]||Ie;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wp({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=_.useRef(e!==void 0);_.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const c=_.useCallback(d=>{var f;if(a){const m=$p(d)?d(e):d;m!==e&&((f=s.current)==null||f.call(s,m))}else i(d)},[a,e,i,s]);return[l,c]}function Wp({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),o=_.useRef(r),i=_.useRef(t);return Up(()=>{i.current=t},[t]),_.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function $p(e){return typeof e=="function"}function Hp(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ia=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Vp="VisuallyHidden",Da=_.forwardRef((e,t)=>p.jsx(Se.span,{...e,ref:t,style:{...Ia,...e.style}}));Da.displayName=Vp;var Yp=Da,Kp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xt=new WeakMap,Cn=new WeakMap,En={},Ho=0,Ra=function(e){return e&&(e.host||Ra(e.parentNode))},Zp=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ra(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Gp=function(e,t,r,n){var o=Zp(t,Array.isArray(e)?e:[e]);En[r]||(En[r]=new WeakMap);var i=En[r],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))d(m);else try{var u=m.getAttribute(n),x=u!==null&&u!=="false",h=(Xt.get(m)||0)+1,b=(i.get(m)||0)+1;Xt.set(m,h),i.set(m,b),s.push(m),h===1&&x&&Cn.set(m,!0),b===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return d(t),a.clear(),Ho++,function(){s.forEach(function(f){var m=Xt.get(f)-1,u=i.get(f)-1;Xt.set(f,m),i.set(f,u),m||(Cn.has(f)||f.removeAttribute(n),Cn.delete(f)),u||f.removeAttribute(r)}),Ho--,Ho||(Xt=new WeakMap,Xt=new WeakMap,Cn=new WeakMap,En={})}},Ma=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Kp(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gp(n,o,r,"aria-hidden")):function(){return null}},ot=function(){return ot=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ot.apply(this,arguments)};function La(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xp(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var An="right-scroll-bar-position",Nn="width-before-scroll-bar",qp="with-scroll-bars-hidden",Jp="--removed-body-scroll-bar-size";function Vo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qp(e,t){var r=T.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var em=typeof window<"u"?_.useLayoutEffect:_.useEffect,Fa=new WeakMap;function tm(e,t){var r=Qp(null,function(n){return e.forEach(function(o){return Vo(o,n)})});return em(function(){var n=Fa.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Vo(a,null)}),i.forEach(function(a){o.has(a)||Vo(a,s)})}Fa.set(r,e)},[e]),r}function rm(e){return e}function nm(e,t){t===void 0&&(t=rm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),r}}}};return o}function om(e){e===void 0&&(e={});var t=nm(null);return t.options=ot({async:!0,ssr:!1},e),t}var Ba=function(e){var t=e.sideCar,r=La(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return _.createElement(n,ot({},r))};Ba.isSideCarExport=!0;function im(e,t){return e.useMedium(t),Ba}var Ua=om(),Yo=function(){},zn=_.forwardRef(function(e,t){var r=_.useRef(null),n=_.useState({onScrollCapture:Yo,onWheelCapture:Yo,onTouchMoveCapture:Yo}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,u=e.noRelative,x=e.noIsolation,h=e.inert,b=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,k=e.gapMode,S=La(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,O=tm([r,t]),N=ot(ot({},S),o);return _.createElement(_.Fragment,null,d&&_.createElement(C,{sideCar:Ua,removeScrollBar:c,shards:f,noRelative:u,noIsolation:x,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?_.cloneElement(_.Children.only(a),ot(ot({},N),{ref:O})):_.createElement(w,ot({},N,{className:l,ref:O}),a))});zn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},zn.classNames={fullWidth:Nn,zeroRight:An};var sm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function am(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=sm();return t&&e.setAttribute("nonce",t),e}function lm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=am())&&(lm(t,r),cm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},um=function(){var e=dm();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Wa=function(){var e=um(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},fm={left:0,top:0,right:0,gap:0},Ko=function(e){return parseInt(e||"",10)||0},hm=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ko(r),Ko(n),Ko(o)]},pm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fm;var t=hm(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},mm=Wa(),qt="data-scroll-locked",gm=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
213
|
-
.`.concat(
|
|
212
|
+
`},pu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function mu(e){let{announcements:t=pu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=hu}=e;const{announce:i,announcement:s}=du(),a=gr("DndLiveRegion"),[l,c]=j.useState(!1);if(j.useEffect(()=>{c(!0)},[]),uu(j.useMemo(()=>({onDragStart(u){let{active:m}=u;i(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:f}=u;t.onDragMove&&i(t.onDragMove({active:m,over:f}))},onDragOver(u){let{active:m,over:f}=u;i(t.onDragOver({active:m,over:f}))},onDragEnd(u){let{active:m,over:f}=u;i(t.onDragEnd({active:m,over:f}))},onDragCancel(u){let{active:m,over:f}=u;i(t.onDragCancel({active:m,over:f}))}}),[i,t])),!l)return null;const d=j.createElement(j.Fragment,null,j.createElement(lu,{id:n,value:o.draggable}),j.createElement(cu,{id:a,announcement:s}));return r?ht.createPortal(d,r):d}var Oe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Oe||(Oe={}));function en(){}function lo(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Xe=Object.freeze({x:0,y:0});function os(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bu(e,t){const r=Qr(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function is(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function vu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ss(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function as(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ls(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const wu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ls(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=os(ls(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(is)},xu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ss(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ss(l),d=o.reduce((m,f,v)=>m+os(c[v],f),0),u=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(is)};function yu(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,c=e.width*e.height,d=s*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const ku=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=yu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(vu)};function _u(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function cs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xe}function Su(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const Cu=Su(1);function ds(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Eu(e,t,r){const n=ds(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),c=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const Nu={ignoreTransform:!1};function Ut(e,t){t===void 0&&(t=Nu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Le(e).getComputedStyle(e);c&&(r=Eu(r,c,d))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function us(e){return Ut(e,{ignoreTransform:!0})}function Au(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function zu(e,t){return t===void 0&&(t=Le(e).getComputedStyle(e)),t.position==="fixed"}function ju(e,t){t===void 0&&(t=Le(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function tn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(so(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!hr(o)||es(o)||r.includes(o))return r;const i=Le(e).getComputedStyle(o);return o!==e&&ju(o,i)&&r.push(o),zu(o,i)?r:n(o.parentNode)}return e?n(e):r}function fs(e){const[t]=tn(e,1);return t??null}function co(e){return!Gr||!e?null:Mt(e)?e:io(e)?so(e)||e===Ft(e).scrollingElement?window:hr(e)?e:null:null}function hs(e){return Mt(e)?e.scrollX:e.scrollLeft}function ps(e){return Mt(e)?e.scrollY:e.scrollTop}function uo(e){return{x:hs(e),y:ps(e)}}var Pe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pe||(Pe={}));function ms(e){return!Gr||!e?!1:e===document.scrollingElement}function gs(e){const t={x:0,y:0},r=ms(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Tu={x:.2,y:.2};function Ou(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Tu);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=gs(e),f={x:0,y:0},v={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(f.y=Pe.Backward,v.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(f.y=Pe.Forward,v.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(f.x=Pe.Forward,v.x=n*Math.abs((t.right-h.width-a)/h.width)):!u&&s<=t.left+h.width&&(f.x=Pe.Backward,v.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:f,speed:v}}function Pu(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function bs(e){return e.reduce((t,r)=>Bt(t,uo(r)),Xe)}function Iu(e){return e.reduce((t,r)=>t+hs(r),0)}function Du(e){return e.reduce((t,r)=>t+ps(r),0)}function vs(e,t){if(t===void 0&&(t=Ut),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);fs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ru=[["x",["left","right"],Iu],["y",["top","bottom"],Du]];class fo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=tn(r),o=bs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Ru)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(n),d=o[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Lu(e){const{EventTarget:t}=Le(e);return e instanceof t?e:Ft(e)}function ho(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ve;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ve||(Ve={}));function ws(e){e.preventDefault()}function Mu(e){e.stopPropagation()}var we;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(we||(we={}));const xs={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},Fu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case we.Right:return{...r,x:r.x+25};case we.Left:return{...r,x:r.x-25};case we.Down:return{...r,y:r.y+25};case we.Up:return{...r,y:r.y-25}}};class po{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new vr(Ft(r)),this.windowListeners=new vr(Le(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ve.Resize,this.handleCancel),this.windowListeners.add(Ve.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ve.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&vs(n),r(Xe)}handleKeyDown(t){if(Jr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=xs,coordinateGetter:s=Fu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:Xe;this.referenceCoordinates||(this.referenceCoordinates=d);const u=s(t,{active:r,context:n.current,currentCoordinates:d});if(u){const m=br(u,d),f={x:0,y:0},{scrollableAncestors:v}=n.current;for(const h of v){const b=t.code,{isTop:g,isRight:x,isLeft:k,isBottom:_,maxScroll:C,minScroll:I}=gs(h),A=Pu(h),D={x:Math.min(b===we.Right?A.right-A.width/2:A.right,Math.max(b===we.Right?A.left:A.left+A.width/2,u.x)),y:Math.min(b===we.Down?A.bottom-A.height/2:A.bottom,Math.max(b===we.Down?A.top:A.top+A.height/2,u.y))},R=b===we.Right&&!x||b===we.Left&&!k,F=b===we.Down&&!_||b===we.Up&&!g;if(R&&D.x!==u.x){const Y=h.scrollLeft+m.x,N=b===we.Right&&Y<=C.x||b===we.Left&&Y>=I.x;if(N&&!m.y){h.scrollTo({left:Y,behavior:a});return}N?f.x=h.scrollLeft-Y:f.x=b===we.Right?h.scrollLeft-C.x:h.scrollLeft-I.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(F&&D.y!==u.y){const Y=h.scrollTop+m.y,N=b===we.Down&&Y<=C.y||b===we.Up&&Y>=I.y;if(N&&!m.x){h.scrollTo({top:Y,behavior:a});return}N?f.y=h.scrollTop-Y:f.y=b===we.Down?h.scrollTop-C.y:h.scrollTop-I.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Bt(br(u,this.referenceCoordinates),f))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}po.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=xs,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function ys(e){return!!(e&&"distance"in e)}function ks(e){return!!(e&&"delay"in e)}class mo{constructor(t,r,n){var o;n===void 0&&(n=Lu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Ft(s),this.documentListeners=new vr(this.document),this.listeners=new vr(n),this.windowListeners=new vr(Le(s)),this.initialCoordinates=(o=Qr(i))!=null?o:Xe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ve.Resize,this.handleCancel),this.windowListeners.add(Ve.DragStart,ws),this.windowListeners.add(Ve.VisibilityChange,this.handleCancel),this.windowListeners.add(Ve.ContextMenu,ws),this.documentListeners.add(Ve.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ks(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ys(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ve.Click,Mu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ve.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=Qr(t))!=null?r:Xe,c=br(o,l);if(!n&&a){if(ys(a)){if(a.tolerance!=null&&ho(c,a.tolerance))return this.handleCancel();if(ho(c,a.distance))return this.handleStart()}if(ks(a)&&ho(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Bu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class go extends mo{constructor(t){const{event:r}=t,n=Ft(r.target);super(t,Bu,n)}}go.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Uu={move:{name:"mousemove"},end:{name:"mouseup"}};var bo;(function(e){e[e.RightClick=2]="RightClick"})(bo||(bo={}));class Wu extends mo{constructor(t){super(t,Uu,Ft(t.event.target))}}Wu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===bo.RightClick?!1:(n==null||n({event:r}),!0)}}];const vo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _s extends mo{constructor(t){super(t,vo)}static setup(){return window.addEventListener(vo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(vo.move.name,t)};function t(){}}}_s.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var wr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wr||(wr={}));var rn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rn||(rn={}));function $u(e){let{acceleration:t,activator:r=wr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=rn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e;const f=Vu({delta:u,disabled:!i}),[v,h]=nu(),b=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),x=j.useMemo(()=>{switch(r){case wr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case wr.DraggableRect:return o}},[r,o,l]),k=j.useRef(null),_=j.useCallback(()=>{const I=k.current;if(!I)return;const A=b.current.x*g.current.x,D=b.current.y*g.current.y;I.scrollBy(A,D)},[]),C=j.useMemo(()=>a===rn.TreeOrder?[...c].reverse():c,[a,c]);j.useEffect(()=>{if(!i||!c.length||!x){h();return}for(const I of C){if((n==null?void 0:n(I))===!1)continue;const A=c.indexOf(I),D=d[A];if(!D)continue;const{direction:R,speed:F}=Ou(I,D,x,t,m);for(const Y of["x","y"])f[Y][R[Y]]||(F[Y]=0,R[Y]=0);if(F.x>0||F.y>0){h(),k.current=I,v(_,s),b.current=F,g.current=R;return}}b.current={x:0,y:0},g.current={x:0,y:0},h()},[t,_,n,h,i,s,JSON.stringify(x),JSON.stringify(f),v,c,C,d,JSON.stringify(m)])}const Hu={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Vu(e){let{delta:t,disabled:r}=e;const n=qr(t);return mr(o=>{if(r||!n||!o)return Hu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Pe.Backward]:o.x[Pe.Backward]||i.x===-1,[Pe.Forward]:o.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:o.y[Pe.Backward]||i.y===-1,[Pe.Forward]:o.y[Pe.Forward]||i.y===1}}},[r,t,n])}function Yu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return mr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Zu(e,t){return j.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var xr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(xr||(xr={}));var wo;(function(e){e.Optimized="optimized"})(wo||(wo={}));const Ss=new Map;function Gu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=j.useState(null),{frequency:a,measure:l,strategy:c}=o,d=j.useRef(e),u=b(),m=pr(u),f=j.useCallback(function(g){g===void 0&&(g=[]),!m.current&&s(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[m]),v=j.useRef(null),h=mr(g=>{if(u&&!r)return Ss;if(!g||g===Ss||d.current!==e||i!=null){const x=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const _=k.node.current,C=_?new fo(l(_),_):null;k.rect.current=C,C&&x.set(k.id,C)}return x}return g},[e,i,r,u,l]);return j.useEffect(()=>{d.current=e},[e]),j.useEffect(()=>{u||f()},[r,u]),j.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),j.useEffect(()=>{u||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{f(),v.current=null},a))},[a,u,f,...n]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:i!=null};function b(){switch(c){case xr.Always:return!1;case xr.BeforeDragging:return r;default:return!r}}}function xo(e,t){return mr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Ku(e,t){return xo(e,t)}function Xu(e){let{callback:t,disabled:r}=e;const n=Kr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function nn(e){let{callback:t,disabled:r}=e;const n=Kr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function qu(e){return new fo(Ut(e),e)}function Cs(e,t,r){t===void 0&&(t=qu);const[n,o]=j.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=Xu({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=nn({callback:i});return Ke(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function Ju(e){const t=xo(e);return cs(e,t)}const Es=[];function Qu(e){const t=j.useRef(e),r=mr(n=>e?n&&n!==Es&&e&&t.current&&e.parentNode===t.current.parentNode?n:tn(e):Es,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function ef(e){const[t,r]=j.useState(null),n=j.useRef(e),o=j.useCallback(i=>{const s=co(i.target);s&&r(a=>a?(a.set(s,uo(s)),new Map(a)):null)},[]);return j.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=co(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,uo(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=co(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Bt(i,s),Xe):bs(e):Xe,[e,t])}function Ns(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==Xe;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?br(e,r.current):Xe}function tf(e){j.useEffect(()=>{if(!Gr)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function rf(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function As(e){return j.useMemo(()=>e?Au(e):null,[e])}const zs=[];function nf(e,t){t===void 0&&(t=Ut);const[r]=e,n=As(r?Le(r):null),[o,i]=j.useState(zs);function s(){i(()=>e.length?e.map(l=>ms(l)?n:new fo(t(l),l)):zs)}const a=nn({callback:s});return Ke(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function js(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hr(t)?t:e}function of(e){let{measure:t}=e;const[r,n]=j.useState(null),o=j.useCallback(c=>{for(const{target:d}of c)if(hr(d)){n(u=>{const m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=nn({callback:o}),s=j.useCallback(c=>{const d=js(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=Xr(s);return j.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const sf=[{sensor:go,options:{}},{sensor:po,options:{}}],af={current:{}},on={draggable:{measure:us},droppable:{measure:us,strategy:xr.WhileDragging,frequency:wo.Optimized},dragOverlay:{measure:Ut}};class yr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const lf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new yr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:en},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:on,measureDroppableContainers:en,windowRect:null,measuringScheduled:!1},Ts={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:en,draggableNodes:new Map,over:null,measureDroppableContainers:en},kr=j.createContext(Ts),Os=j.createContext(lf);function cf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yr}}}function df(e,t){switch(t.type){case Oe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Oe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Oe.DragEnd:case Oe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Oe.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new yr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Oe.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new yr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Oe.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new yr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function uf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=j.useContext(kr),i=qr(n),s=qr(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!Jr(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=su(d);if(u){u.focus();break}}})}},[n,t,o,s,i]),null}function Ps(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function ff(e){return j.useMemo(()=>({draggable:{...on.draggable,...e==null?void 0:e.draggable},droppable:{...on.droppable,...e==null?void 0:e.droppable},dragOverlay:{...on.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function hf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=j.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ke(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=r(c),u=cs(d,n);if(s||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=fs(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,s,a,n,r])}const sn=j.createContext({...Xe,scaleX:1,scaleY:1});var bt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(bt||(bt={}));const pf=j.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=sf,collisionDetection:u=ku,measuring:m,modifiers:f,...v}=t;const h=j.useReducer(df,void 0,cf),[b,g]=h,[x,k]=fu(),[_,C]=j.useState(bt.Uninitialized),I=_===bt.Initialized,{draggable:{active:A,nodes:D,translate:R},droppable:{containers:F}}=b,Y=A!=null?D.get(A):null,N=j.useRef({initial:null,translated:null}),M=j.useMemo(()=>{var Ne;return A!=null?{id:A,data:(Ne=Y==null?void 0:Y.data)!=null?Ne:af,rect:N}:null},[A,Y]),y=j.useRef(null),[B,te]=j.useState(null),[U,$]=j.useState(null),Z=pr(v,Object.values(v)),ne=gr("DndDescribedBy",s),z=j.useMemo(()=>F.getEnabled(),[F]),L=ff(m),{droppableRects:K,measureDroppableContainers:q,measuringScheduled:ee}=Gu(z,{dragging:I,dependencies:[R.x,R.y],config:L.droppable}),ue=Yu(D,A),re=j.useMemo(()=>U?Qr(U):null,[U]),ie=Gn(),ae=Ku(ue,L.draggable.measure);hf({activeNode:A!=null?D.get(A):null,config:ie.layoutShiftCompensation,initialRect:ae,measure:L.draggable.measure});const oe=Cs(ue,L.draggable.measure,ae),le=Cs(ue?ue.parentElement:null),fe=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=F.getNodeFor((r=fe.current.over)==null?void 0:r.id),w=of({measure:L.dragOverlay.measure}),X=(n=w.nodeRef.current)!=null?n:ue,H=I?(o=w.rect)!=null?o:oe:null,T=!!(w.nodeRef.current&&w.rect),S=Ju(T?null:oe),P=As(X?Le(X):null),W=Qu(I?ve??ue:null),G=nf(W),O=Ps(f,{transform:{x:R.x-S.x,y:R.y-S.y,scaleX:1,scaleY:1},activatorEvent:U,active:M,activeNodeRect:oe,containerNodeRect:le,draggingNodeRect:H,over:fe.current.over,overlayNodeRect:w.rect,scrollableAncestors:W,scrollableAncestorRects:G,windowRect:P}),V=re?Bt(re,R):null,J=ef(W),Q=Ns(J),se=Ns(J,[oe]),pe=Bt(O,Q),he=H?Cu(H,O):null,Ae=M&&he?u({active:M,collisionRect:he,droppableRects:K,droppableContainers:z,pointerCoordinates:V}):null,Se=as(Ae,"id"),[ze,St]=j.useState(null),Ee=T?O:Bt(O,se),sr=_u(Ee,(i=ze==null?void 0:ze.rect)!=null?i:null,oe),Pt=j.useRef(null),Ze=j.useCallback((Ne,Ie)=>{let{sensor:We,options:Ct}=Ie;if(y.current==null)return;const Ge=D.get(y.current);if(!Ge)return;const $e=Ne.nativeEvent,st=new We({active:y.current,activeNode:Ge,event:$e,options:Ct,context:fe,onAbort(Re){if(!D.get(Re))return;const{onDragAbort:at}=Z.current,ft={id:Re};at==null||at(ft),x({type:"onDragAbort",event:ft})},onPending(Re,Et,at,ft){if(!D.get(Re))return;const{onDragPending:Ir}=Z.current,Nt={id:Re,constraint:Et,initialCoordinates:at,offset:ft};Ir==null||Ir(Nt),x({type:"onDragPending",event:Nt})},onStart(Re){const Et=y.current;if(Et==null)return;const at=D.get(Et);if(!at)return;const{onDragStart:ft}=Z.current,Pr={activatorEvent:$e,active:{id:Et,data:at.data,rect:N}};ht.unstable_batchedUpdates(()=>{ft==null||ft(Pr),C(bt.Initializing),g({type:Oe.DragStart,initialCoordinates:Re,active:Et}),x({type:"onDragStart",event:Pr}),te(Pt.current),$($e)})},onMove(Re){g({type:Oe.DragMove,coordinates:Re})},onEnd:ar(Oe.DragEnd),onCancel:ar(Oe.DragCancel)});Pt.current=st;function ar(Re){return async function(){const{active:at,collisions:ft,over:Pr,scrollAdjustedTranslate:Ir}=fe.current;let Nt=null;if(at&&Ir){const{cancelDrop:Dr}=Z.current;Nt={activatorEvent:$e,active:at,collisions:ft,delta:Ir,over:Pr},Re===Oe.DragEnd&&typeof Dr=="function"&&await Promise.resolve(Dr(Nt))&&(Re=Oe.DragCancel)}y.current=null,ht.unstable_batchedUpdates(()=>{g({type:Re}),C(bt.Uninitialized),St(null),te(null),$(null),Pt.current=null;const Dr=Re===Oe.DragEnd?"onDragEnd":"onDragCancel";if(Nt){const bi=Z.current[Dr];bi==null||bi(Nt),x({type:Dr,event:Nt})}})}}},[D]),Yn=j.useCallback((Ne,Ie)=>(We,Ct)=>{const Ge=We.nativeEvent,$e=D.get(Ct);if(y.current!==null||!$e||Ge.dndKit||Ge.defaultPrevented)return;const st={active:$e};Ne(We,Ie.options,st)===!0&&(Ge.dndKit={capturedBy:Ie.sensor},y.current=Ct,Ze(We,Ie))},[D,Ze]),Zn=Zu(d,Yn);tf(d),Ke(()=>{oe&&_===bt.Initializing&&C(bt.Initialized)},[oe,_]),j.useEffect(()=>{const{onDragMove:Ne}=Z.current,{active:Ie,activatorEvent:We,collisions:Ct,over:Ge}=fe.current;if(!Ie||!We)return;const $e={active:Ie,activatorEvent:We,collisions:Ct,delta:{x:pe.x,y:pe.y},over:Ge};ht.unstable_batchedUpdates(()=>{Ne==null||Ne($e),x({type:"onDragMove",event:$e})})},[pe.x,pe.y]),j.useEffect(()=>{const{active:Ne,activatorEvent:Ie,collisions:We,droppableContainers:Ct,scrollAdjustedTranslate:Ge}=fe.current;if(!Ne||y.current==null||!Ie||!Ge)return;const{onDragOver:$e}=Z.current,st=Ct.get(Se),ar=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Re={active:Ne,activatorEvent:Ie,collisions:We,delta:{x:Ge.x,y:Ge.y},over:ar};ht.unstable_batchedUpdates(()=>{St(ar),$e==null||$e(Re),x({type:"onDragOver",event:Re})})},[Se]),Ke(()=>{fe.current={activatorEvent:U,active:M,activeNode:ue,collisionRect:he,collisions:Ae,droppableRects:K,draggableNodes:D,draggingNode:X,draggingNodeRect:H,droppableContainers:F,over:ze,scrollableAncestors:W,scrollAdjustedTranslate:pe},N.current={initial:H,translated:he}},[M,ue,Ae,he,D,X,H,K,F,ze,W,pe]),$u({...ie,delta:R,draggingRect:he,pointerCoordinates:V,scrollableAncestors:W,scrollableAncestorRects:G});const mi=j.useMemo(()=>({active:M,activeNode:ue,activeNodeRect:oe,activatorEvent:U,collisions:Ae,containerNodeRect:le,dragOverlay:w,draggableNodes:D,droppableContainers:F,droppableRects:K,over:ze,measureDroppableContainers:q,scrollableAncestors:W,scrollableAncestorRects:G,measuringConfiguration:L,measuringScheduled:ee,windowRect:P}),[M,ue,oe,U,Ae,le,w,D,F,K,ze,q,W,G,L,ee,P]),gi=j.useMemo(()=>({activatorEvent:U,activators:Zn,active:M,activeNodeRect:oe,ariaDescribedById:{draggable:ne},dispatch:g,draggableNodes:D,over:ze,measureDroppableContainers:q}),[U,Zn,M,oe,g,ne,D,ze,q]);return j.createElement(ns.Provider,{value:k},j.createElement(kr.Provider,{value:gi},j.createElement(Os.Provider,{value:mi},j.createElement(sn.Provider,{value:sr},c)),j.createElement(uf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),j.createElement(mu,{...a,hiddenTextDescribedById:ne}));function Gn(){const Ne=(B==null?void 0:B.autoScrollEnabled)===!1,Ie=typeof l=="object"?l.enabled===!1:l===!1,We=I&&!Ne&&!Ie;return typeof l=="object"?{...l,enabled:We}:{enabled:We}}}),mf=j.createContext(null),Is="button",gf="Draggable";function bf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=gr(gf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=j.useContext(kr),{role:f=Is,roleDescription:v="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,g=j.useContext(b?sn:mf),[x,k]=Xr(),[_,C]=Xr(),I=rf(s,t),A=pr(r);Ke(()=>(u.set(t,{id:t,key:i,node:x,activatorNode:_,data:A}),()=>{const R=u.get(t);R&&R.key===i&&u.delete(t)}),[u,t]);const D=j.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&f===Is?!0:void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[n,f,h,b,v,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:D,isDragging:b,listeners:n?void 0:I,node:x,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Ds(){return j.useContext(Os)}const vf="Droppable",wf={timeout:25};function xf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=gr(vf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=j.useContext(kr),d=j.useRef({disabled:r}),u=j.useRef(!1),m=j.useRef(null),f=j.useRef(null),{disabled:v,updateMeasurementsFor:h,timeout:b}={...wf,...o},g=pr(h??n),x=j.useCallback(()=>{if(!u.current){u.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),f.current=null},b)},[b]),k=nn({callback:x,disabled:v||!s}),_=j.useCallback((D,R)=>{k&&(R&&(k.unobserve(R),u.current=!1),D&&k.observe(D))},[k]),[C,I]=Xr(_),A=pr(t);return j.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),j.useEffect(()=>(a({type:Oe.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:A}}),()=>a({type:Oe.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==d.current.disabled&&(a({type:Oe.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:s,rect:m,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:I}}function yf(e){let{animation:t,children:r}=e;const[n,o]=j.useState(null),[i,s]=j.useState(null),a=qr(r);return!r&&!n&&a&&o(a),Ke(()=>{if(!i)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,n,i]),j.createElement(j.Fragment,null,r,n?j.cloneElement(n,{ref:s}):null)}const kf={x:0,y:0,scaleX:1,scaleY:1};function _f(e){let{children:t}=e;return j.createElement(kr.Provider,{value:Ts},j.createElement(sn.Provider,{value:kf},t))}const Sf={position:"fixed",touchAction:"none"},Cf=e=>Jr(e)?"transform 250ms ease":void 0,Ef=j.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Cf}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},m={...Sf,width:a.width,height:a.height,top:a.top,left:a.left,transform:gt.Transform.toString(u),transformOrigin:o&&n?bu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return j.createElement(r,{className:s,style:m,ref:t},i)}),Nf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:gt.Transform.toString(t)},{transform:gt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))r.node.style.setProperty(l,c);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Af(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Kr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=js(s);if(!c)return;const{transform:d}=Le(s).getComputedStyle(s),u=ds(d);if(!u)return;const m=typeof t=="function"?t:zf(t);return vs(l,o.draggable.measure),m({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:u})})}function zf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Nf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},u={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},m={x:l.x-d.x,y:l.y-d.y,...u},f=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:m}}),[v]=f,h=f[f.length-1];if(JSON.stringify(v)===JSON.stringify(h))return;const b=n==null?void 0:n({active:s,dragOverlay:a,...c}),g=a.node.animate(f,{duration:t,easing:r,fill:"forwards"});return new Promise(x=>{g.onfinish=()=>{b==null||b(),x()}})}}let Rs=0;function jf(e){return j.useMemo(()=>{if(e!=null)return Rs++,Rs},[e])}const Tf=j.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggableNodes:v,droppableContainers:h,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:_,windowRect:C}=Ds(),I=j.useContext(sn),A=jf(u==null?void 0:u.id),D=Ps(s,{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:_,transform:I,windowRect:C}),R=xo(m),F=Af({config:n,draggableNodes:v,droppableContainers:h,measuringConfiguration:x}),Y=R?b.setRef:void 0;return j.createElement(_f,null,j.createElement(yf,{animation:F},u&&A?j.createElement(Ef,{key:A,id:u.id,ref:Y,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:R,style:{zIndex:c,...o},transform:D},r):null))}),Of=e=>{let{transform:t}=e;return{...t,x:0}};function Ls(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Pf(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function an(e){return e!==null&&e>=0}function If(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Df(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ms=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ls(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},ln={scaleX:1,scaleY:1},Rf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const c=i[s];return c?{x:0,y:r<s?c.top+c.height-(a.top+a.height):c.top-a.top,...ln}:null}const l=Lf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...ln}:o<r&&o>=s?{x:0,y:a.height+l,...ln}:{x:0,y:0,...ln}};function Lf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Fs="Sortable",Bs=j.createContext({activeIndex:-1,containerId:Fs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ms,disabled:{draggable:!1,droppable:!1}});function Mf(e){let{children:t,id:r,items:n,strategy:o=Ms,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Ds(),u=gr(Fs,r),m=a.rect!==null,f=j.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),v=s!=null,h=s?f.indexOf(s.id):-1,b=c?f.indexOf(c.id):-1,g=j.useRef(f),x=!If(f,g.current),k=b!==-1&&h===-1||x,_=Df(i);Ke(()=>{x&&v&&d(f)},[x,f,v,d]),j.useEffect(()=>{g.current=f},[f]);const C=j.useMemo(()=>({activeIndex:h,containerId:u,disabled:_,disableTransforms:k,items:f,overIndex:b,useDragOverlay:m,sortedRects:Pf(f,l),strategy:o}),[h,u,_.draggable,_.droppable,k,f,b,l,m,o]);return j.createElement(Bs.Provider,{value:C},t)}const Ff=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ls(r,n,o).indexOf(t)},Bf=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Uf={duration:200,easing:"ease"},Us="transform",Wf=gt.Transition.toString({property:Us,duration:0,easing:"linear"}),$f={roleDescription:"sortable"};function Hf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=j.useState(null),a=j.useRef(r);return Ke(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Ut(n.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&s(d)}}r!==a.current&&(a.current=r)},[t,r,n,o]),j.useEffect(()=>{i&&s(null)},[i]),i}function Vf(e){let{animateLayoutChanges:t=Bf,attributes:r,disabled:n,data:o,getNewIndex:i=Ff,id:s,strategy:a,resizeObserverConfig:l,transition:c=Uf}=e;const{items:d,containerId:u,activeIndex:m,disabled:f,disableTransforms:v,sortedRects:h,overIndex:b,useDragOverlay:g,strategy:x}=j.useContext(Bs),k=Yf(n,f),_=d.indexOf(s),C=j.useMemo(()=>({sortable:{containerId:u,index:_,items:d},...o}),[u,o,_,d]),I=j.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:A,node:D,isOver:R,setNodeRef:F}=xf({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:Y,activatorEvent:N,activeNodeRect:M,attributes:y,setNodeRef:B,listeners:te,isDragging:U,over:$,setActivatorNodeRef:Z,transform:ne}=bf({id:s,data:C,attributes:{...$f,...r},disabled:k.draggable}),z=ru(F,B),L=!!Y,K=L&&!v&&an(m)&&an(b),q=!g&&U,ee=q&&K?ne:null,re=K?ee??(a??x)({rects:h,activeNodeRect:M,activeIndex:m,overIndex:b,index:_}):null,ie=an(m)&&an(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):_,ae=Y==null?void 0:Y.id,oe=j.useRef({activeId:ae,items:d,newIndex:ie,containerId:u}),le=d!==oe.current.items,fe=t({active:Y,containerId:u,isDragging:U,isSorting:L,id:s,index:_,items:d,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:c,wasDragging:oe.current.activeId!=null}),ve=Hf({disabled:!fe,index:_,node:D,rect:A});return j.useEffect(()=>{L&&oe.current.newIndex!==ie&&(oe.current.newIndex=ie),u!==oe.current.containerId&&(oe.current.containerId=u),d!==oe.current.items&&(oe.current.items=d)},[L,ie,u,d]),j.useEffect(()=>{if(ae===oe.current.activeId)return;if(ae!=null&&oe.current.activeId==null){oe.current.activeId=ae;return}const X=setTimeout(()=>{oe.current.activeId=ae},50);return()=>clearTimeout(X)},[ae]),{active:Y,activeIndex:m,attributes:y,data:C,rect:A,index:_,newIndex:ie,items:d,isOver:R,isSorting:L,isDragging:U,listeners:te,node:D,overIndex:b,over:$,setNodeRef:z,setActivatorNodeRef:Z,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:ve??re,transition:w()};function w(){if(ve||le&&oe.current.newIndex===_)return Wf;if(!(q&&!Jr(N)||!c)&&(L||fe))return gt.Transition.toString({...c,property:Us})}}function Yf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function cn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Zf=[we.Down,we.Right,we.Up,we.Left],Gf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Zf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const m=o.get(u.id);if(m)switch(e.code){case we.Down:n.top<m.top&&l.push(u);break;case we.Up:n.top>m.top&&l.push(u);break;case we.Left:n.left>m.left&&l.push(u);break;case we.Right:n.left<m.left&&l.push(u);break}});const c=xu({collisionRect:n,droppableRects:o,droppableContainers:l});let d=as(c,"id");if(d===(s==null?void 0:s.id)&&c.length>1&&(d=c[1].id),d!=null){const u=i.get(r.id),m=i.get(d),f=m?o.get(m.id):null,v=m==null?void 0:m.node.current;if(v&&f&&u&&m){const b=tn(v).some((I,A)=>a[A]!==I),g=Ws(u,m),x=Kf(u,m),k=b||!g?{x:0,y:0}:{x:x?n.width-f.width:0,y:x?n.height-f.height:0},_={x:f.left,y:f.top};return k.x&&k.y?_:br(_,k)}}}};function Ws(e,t){return!cn(e)||!cn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Kf(e,t){return!cn(e)||!cn(t)||!Ws(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function yo({className:e,type:t,...r}){return p.jsx("input",{type:t,className:me("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function Xf({className:e,...t}){return p.jsx("textarea",{className:me("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function qf({className:e,checked:t,onCheckedChange:r,...n}){return p.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:me("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function zt({className:e,...t}){return p.jsx("label",{className:me("text-sm font-medium leading-none select-none",e),...t})}function ko(e,[t,r]){return Math.min(r,Math.max(t,e))}function be(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Wt(e,t=[]){let r=[];function n(i,s){const a=E.createContext(s),l=r.length;r=[...r,s];const c=u=>{var g;const{scope:m,children:f,...v}=u,h=((g=m==null?void 0:m[e])==null?void 0:g[l])||a,b=E.useMemo(()=>v,Object.values(v));return p.jsx(h.Provider,{value:b,children:f})};c.displayName=i+"Provider";function d(u,m){var h;const f=((h=m==null?void 0:m[e])==null?void 0:h[l])||a,v=E.useContext(f);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=r.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Jf(o,...t)]}function Jf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...a,...u}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function $s(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=$s(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():$s(e[o],null)}}}}function _e(...e){return E.useCallback(Hs(...e),e)}function $t(e){const t=eh(e),r=E.forwardRef((n,o)=>{const{children:i,...s}=n,a=E.Children.toArray(i),l=a.find(rh);if(l){const c=l.props.children,d=a.map(u=>u===l?E.Children.count(c)>1?E.Children.only(null):E.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...s,ref:o,children:E.isValidElement(c)?E.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Qf=$t("Slot");function eh(e){const t=E.forwardRef((r,n)=>{const{children:o,...i}=r;if(E.isValidElement(o)){const s=oh(o),a=nh(i,o.props);return o.type!==E.Fragment&&(a.ref=n?Hs(n,s):s),E.cloneElement(o,a)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vs=Symbol("radix.slottable");function th(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Vs,t}function rh(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vs}function nh(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function oh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ih(e){const t=e+"CollectionProvider",[r,n]=Wt(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:g}=h,x=j.useRef(null),k=j.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:x,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=$t(a),c=j.forwardRef((h,b)=>{const{scope:g,children:x}=h,k=i(a,g),_=_e(b,k.collectionRef);return p.jsx(l,{ref:_,children:x})});c.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=$t(d),f=j.forwardRef((h,b)=>{const{scope:g,children:x,...k}=h,_=j.useRef(null),C=_e(b,_),I=i(d,g);return j.useEffect(()=>(I.itemMap.set(_,{ref:_,...k}),()=>void I.itemMap.delete(_))),p.jsx(m,{[u]:"",ref:C,children:x})});f.displayName=d;function v(h){const b=i(e+"CollectionConsumer",h);return j.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const k=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((I,A)=>k.indexOf(I.ref.current)-k.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},v,n]}var sh=E.createContext(void 0);function Ys(e){const t=E.useContext(sh);return e||t||"ltr"}var ah=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=ah.reduce((e,t)=>{const r=$t(`Primitive.${t}`),n=E.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lh(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}function Me(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function ch(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e);E.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var dh="DismissableLayer",_o="dismissableLayer.update",uh="dismissableLayer.pointerDownOutside",fh="dismissableLayer.focusOutside",Zs,Gs=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dn=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=E.useContext(Gs),[d,u]=E.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=E.useState({}),v=_e(t,A=>u(A)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(b),x=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=g,C=mh(A=>{const D=A.target,R=[...c.branches].some(F=>F.contains(D));!_||R||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},m),I=gh(A=>{const D=A.target;[...c.branches].some(F=>F.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},m);return ch(A=>{x===c.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},m),E.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ks(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zs)}},[d,m,r,c]),E.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ks())},[d,c]),E.useEffect(()=>{const A=()=>f({});return document.addEventListener(_o,A),()=>document.removeEventListener(_o,A)},[]),p.jsx(ke.div,{...l,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,I.onFocusCapture),onBlurCapture:be(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});dn.displayName=dh;var hh="DismissableLayerBranch",ph=E.forwardRef((e,t)=>{const r=E.useContext(Gs),n=E.useRef(null),o=_e(t,n);return E.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(ke.div,{...e,ref:o})});ph.displayName=hh;function mh(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e),n=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Xs(uh,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function gh(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e),n=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!n.current&&Xs(fh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ks(){const e=new CustomEvent(_o);document.dispatchEvent(e)}function Xs(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?lh(o,i):o.dispatchEvent(i)}var So=0;function qs(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Js()),document.body.insertAdjacentElement("beforeend",e[1]??Js()),So++,()=>{So===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),So--}},[])}function Js(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Co="focusScope.autoFocusOnMount",Eo="focusScope.autoFocusOnUnmount",Qs={bubbles:!1,cancelable:!0},bh="FocusScope",No=E.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=E.useState(null),c=Me(o),d=Me(i),u=E.useRef(null),m=_e(t,h=>l(h)),f=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(n){let h=function(k){if(f.paused||!a)return;const _=k.target;a.contains(_)?u.current=_:vt(u.current,{select:!0})},b=function(k){if(f.paused||!a)return;const _=k.relatedTarget;_!==null&&(a.contains(_)||vt(u.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&vt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const x=new MutationObserver(g);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),x.disconnect()}}},[n,a,f.paused]),E.useEffect(()=>{if(a){ra.add(f);const h=document.activeElement;if(!a.contains(h)){const g=new CustomEvent(Co,Qs);a.addEventListener(Co,c),a.dispatchEvent(g),g.defaultPrevented||(vh(_h(ea(a)),{select:!0}),document.activeElement===h&&vt(a))}return()=>{a.removeEventListener(Co,c),setTimeout(()=>{const g=new CustomEvent(Eo,Qs);a.addEventListener(Eo,d),a.dispatchEvent(g),g.defaultPrevented||vt(h??document.body,{select:!0}),a.removeEventListener(Eo,d),ra.remove(f)},0)}}},[a,c,d,f]);const v=E.useCallback(h=>{if(!r&&!n||f.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(b&&g){const x=h.currentTarget,[k,_]=wh(x);k&&_?!h.shiftKey&&g===_?(h.preventDefault(),r&&vt(k,{select:!0})):h.shiftKey&&g===k&&(h.preventDefault(),r&&vt(_,{select:!0})):g===x&&h.preventDefault()}},[r,n,f.paused]);return p.jsx(ke.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});No.displayName=bh;function vh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(vt(n,{select:t}),document.activeElement!==r)return}function wh(e){const t=ea(e),r=ta(t,e),n=ta(t.reverse(),e);return[r,n]}function ea(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ta(e,t){for(const r of e)if(!xh(r,{upTo:t}))return r}function xh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yh(e){return e instanceof HTMLInputElement&&"select"in e}function vt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yh(e)&&t&&e.select()}}var ra=kh();function kh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=na(e,t),e.unshift(t)},remove(t){var r;e=na(e,t),(r=e[0])==null||r.resume()}}}function na(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function _h(e){return e.filter(t=>t.tagName!=="A")}var De=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Sh=E[" useId ".trim().toString()]||(()=>{}),Ch=0;function _r(e){const[t,r]=E.useState(Sh());return De(()=>{r(n=>n??String(Ch++))},[e]),t?`radix-${t}`:""}const Eh=["top","right","bottom","left"],wt=Math.min,Fe=Math.max,un=Math.round,fn=Math.floor,et=e=>({x:e,y:e}),Nh={left:"right",right:"left",bottom:"top",top:"bottom"},Ah={start:"end",end:"start"};function Ao(e,t,r){return Fe(e,wt(t,r))}function ct(e,t){return typeof e=="function"?e(t):e}function dt(e){return e.split("-")[0]}function Ht(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const zh=new Set(["top","bottom"]);function tt(e){return zh.has(dt(e))?"y":"x"}function To(e){return zo(tt(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=Ht(e),o=To(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=hn(s)),[s,hn(s)]}function Th(e){const t=hn(e);return[Oo(e),t,Oo(t)]}function Oo(e){return e.replace(/start|end/g,t=>Ah[t])}const oa=["left","right"],ia=["right","left"],Oh=["top","bottom"],Ph=["bottom","top"];function Ih(e,t,r){switch(e){case"top":case"bottom":return r?t?ia:oa:t?oa:ia;case"left":case"right":return t?Oh:Ph;default:return[]}}function Dh(e,t,r,n){const o=Ht(e);let i=Ih(dt(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Oo)))),i}function hn(e){return e.replace(/left|right|bottom|top/g,t=>Nh[t])}function Rh(e){return{top:0,right:0,bottom:0,left:0,...e}}function sa(e){return typeof e!="number"?Rh(e):{top:e,right:e,bottom:e,left:e}}function pn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function aa(e,t,r){let{reference:n,floating:o}=e;const i=tt(t),s=To(t),a=jo(s),l=dt(t),c=i==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:n.y-o.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Ht(t)){case"start":f[s]-=m*(r&&c?-1:1);break;case"end":f[s]+=m*(r&&c?-1:1);break}return f}async function Lh(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=ct(t,e),v=sa(f),b=a[m?u==="floating"?"reference":"floating":u],g=pn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=pn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:k,strategy:l}):x);return{top:(g.top-C.top+v.top)/_.y,bottom:(C.bottom-g.bottom+v.bottom)/_.y,left:(g.left-C.left+v.left)/_.x,right:(C.right-g.right+v.right)/_.x}}const Mh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=aa(c,n,l),m=n,f={},v=0;for(let b=0;b<a.length;b++){var h;const{name:g,fn:x}=a[b],{x:k,y:_,data:C,reset:I}=await x({x:d,y:u,initialPlacement:n,placement:m,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Lh},elements:{reference:e,floating:t}});d=k??d,u=_??u,f={...f,[g]:{...f[g],...C}},I&&v<=50&&(v++,typeof I=="object"&&(I.placement&&(m=I.placement),I.rects&&(c=I.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:d,y:u}=aa(c,m,l)),b=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:f}},Fh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ct(e,t)||{};if(c==null)return{};const u=sa(d),m={x:r,y:n},f=To(o),v=jo(f),h=await s.getDimensions(c),b=f==="y",g=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",_=i.reference[v]+i.reference[f]-m[f]-i.floating[v],C=m[f]-i.reference[f],I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=I?I[k]:0;(!A||!await(s.isElement==null?void 0:s.isElement(I)))&&(A=a.floating[k]||i.floating[v]);const D=_/2-C/2,R=A/2-h[v]/2-1,F=wt(u[g],R),Y=wt(u[x],R),N=F,M=A-h[v]-Y,y=A/2-h[v]/2+D,B=Ao(N,y,M),te=!l.arrow&&Ht(o)!=null&&y!==B&&i.reference[v]/2-(y<N?F:Y)-h[v]/2<0,U=te?y<N?y-N:y-M:0;return{[f]:m[f]+U,data:{[f]:B,centerOffset:y-B-U,...te&&{alignmentOffset:U}},reset:te}}}),Bh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...b}=ct(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=dt(o),x=tt(a),k=dt(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[hn(a)]:Th(a)),I=v!=="none";!m&&I&&C.push(...Dh(a,h,v,_));const A=[a,...C],D=await l.detectOverflow(t,b),R=[];let F=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&R.push(D[g]),u){const y=jh(o,s,_);R.push(D[y[0]],D[y[1]])}if(F=[...F,{placement:o,overflows:R}],!R.every(y=>y<=0)){var Y,N;const y=(((Y=i.flip)==null?void 0:Y.index)||0)+1,B=A[y];if(B&&(!(u==="alignment"?x!==tt(B):!1)||F.every($=>tt($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:y,overflows:F},reset:{placement:B}};let te=(N=F.filter(U=>U.overflows[0]<=0).sort((U,$)=>U.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(f){case"bestFit":{var M;const U=(M=F.filter($=>{if(I){const Z=tt($.placement);return Z===x||Z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Z=>Z>0).reduce((Z,ne)=>Z+ne,0)]).sort(($,Z)=>$[1]-Z[1])[0])==null?void 0:M[0];U&&(te=U);break}case"initialPlacement":te=a;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function la(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ca(e){return Eh.some(t=>e[t]>=0)}const Uh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ct(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=la(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ca(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=la(s,r.floating);return{data:{escapedOffsets:a,escaped:ca(a)}}}default:return{}}}}},da=new Set(["left","top"]);async function Wh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=dt(r),a=Ht(r),l=tt(r)==="y",c=da.has(s)?-1:1,d=i&&l?-1:1,u=ct(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const $h=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Wh(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Hh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x,y:k}=g;return{x,y:k}}},...c}=ct(e,t),d={x:r,y:n},u=await i.detectOverflow(t,c),m=tt(dt(o)),f=zo(m);let v=d[f],h=d[m];if(s){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",k=v+u[g],_=v-u[x];v=Ao(k,v,_)}if(a){const g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",k=h+u[g],_=h-u[x];h=Ao(k,h,_)}const b=l.fn({...t,[f]:v,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[f]:s,[m]:a}}}}}},Vh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ct(e,t),d={x:r,y:n},u=tt(o),m=zo(u);let f=d[m],v=d[u];const h=ct(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",_=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;f<_?f=_:f>C&&(f=C)}if(c){var g,x;const k=m==="y"?"width":"height",_=da.has(dt(o)),C=i.reference[u]-i.floating[k]+(_&&((g=s.offset)==null?void 0:g[u])||0)+(_?0:b.crossAxis),I=i.reference[u]+i.reference[k]+(_?0:((x=s.offset)==null?void 0:x[u])||0)-(_?b.crossAxis:0);v<C?v=C:v>I&&(v=I)}return{[m]:f,[u]:v}}}},Yh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ct(e,t),d=await s.detectOverflow(t,c),u=dt(o),m=Ht(o),f=tt(o)==="y",{width:v,height:h}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=u,b=m==="end"?"top":"bottom");const x=h-d.top-d.bottom,k=v-d.left-d.right,_=wt(h-d[b],x),C=wt(v-d[g],k),I=!t.middlewareData.shift;let A=_,D=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(D=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=x),I&&!m){const F=Fe(d.left,0),Y=Fe(d.right,0),N=Fe(d.top,0),M=Fe(d.bottom,0);f?D=v-2*(F!==0||Y!==0?F+Y:Fe(d.left,d.right)):A=h-2*(N!==0||M!==0?N+M:Fe(d.top,d.bottom))}await l({...t,availableWidth:D,availableHeight:A});const R=await s.getDimensions(a.floating);return v!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Vt(e){return ua(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ua(e){return mn()?e instanceof Node||e instanceof Be(e).Node:!1}function qe(e){return mn()?e instanceof Element||e instanceof Be(e).Element:!1}function nt(e){return mn()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function fa(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}const Zh=new Set(["inline","contents"]);function Sr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Zh.has(o)}const Gh=new Set(["table","td","th"]);function Kh(e){return Gh.has(Vt(e))}const Xh=[":popover-open",":modal"];function gn(e){return Xh.some(t=>{try{return e.matches(t)}catch{return!1}})}const qh=["transform","translate","scale","rotate","perspective"],Jh=["transform","translate","scale","rotate","perspective","filter"],Qh=["paint","layout","strict","content"];function Po(e){const t=Io(),r=qe(e)?Je(e):e;return qh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Jh.some(n=>(r.willChange||"").includes(n))||Qh.some(n=>(r.contain||"").includes(n))}function ep(e){let t=xt(e);for(;nt(t)&&!Yt(t);){if(Po(t))return t;if(gn(t))return null;t=xt(t)}return null}function Io(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tp=new Set(["html","body","#document"]);function Yt(e){return tp.has(Vt(e))}function Je(e){return Be(e).getComputedStyle(e)}function bn(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if(Vt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fa(e)&&e.host||rt(e);return fa(t)?t.host:t}function ha(e){const t=xt(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&&Sr(t)?t:ha(t)}function Cr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ha(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Be(o);if(i){const a=Do(s);return t.concat(s,s.visualViewport||[],Sr(o)?o:[],a&&r?Cr(a):[])}return t.concat(o,Cr(o,[],r))}function Do(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pa(e){const t=Je(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=nt(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=un(r)!==i||un(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ro(e){return qe(e)?e:e.contextElement}function Zt(e){const t=Ro(e);if(!nt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=pa(t);let s=(i?un(r.width):r.width)/n,a=(i?un(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rp=et(0);function ma(e){const t=Be(e);return!Io()||!t.visualViewport?rp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function np(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Be(e)?!1:t}function jt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ro(e);let s=et(1);t&&(n?qe(n)&&(s=Zt(n)):s=Zt(e));const a=np(i,r,n)?ma(i):et(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const m=Be(i),f=n&&qe(n)?Be(n):n;let v=m,h=Do(v);for(;h&&n&&f!==v;){const b=Zt(h),g=h.getBoundingClientRect(),x=Je(h),k=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*b.x,_=g.top+(h.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=k,c+=_,v=Be(h),h=Do(v)}}return pn({width:d,height:u,x:l,y:c})}function vn(e,t){const r=bn(e).scrollLeft;return t?t.left+r:jt(rt(e)).left+r}function ga(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-vn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function op(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=rt(n),a=t?gn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=et(1);const d=et(0),u=nt(n);if((u||!u&&!i)&&((Vt(n)!=="body"||Sr(s))&&(l=bn(n)),nt(n))){const f=jt(n);c=Zt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const m=s&&!u&&!i?ga(s,l):et(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function ip(e){return Array.from(e.getClientRects())}function sp(e){const t=rt(e),r=bn(e),n=e.ownerDocument.body,o=Fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+vn(e);const a=-r.scrollTop;return Je(n).direction==="rtl"&&(s+=Fe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ba=25;function ap(e,t){const r=Be(e),n=rt(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Io();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=vn(n);if(c<=0){const d=n.ownerDocument,u=d.body,m=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-u.clientWidth-f);v<=ba&&(i-=v)}else c<=ba&&(i+=c);return{width:i,height:s,x:a,y:l}}const lp=new Set(["absolute","fixed"]);function cp(e,t){const r=jt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=nt(e)?Zt(e):et(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function va(e,t,r){let n;if(t==="viewport")n=ap(e,r);else if(t==="document")n=sp(rt(e));else if(qe(t))n=cp(t,r);else{const o=ma(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pn(n)}function wa(e,t){const r=xt(e);return r===t||!qe(r)||Yt(r)?!1:Je(r).position==="fixed"||wa(r,t)}function dp(e,t){const r=t.get(e);if(r)return r;let n=Cr(e,[],!1).filter(a=>qe(a)&&Vt(a)!=="body"),o=null;const i=Je(e).position==="fixed";let s=i?xt(e):e;for(;qe(s)&&!Yt(s);){const a=Je(s),l=Po(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&lp.has(o.position)||Sr(s)&&!l&&wa(e,s))?n=n.filter(d=>d!==s):o=a,s=xt(s)}return t.set(e,n),n}function up(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?gn(t)?[]:dp(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const u=va(t,d,o);return c.top=Fe(u.top,c.top),c.right=wt(u.right,c.right),c.bottom=wt(u.bottom,c.bottom),c.left=Fe(u.left,c.left),c},va(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fp(e){const{width:t,height:r}=pa(e);return{width:t,height:r}}function hp(e,t,r){const n=nt(t),o=rt(t),i=r==="fixed",s=jt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);function c(){l.x=vn(o)}if(n||!n&&!i)if((Vt(t)!=="body"||Sr(o))&&(a=bn(t)),n){const f=jt(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?ga(o,a):et(0),u=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function Lo(e){return Je(e).position==="static"}function xa(e,t){if(!nt(e)||Je(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rt(e)===r&&(r=r.ownerDocument.body),r}function ya(e,t){const r=Be(e);if(gn(e))return r;if(!nt(e)){let o=xt(e);for(;o&&!Yt(o);){if(qe(o)&&!Lo(o))return o;o=xt(o)}return r}let n=xa(e,t);for(;n&&Kh(n)&&Lo(n);)n=xa(n,t);return n&&Yt(n)&&Lo(n)&&!Po(n)?r:n||ep(e)||r}const pp=async function(e){const t=this.getOffsetParent||ya,r=this.getDimensions,n=await r(e.floating);return{reference:hp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function mp(e){return Je(e).direction==="rtl"}const gp={convertOffsetParentRelativeRectToViewportRelativeRect:op,getDocumentElement:rt,getClippingRect:up,getOffsetParent:ya,getElementRects:pp,getClientRects:ip,getDimensions:fp,getScale:Zt,isElement:qe,isRTL:mp};function ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bp(e,t){let r=null,n;const o=rt(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:f}=c;if(a||t(),!m||!f)return;const v=fn(u),h=fn(o.clientWidth-(d+m)),b=fn(o.clientHeight-(u+f)),g=fn(d),k={rootMargin:-v+"px "+-h+"px "+-b+"px "+-g+"px",threshold:Fe(0,wt(1,l))||1};let _=!0;function C(I){const A=I[0].intersectionRatio;if(A!==l){if(!_)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!ka(c,e.getBoundingClientRect())&&s(),_=!1}try{r=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,k)}r.observe(e)}return s(!0),i}function vp(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Ro(e),d=o||i?[...c?Cr(c):[],...Cr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const u=c&&a?bp(c,r):null;let m=-1,f=null;s&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let v,h=l?jt(e):null;l&&b();function b(){const g=jt(e);h&&!ka(h,g)&&r(),h=g,v=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(x=>{o&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const wp=$h,xp=Hh,yp=Bh,kp=Yh,_p=Uh,_a=Fh,Sp=Vh,Cp=(e,t,r)=>{const n=new Map,o={platform:gp,...r},i={...o.platform,_c:n};return Mh(e,t,{...o,platform:i})};var Ep=typeof document<"u",Np=function(){},wn=Ep?j.useLayoutEffect:Np;function xn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!xn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!xn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Sa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ca(e,t){const r=Sa(e);return Math.round(t*r)/r}function Mo(e){const t=E.useRef(e);return wn(()=>{t.current=e}),t}function Ap(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=E.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=E.useState(n);xn(m,n)||f(n);const[v,h]=E.useState(null),[b,g]=E.useState(null),x=E.useCallback($=>{$!==I.current&&(I.current=$,h($))},[]),k=E.useCallback($=>{$!==A.current&&(A.current=$,g($))},[]),_=i||v,C=s||b,I=E.useRef(null),A=E.useRef(null),D=E.useRef(d),R=l!=null,F=Mo(l),Y=Mo(o),N=Mo(c),M=E.useCallback(()=>{if(!I.current||!A.current)return;const $={placement:t,strategy:r,middleware:m};Y.current&&($.platform=Y.current),Cp(I.current,A.current,$).then(Z=>{const ne={...Z,isPositioned:N.current!==!1};y.current&&!xn(D.current,ne)&&(D.current=ne,Rr.flushSync(()=>{u(ne)}))})},[m,t,r,Y,N]);wn(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,u($=>({...$,isPositioned:!1})))},[c]);const y=E.useRef(!1);wn(()=>(y.current=!0,()=>{y.current=!1}),[]),wn(()=>{if(_&&(I.current=_),C&&(A.current=C),_&&C){if(F.current)return F.current(_,C,M);M()}},[_,C,M,F,R]);const B=E.useMemo(()=>({reference:I,floating:A,setReference:x,setFloating:k}),[x,k]),te=E.useMemo(()=>({reference:_,floating:C}),[_,C]),U=E.useMemo(()=>{const $={position:r,left:0,top:0};if(!te.floating)return $;const Z=Ca(te.floating,d.x),ne=Ca(te.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+ne+"px)",...Sa(te.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:ne}},[r,a,te.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:M,refs:B,elements:te,floatingStyles:U}),[d,M,B,te,U])}const zp=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?_a({element:n.current,padding:o}).fn(r):{}:n?_a({element:n,padding:o}).fn(r):{}}}},jp=(e,t)=>({...wp(e),options:[e,t]}),Tp=(e,t)=>({...xp(e),options:[e,t]}),Op=(e,t)=>({...Sp(e),options:[e,t]}),Pp=(e,t)=>({...yp(e),options:[e,t]}),Ip=(e,t)=>({...kp(e),options:[e,t]}),Dp=(e,t)=>({..._p(e),options:[e,t]}),Rp=(e,t)=>({...zp(e),options:[e,t]});var Lp="Arrow",Ea=E.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(ke.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ea.displayName=Lp;var Mp=Ea;function Fp(e){const[t,r]=E.useState(void 0);return De(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Fo="Popper",[Na,Gt]=Wt(Fo),[Bp,Aa]=Na(Fo),za=e=>{const{__scopePopper:t,children:r}=e,[n,o]=E.useState(null);return p.jsx(Bp,{scope:t,anchor:n,onAnchorChange:o,children:r})};za.displayName=Fo;var ja="PopperAnchor",Ta=E.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Aa(ja,r),s=E.useRef(null),a=_e(t,s),l=E.useRef(null);return E.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||s.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:p.jsx(ke.div,{...o,ref:a})});Ta.displayName=ja;var Bo="PopperContent",[Up,Wp]=Na(Bo),Oa=E.forwardRef((e,t)=>{var re,ie,ae,oe,le,fe;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:v,...h}=e,b=Aa(Bo,r),[g,x]=E.useState(null),k=_e(t,ve=>x(ve)),[_,C]=E.useState(null),I=Fp(_),A=(I==null?void 0:I.width)??0,D=(I==null?void 0:I.height)??0,R=n+(i!=="center"?"-"+i:""),F=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Y=Array.isArray(c)?c:[c],N=Y.length>0,M={padding:F,boundary:Y.filter(Hp),altBoundary:N},{refs:y,floatingStyles:B,placement:te,isPositioned:U,middlewareData:$}=Ap({strategy:"fixed",placement:R,whileElementsMounted:(...ve)=>vp(...ve,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[jp({mainAxis:o+D,alignmentAxis:s}),l&&Tp({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Op():void 0,...M}),l&&Pp({...M}),Ip({...M,apply:({elements:ve,rects:w,availableWidth:X,availableHeight:H})=>{const{width:T,height:S}=w.reference,P=ve.floating.style;P.setProperty("--radix-popper-available-width",`${X}px`),P.setProperty("--radix-popper-available-height",`${H}px`),P.setProperty("--radix-popper-anchor-width",`${T}px`),P.setProperty("--radix-popper-anchor-height",`${S}px`)}}),_&&Rp({element:_,padding:a}),Vp({arrowWidth:A,arrowHeight:D}),m&&Dp({strategy:"referenceHidden",...M})]}),[Z,ne]=Da(te),z=Me(v);De(()=>{U&&(z==null||z())},[U,z]);const L=(re=$.arrow)==null?void 0:re.x,K=(ie=$.arrow)==null?void 0:ie.y,q=((ae=$.arrow)==null?void 0:ae.centerOffset)!==0,[ee,ue]=E.useState();return De(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),p.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:U?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(oe=$.transformOrigin)==null?void 0:oe.x,(le=$.transformOrigin)==null?void 0:le.y].join(" "),...((fe=$.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Up,{scope:r,placedSide:Z,onArrowChange:C,arrowX:L,arrowY:K,shouldHideArrow:q,children:p.jsx(ke.div,{"data-side":Z,"data-align":ne,...h,ref:k,style:{...h.style,animation:U?void 0:"none"}})})})});Oa.displayName=Bo;var Pa="PopperArrow",$p={top:"bottom",right:"left",bottom:"top",left:"right"},Ia=E.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Wp(Pa,n),s=$p[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Mp,{...o,ref:r,style:{...o.style,display:"block"}})})});Ia.displayName=Pa;function Hp(e){return e!==null}var Vp=e=>({name:"transformOrigin",options:e,fn(t){var b,g,x;const{placement:r,rects:n,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Da(r),u={start:"0%",center:"50%",end:"100%"}[d],m=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let v="",h="";return c==="bottom"?(v=s?u:`${m}px`,h=`${-l}px`):c==="top"?(v=s?u:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,h=s?u:`${f}px`):c==="left"&&(v=`${n.floating.width+l}px`,h=s?u:`${f}px`),{data:{x:v,y:h}}}});function Da(e){const[t,r="center"]=e.split("-");return[t,r]}var Uo=za,yn=Ta,Wo=Oa,$o=Ia,Yp="Portal",kn=E.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=E.useState(!1);De(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ht.createPortal(p.jsx(ke.div,{...n,ref:t}),s):null});kn.displayName=Yp;var Zp=E[" useInsertionEffect ".trim().toString()]||De;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Gp({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=E.useRef(e!==void 0);E.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const c=E.useCallback(d=>{var u;if(a){const m=Kp(d)?d(e):d;m!==e&&((u=s.current)==null||u.call(s,m))}else i(d)},[a,e,i,s]);return[l,c]}function Gp({defaultProp:e,onChange:t}){const[r,n]=E.useState(e),o=E.useRef(r),i=E.useRef(t);return Zp(()=>{i.current=t},[t]),E.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Kp(e){return typeof e=="function"}function Xp(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ra=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qp="VisuallyHidden",La=E.forwardRef((e,t)=>p.jsx(ke.span,{...e,ref:t,style:{...Ra,...e.style}}));La.displayName=qp;var Jp=La,Qp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Kt=new WeakMap,Sn=new WeakMap,Cn={},Ho=0,Ma=function(e){return e&&(e.host||Ma(e.parentNode))},em=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ma(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},tm=function(e,t,r,n){var o=em(t,Array.isArray(e)?e:[e]);Cn[r]||(Cn[r]=new WeakMap);var i=Cn[r],s=[],a=new Set,l=new Set(o),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(m){if(a.has(m))d(m);else try{var f=m.getAttribute(n),v=f!==null&&f!=="false",h=(Kt.get(m)||0)+1,b=(i.get(m)||0)+1;Kt.set(m,h),i.set(m,b),s.push(m),h===1&&v&&Sn.set(m,!0),b===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return d(t),a.clear(),Ho++,function(){s.forEach(function(u){var m=Kt.get(u)-1,f=i.get(u)-1;Kt.set(u,m),i.set(u,f),m||(Sn.has(u)||u.removeAttribute(n),Sn.delete(u)),f||u.removeAttribute(r)}),Ho--,Ho||(Kt=new WeakMap,Kt=new WeakMap,Sn=new WeakMap,Cn={})}},Fa=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Qp(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),tm(n,o,r,"aria-hidden")):function(){return null}},ot=function(){return ot=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ot.apply(this,arguments)};function Ba(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function rm(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var En="right-scroll-bar-position",Nn="width-before-scroll-bar",nm="with-scroll-bars-hidden",om="--removed-body-scroll-bar-size";function Vo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function im(e,t){var r=j.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var sm=typeof window<"u"?E.useLayoutEffect:E.useEffect,Ua=new WeakMap;function am(e,t){var r=im(null,function(n){return e.forEach(function(o){return Vo(o,n)})});return sm(function(){var n=Ua.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Vo(a,null)}),i.forEach(function(a){o.has(a)||Vo(a,s)})}Ua.set(r,e)},[e]),r}function lm(e){return e}function cm(e,t){t===void 0&&(t=lm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),r}}}};return o}function dm(e){e===void 0&&(e={});var t=cm(null);return t.options=ot({async:!0,ssr:!1},e),t}var Wa=function(e){var t=e.sideCar,r=Ba(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return E.createElement(n,ot({},r))};Wa.isSideCarExport=!0;function um(e,t){return e.useMedium(t),Wa}var $a=dm(),Yo=function(){},An=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:Yo,onWheelCapture:Yo,onTouchMoveCapture:Yo}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,m=e.sideCar,f=e.noRelative,v=e.noIsolation,h=e.inert,b=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,k=e.gapMode,_=Ba(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,I=am([r,t]),A=ot(ot({},_),o);return E.createElement(E.Fragment,null,d&&E.createElement(C,{sideCar:$a,removeScrollBar:c,shards:u,noRelative:f,noIsolation:v,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?E.cloneElement(E.Children.only(a),ot(ot({},A),{ref:I})):E.createElement(x,ot({},A,{className:l,ref:I}),a))});An.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},An.classNames={fullWidth:Nn,zeroRight:En};var fm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fm();return t&&e.setAttribute("nonce",t),e}function pm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=hm())&&(pm(t,r),mm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bm=function(){var e=gm();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ha=function(){var e=bm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vm={left:0,top:0,right:0,gap:0},Zo=function(e){return parseInt(e||"",10)||0},wm=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Zo(r),Zo(n),Zo(o)]},xm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vm;var t=wm(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ym=Ha(),Xt="data-scroll-locked",km=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
213
|
+
.`.concat(nm,` {
|
|
214
214
|
overflow: hidden `).concat(n,`;
|
|
215
215
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
216
216
|
}
|
|
217
|
-
body[`).concat(
|
|
217
|
+
body[`).concat(Xt,`] {
|
|
218
218
|
overflow: hidden `).concat(n,`;
|
|
219
219
|
overscroll-behavior: contain;
|
|
220
220
|
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
@@ -227,7 +227,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
227
227
|
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
.`).concat(
|
|
230
|
+
.`).concat(En,` {
|
|
231
231
|
right: `).concat(a,"px ").concat(n,`;
|
|
232
232
|
}
|
|
233
233
|
|
|
@@ -235,7 +235,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
margin-right: `).concat(a,"px ").concat(n,`;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
.`).concat(
|
|
238
|
+
.`).concat(En," .").concat(En,` {
|
|
239
239
|
right: 0 `).concat(n,`;
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -243,10 +243,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
margin-right: 0 `).concat(n,`;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
body[`).concat(
|
|
247
|
-
`).concat(
|
|
246
|
+
body[`).concat(Xt,`] {
|
|
247
|
+
`).concat(om,": ").concat(a,`px;
|
|
248
248
|
}
|
|
249
|
-
`)}
|
|
249
|
+
`)},Va=function(){var e=parseInt(document.body.getAttribute(Xt)||"0",10);return isFinite(e)?e:0},_m=function(){E.useEffect(function(){return document.body.setAttribute(Xt,(Va()+1).toString()),function(){var e=Va()-1;e<=0?document.body.removeAttribute(Xt):document.body.setAttribute(Xt,e.toString())}},[])},Sm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;_m();var i=E.useMemo(function(){return xm(o)},[o]);return E.createElement(ym,{styles:km(i,!t,o,r?"":"!important")})},Go=!1;if(typeof window<"u")try{var zn=Object.defineProperty({},"passive",{get:function(){return Go=!0,!0}});window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Go=!1}var qt=Go?{passive:!1}:!1,Cm=function(e){return e.tagName==="TEXTAREA"},Ya=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Cm(e)&&r[t]==="visible")},Em=function(e){return Ya(e,"overflowY")},Nm=function(e){return Ya(e,"overflowX")},Za=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Ga(e,n);if(o){var i=Ka(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Am=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},zm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ga=function(e,t){return e==="v"?Em(t):Nm(t)},Ka=function(e,t){return e==="v"?Am(t):zm(t)},jm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tm=function(e,t,r,n,o){var i=jm(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),c=!1,d=s>0,u=0,m=0;do{if(!a)break;var f=Ka(e,a),v=f[0],h=f[1],b=f[2],g=h-b-i*v;(v||g)&&Ga(e,a)&&(u+=g,m+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(u)<1||!d&&Math.abs(m)<1)&&(c=!0),c},jn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xa=function(e){return[e.deltaX,e.deltaY]},qa=function(e){return e&&"current"in e?e.current:e},Om=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pm=function(e){return`
|
|
250
250
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
251
251
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
252
|
-
`)},Nm=0,Qt=[];function zm(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),o=_.useState(Nm++)[0],i=_.useState(Wa)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Xp([e.lockRef.current],(e.shards||[]).map(Ga),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var v=Tn(h),w=r.current,k="deltaX"in h?h.deltaX:w[0]-v[0],S="deltaY"in h?h.deltaY:w[1]-v[1],C,O=h.target,N=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in h&&N==="h"&&O.type==="range")return!1;var I=window.getSelection(),D=I&&I.anchorNode,L=D?D===O||D.contains(O):!1;if(L)return!1;var Z=Va(N,O);if(!Z)return!0;if(Z?C=N:(C=N==="v"?"h":"v",Z=Va(N,O)),!Z)return!1;if(!n.current&&"changedTouches"in h&&(k||S)&&(n.current=C),!C)return!0;var j=n.current||C;return Cm(j,b,h,j==="h"?k:S)},[]),l=_.useCallback(function(h){var b=h;if(!(!Qt.length||Qt[Qt.length-1]!==i)){var v="deltaY"in b?Za(b):Tn(b),w=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Em(C.delta,v)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var k=(s.current.shards||[]).map(Ga).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=k.length>0?a(b,k[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=_.useCallback(function(h,b,v,w){var k={name:h,delta:b,target:v,should:w,shadowParent:jm(v)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=_.useCallback(function(h){r.current=Tn(h),n.current=void 0},[]),f=_.useCallback(function(h){c(h.type,Za(h),h.target,a(h,e.lockRef.current))},[]),m=_.useCallback(function(h){c(h.type,Tn(h),h.target,a(h,e.lockRef.current))},[]);_.useEffect(function(){return Qt.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Jt),document.addEventListener("touchmove",l,Jt),document.addEventListener("touchstart",d,Jt),function(){Qt=Qt.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,Jt),document.removeEventListener("touchmove",l,Jt),document.removeEventListener("touchstart",d,Jt)}},[]);var u=e.removeScrollBar,x=e.inert;return _.createElement(_.Fragment,null,x?_.createElement(i,{styles:Am(o)}):null,u?_.createElement(vm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tm=im(Ua,zm);var Go=_.forwardRef(function(e,t){return _.createElement(zn,ot({},e,{ref:t,sideCar:Tm}))});Go.classNames=zn.classNames;var Om=[" ","Enter","ArrowUp","ArrowDown"],Pm=[" ","Enter"],Ot="Select",[On,Pn,Im]=Qf(Ot),[er]=$t(Ot,[Im,Gt]),In=Gt(),[Dm,kt]=er(Ot),[Rm,Mm]=er(Ot),Xa=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:m,required:u,form:x}=e,h=In(t),[b,v]=_.useState(null),[w,k]=_.useState(null),[S,C]=_.useState(!1),O=Hs(c),[N,I]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Ot}),[D,L]=_n({prop:s,defaultProp:a,onChange:l,caller:Ot}),Z=_.useRef(null),j=b?x||!!b.closest("form"):!0,[F,y]=_.useState(new Set),H=Array.from(F).map(Q=>Q.props.value).join(";");return p.jsx(Uo,{...h,children:p.jsxs(Dm,{required:u,scope:t,trigger:b,onTriggerChange:v,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Sr(),value:D,onValueChange:L,open:N,onOpenChange:I,dir:O,triggerPointerDownPosRef:Z,disabled:m,children:[p.jsx(On.Provider,{scope:t,children:p.jsx(Rm,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(Q=>{y($=>new Set($).add(Q))},[]),onNativeOptionRemove:_.useCallback(Q=>{y($=>{const V=new Set($);return V.delete(Q),V})},[]),children:r})}),j?p.jsxs(gl,{"aria-hidden":!0,required:u,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:Q=>L(Q.target.value),disabled:m,form:x,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(F)]},H):null]})})};Xa.displayName=Ot;var qa="SelectTrigger",Ja=_.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=In(r),s=kt(qa,r),a=s.disabled||n,l=_e(t,s.onTriggerChange),c=Pn(r),d=_.useRef("touch"),[f,m,u]=vl(h=>{const b=c().filter(k=>!k.disabled),v=b.find(k=>k.value===s.value),w=xl(b,h,v);w!==void 0&&s.onValueChange(w.value)}),x=h=>{a||(s.onOpenChange(!0),u()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return p.jsx(kn,{asChild:!0,...i,children:p.jsx(Se.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":bl(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&x(h)}),onPointerDown:be(o.onPointerDown,h=>{d.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(x(h),h.preventDefault())}),onKeyDown:be(o.onKeyDown,h=>{const b=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Om.includes(h.key)&&(x(),h.preventDefault())})})})});Ja.displayName=qa;var Qa="SelectValue",el=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=kt(Qa,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,f=_e(t,l.onValueNodeChange);return Ie(()=>{c(d)},[c,d]),p.jsx(Se.span,{...a,ref:f,style:{pointerEvents:"none"},children:bl(l.value)?p.jsx(p.Fragment,{children:s}):i})});el.displayName=Qa;var Lm="SelectIcon",tl=_.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(Se.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});tl.displayName=Lm;var Fm="SelectPortal",rl=e=>p.jsx(Sn,{asChild:!0,...e});rl.displayName=Fm;var Pt="SelectContent",nl=_.forwardRef((e,t)=>{const r=kt(Pt,e.__scopeSelect),[n,o]=_.useState();if(Ie(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Mr.createPortal(p.jsx(ol,{scope:e.__scopeSelect,children:p.jsx(On.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(il,{...e,ref:t})});nl.displayName=Pt;var Qe=10,[ol,St]=er(Pt),Bm="SelectContentImpl",Um=Ht("SelectContent.RemoveScroll"),il=_.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:u,sticky:x,hideWhenDetached:h,avoidCollisions:b,...v}=e,w=kt(Pt,r),[k,S]=_.useState(null),[C,O]=_.useState(null),N=_e(t,ee=>S(ee)),[I,D]=_.useState(null),[L,Z]=_.useState(null),j=Pn(r),[F,y]=_.useState(!1),H=_.useRef(!1);_.useEffect(()=>{if(k)return Ma(k)},[k]),Gs();const Q=_.useCallback(ee=>{const[ie,...se]=j().map(fe=>fe.ref.current),[oe]=se.slice(-1),le=document.activeElement;for(const fe of ee)if(fe===le||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ie&&C&&(C.scrollTop=0),fe===oe&&C&&(C.scrollTop=C.scrollHeight),fe==null||fe.focus(),document.activeElement!==le))return},[j,C]),$=_.useCallback(()=>Q([I,k]),[Q,I,k]);_.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:V,triggerPointerDownPosRef:Y}=w;_.useEffect(()=>{if(k){let ee={x:0,y:0};const ie=oe=>{var le,fe;ee={x:Math.abs(Math.round(oe.pageX)-(((le=Y.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((fe=Y.current)==null?void 0:fe.y)??0))}},se=oe=>{ee.x<=10&&ee.y<=10?oe.preventDefault():k.contains(oe.target)||V(!1),document.removeEventListener("pointermove",ie),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",se,{capture:!0})}}},[k,V,Y]),_.useEffect(()=>{const ee=()=>V(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[V]);const[J,z]=vl(ee=>{const ie=j().filter(le=>!le.disabled),se=ie.find(le=>le.ref.current===document.activeElement),oe=xl(ie,ee,se);oe&&setTimeout(()=>oe.ref.current.focus())}),P=_.useCallback((ee,ie,se)=>{const oe=!H.current&&!se;(w.value!==void 0&&w.value===ie||oe)&&(D(ee),oe&&(H.current=!0))},[w.value]),K=_.useCallback(()=>k==null?void 0:k.focus(),[k]),G=_.useCallback((ee,ie,se)=>{const oe=!H.current&&!se;(w.value!==void 0&&w.value===ie||oe)&&Z(ee)},[w.value]),te=n==="popper"?Xo:sl,ue=te===Xo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:u,sticky:x,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(ol,{scope:r,content:k,viewport:C,onViewportChange:O,itemRefCallback:P,selectedItem:I,onItemLeave:K,itemTextRefCallback:G,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:J,children:p.jsx(Go,{as:Um,allowPinchZoom:!0,children:p.jsx(Ao,{asChild:!0,trapped:w.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:be(o,ee=>{var ie;(ie=w.trigger)==null||ie.focus({preventScroll:!0}),ee.preventDefault()}),children:p.jsx(un,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:p.jsx(te,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ee=>ee.preventDefault(),...v,...ue,onPlaced:()=>y(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:be(v.onKeyDown,ee=>{const ie=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ie&&ee.key.length===1&&z(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let oe=j().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const le=ee.target,fe=oe.indexOf(le);oe=oe.slice(fe+1)}setTimeout(()=>Q(oe)),ee.preventDefault()}})})})})})})});il.displayName=Bm;var Wm="SelectItemAlignedPosition",sl=_.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=kt(Pt,r),s=St(Pt,r),[a,l]=_.useState(null),[c,d]=_.useState(null),f=_e(t,N=>d(N)),m=Pn(r),u=_.useRef(!1),x=_.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:v,focusSelectedItem:w}=s,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&v){const N=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(i.dir!=="rtl"){const le=L.left-I.left,fe=D.left-le,xe=N.left-fe,g=N.width+xe,B=Math.max(g,I.width),W=window.innerWidth-Qe,E=ko(fe,[Qe,Math.max(Qe,W-B)]);a.style.minWidth=g+"px",a.style.left=E+"px"}else{const le=I.right-L.right,fe=window.innerWidth-D.right-le,xe=window.innerWidth-N.right-fe,g=N.width+xe,B=Math.max(g,I.width),W=window.innerWidth-Qe,E=ko(fe,[Qe,Math.max(Qe,W-B)]);a.style.minWidth=g+"px",a.style.right=E+"px"}const Z=m(),j=window.innerHeight-Qe*2,F=h.scrollHeight,y=window.getComputedStyle(c),H=parseInt(y.borderTopWidth,10),Q=parseInt(y.paddingTop,10),$=parseInt(y.borderBottomWidth,10),V=parseInt(y.paddingBottom,10),Y=H+Q+F+V+$,J=Math.min(b.offsetHeight*5,Y),z=window.getComputedStyle(h),P=parseInt(z.paddingTop,10),K=parseInt(z.paddingBottom,10),G=N.top+N.height/2-Qe,te=j-G,ue=b.offsetHeight/2,ee=b.offsetTop+ue,ie=H+Q+ee,se=Y-ie;if(ie<=G){const le=Z.length>0&&b===Z[Z.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-h.offsetTop-h.offsetHeight,xe=Math.max(te,ue+(le?K:0)+fe+$),g=ie+xe;a.style.height=g+"px"}else{const le=Z.length>0&&b===Z[0].ref.current;a.style.top="0px";const xe=Math.max(G,H+h.offsetTop+(le?P:0)+ue)+se;a.style.height=xe+"px",h.scrollTop=ie-G+h.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=J+"px",a.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>u.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,v,i.dir,n]);Ie(()=>k(),[k]);const[S,C]=_.useState();Ie(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const O=_.useCallback(N=>{N&&x.current===!0&&(k(),w==null||w(),x.current=!1)},[k,w]);return p.jsx(Hm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:u,onScrollButtonChange:O,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:p.jsx(Se.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});sl.displayName=Wm;var $m="SelectPopperPosition",Xo=_.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Qe,...i}=e,s=In(r);return p.jsx(Wo,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xo.displayName=$m;var[Hm,qo]=er(Pt,{}),Jo="SelectViewport",al=_.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=St(Jo,r),s=qo(Jo,r),a=_e(t,i.onViewportChange),l=_.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),p.jsx(On.Slot,{scope:r,children:p.jsx(Se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&f){const u=Math.abs(l.current-d.scrollTop);if(u>0){const x=window.innerHeight-Qe*2,h=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),v=Math.max(h,b);if(v<x){const w=v+u,k=Math.min(x,w),S=w-k;f.style.height=k+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});al.displayName=Jo;var ll="SelectGroup",[Vm,Ym]=er(ll),Km=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Sr();return p.jsx(Vm,{scope:r,id:o,children:p.jsx(Se.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Km.displayName=ll;var cl="SelectLabel",Zm=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ym(cl,r);return p.jsx(Se.div,{id:o.id,...n,ref:t})});Zm.displayName=cl;var Dn="SelectItem",[Gm,dl]=er(Dn),ul=_.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=kt(Dn,r),l=St(Dn,r),c=a.value===n,[d,f]=_.useState(i??""),[m,u]=_.useState(!1),x=_e(t,w=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,w,n,o)}),h=Sr(),b=_.useRef("touch"),v=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Gm,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:_.useCallback(w=>{f(k=>k||((w==null?void 0:w.textContent)??"").trim())},[]),children:p.jsx(On.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(Se.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:be(s.onFocus,()=>u(!0)),onBlur:be(s.onBlur,()=>u(!1)),onClick:be(s.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:be(s.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:be(s.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:be(s.onPointerMove,w=>{var k;b.current=w.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,w=>{var k;w.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:be(s.onKeyDown,w=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&w.key===" "||(Pm.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});ul.displayName=Dn;var Er="SelectItemText",fl=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=kt(Er,r),a=St(Er,r),l=dl(Er,r),c=Mm(Er,r),[d,f]=_.useState(null),m=_e(t,v=>f(v),l.onItemTextChange,v=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,v,l.value,l.disabled)}),u=d==null?void 0:d.textContent,x=_.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:u},l.value),[l.disabled,l.value,u]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=c;return Ie(()=>(h(x),()=>b(x)),[h,b,x]),p.jsxs(p.Fragment,{children:[p.jsx(Se.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mr.createPortal(i.children,s.valueNode):null]})});fl.displayName=Er;var hl="SelectItemIndicator",pl=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return dl(hl,r).isSelected?p.jsx(Se.span,{"aria-hidden":!0,...n,ref:t}):null});pl.displayName=hl;var Qo="SelectScrollUpButton",Xm=_.forwardRef((e,t)=>{const r=St(Qo,e.__scopeSelect),n=qo(Qo,e.__scopeSelect),[o,i]=_.useState(!1),s=_e(t,n.onScrollButtonChange);return Ie(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(ml,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Xm.displayName=Qo;var ei="SelectScrollDownButton",qm=_.forwardRef((e,t)=>{const r=St(ei,e.__scopeSelect),n=qo(ei,e.__scopeSelect),[o,i]=_.useState(!1),s=_e(t,n.onScrollButtonChange);return Ie(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(ml,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});qm.displayName=ei;var ml=_.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=St("SelectScrollButton",r),s=_.useRef(null),a=Pn(r),l=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),Ie(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(Se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:be(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),Jm="SelectSeparator",Qm=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(Se.div,{"aria-hidden":!0,...n,ref:t})});Qm.displayName=Jm;var ti="SelectArrow",eg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=In(r),i=kt(ti,r),s=St(ti,r);return i.open&&s.position==="popper"?p.jsx($o,{...o,...n,ref:t}):null});eg.displayName=ti;var tg="SelectBubbleInput",gl=_.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=_.useRef(null),i=_e(n,o),s=Hp(t);return _.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[s,t]),p.jsx(Se.select,{...r,style:{...Ia,...r.style},ref:i,defaultValue:t})});gl.displayName=tg;function bl(e){return e===""||e===void 0}function vl(e){const t=Le(e),r=_.useRef(""),n=_.useRef(0),o=_.useCallback(s=>{const a=r.current+s;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=_.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function xl(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=rg(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function rg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var ng=Xa,wl=Ja,og=el,ig=tl,sg=rl,yl=nl,ag=al,kl=ul,lg=fl,cg=pl;const dg=ng,ug=og,Sl=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(wl,{ref:n,className:pe("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,p.jsx(ig,{asChild:!0,children:p.jsx(Vr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Sl.displayName=wl.displayName;const _l=_.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(sg,{children:p.jsx(yl,{ref:o,className:pe("relative max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),style:{zIndex:Pe.radixPortal},position:r,...n,children:p.jsx(ag,{className:pe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));_l.displayName=yl.displayName;const Cl=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(kl,{ref:n,className:pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(cg,{children:p.jsx(eo,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(lg,{children:t})]}));Cl.displayName=kl.displayName;const El=_.createContext(null);function Al(){const e=_.useContext(El);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Nl({open:e,onOpenChange:t,children:r}){const[n,o]=_.useState(!1),i=e!==void 0,s=i?e:n,a=_.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=_.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(El.Provider,{value:l,children:r})}function fg({asChild:e,children:t}){const{onOpenChange:r}=Al(),n=_.Children.only(t);return e&&_.isValidElement(n)?_.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):p.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function zl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Al();if(_.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return pt.createPortal(p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 bg-black/60",style:{zIndex:Pe.uiDialogBackdrop},"aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),p.jsx("div",{role:"dialog","aria-modal":!0,className:pe("fixed left-1/2 top-1/2 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),style:{zIndex:Pe.uiDialogContent},onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function jl({className:e,...t}){return p.jsx("div",{className:pe("flex flex-col gap-1.5 pb-4",e),...t})}function hg({className:e,...t}){return p.jsx("div",{className:pe("flex justify-end gap-2 pt-4",e),...t})}function Tl({className:e,...t}){return p.jsx("h2",{className:pe("text-sm font-semibold text-white",e),...t})}function Ol({className:e,...t}){return p.jsx("p",{className:pe("text-xs text-zinc-400",e),...t})}const Ue=_.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?Kf:"button";return p.jsx(c,{ref:i,type:"button",className:pe(s,a[t],l[r],e),...o})});Ue.displayName="Button";const pg=["library","upload","url"];function mg({library:e,selectedId:t,onSelect:r}){const[n,o]=T.useState(""),[i,s]=T.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const d=i==="all"||(c.tags??[]).includes(i),f=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return d&&f});return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Fd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),p.jsx(yo,{value:n,onChange:c=>o(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>p.jsx("button",{type:"button",onClick:()=>s(c),className:pe("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?p.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const d=t===c.id;return p.jsxs("button",{type:"button",onClick:()=>r(d?null:c.id),className:pe("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",d?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[p.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:pe("w-full h-full object-cover transition-[filter] duration-150",d?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),p.jsx("div",{className:pe("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",d&&"opacity-100"),children:p.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),d&&p.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:p.jsx(eo,{size:14,className:"text-white"})})]},c.id)})}):p.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function gg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=T.useState(!1),i=T.useRef(null),s=T.useCallback(async d=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:d.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!d.type.startsWith("image/"))return;if(r){try{const m=await r(d);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:m==null?void 0:m.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:d.name,size:d.size,dataUrl:m})}catch{const m=new FileReader;m.onload=u=>{var x;t({name:d.name,size:d.size,dataUrl:(x=u.target)==null?void 0:x.result})},m.readAsDataURL(d)}return}const f=new FileReader;f.onload=m=>{var u;t({name:d.name,size:d.size,dataUrl:(u=m.target)==null?void 0:u.result})},f.readAsDataURL(d)},[t,r]),a=T.useCallback(d=>{var m,u;d.preventDefault(),d.stopPropagation(),o(!1);const f=(u=(m=d.dataTransfer)==null?void 0:m.files)==null?void 0:u[0];f&&s(f)},[s]),l=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=T.useCallback(d=>{var m;const f=(m=d.target.files)==null?void 0:m[0];f&&s(f)},[s]);return p.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:d=>{d.preventDefault(),d.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var d;return!e&&((d=i.current)==null?void 0:d.click())},className:pe("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),p.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),p.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),p.jsx(Ue,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:d=>{d.stopPropagation(),t(null)},children:p.jsx(Kr,{size:14})})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:p.jsx(qi,{size:22})}),p.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),p.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),p.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),p.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function bg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=T.useState(""),[o,i]=T.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx(jt,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(yo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:pe("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),p.jsx(Ue,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&p.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?p.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[p.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),p.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[p.jsx(eo,{size:14,className:"text-emerald-400"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:p.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[p.jsx(Xi,{size:32,className:"mb-3 opacity-40"}),p.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const vg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=ur(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=T.useState("library"),[a,l]=T.useState(null),[c,d]=T.useState(null),[f,m]=T.useState(null);T.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),T.useEffect(()=>{if(!e||i!=="upload")return;const v=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",v),()=>window.removeEventListener("beforeunload",v)},[e,i]),T.useEffect(()=>{if(!e||i!=="upload")return;const v=k=>{k.preventDefault()},w={capture:!0};return document.addEventListener("dragover",v,w),document.addEventListener("drop",v,w),window.addEventListener("dragover",v,w),window.addEventListener("drop",v,w),()=>{document.removeEventListener("dragover",v,w),document.removeEventListener("drop",v,w),window.removeEventListener("dragover",v,w),window.removeEventListener("drop",v,w)}},[e,i]);const u=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&f!=null,x=()=>{if(i==="library"&&a){const v=o.find(w=>w.id===a);v&&r({url:v.url,alt:v.alt})}else i==="upload"&&c?r({url:c.dataUrl,alt:c.name}):i==="url"&&f&&r({url:f,alt:""});setTimeout(()=>t(!1),0)},h=i==="library"&&a?"1 immagine selezionata":i==="upload"&&c?c.name:i==="url"&&f?"URL pronto":"Nessuna selezione",b=v=>{v.preventDefault(),v.stopPropagation()};return p.jsx(Nl,{open:e,onOpenChange:t,children:p.jsxs(zl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(jl,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:p.jsx(Yr,{size:18})}),p.jsxs("div",{children:[p.jsx(Tl,{children:"Image Picker"}),p.jsx(Ol,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),p.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex border-b border-zinc-800",children:pg.map(v=>p.jsxs("button",{type:"button",onClick:()=>s(v),className:pe("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===v?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[v==="library"&&p.jsx(Yr,{size:14}),v==="upload"&&p.jsx(qi,{size:14}),v==="url"&&p.jsx(Xi,{size:14}),v==="library"?"Libreria":v==="upload"?"Upload":"URL"]},v))}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&p.jsx(mg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(gg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(bg,{urlPreview:f,onUrlPreviewChange:m})]}),p.jsxs(hg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:h}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ue,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),p.jsx(Ue,{type:"button",size:"sm",disabled:!u,onClick:x,className:pe(!u&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Pl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},xg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=ur(),[i,s]=T.useState(!1),[a,l]=T.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Pl(e.url,o):"",f=u=>{t(u),s(!1)},m=u=>{u.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:pe("space-y-1.5",n),children:[p.jsx(jt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?p.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:u=>u.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:pe("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[p.jsx("img",{src:d,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:u=>{u.target.style.display="none"}}),p.jsx("div",{className:pe("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[p.jsx(Md,{size:13}),p.jsx("span",{children:"Cambia"})]}),p.jsx(Ue,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:m,children:p.jsx(Kr,{size:13})})]})}),p.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):p.jsxs("button",{type:"button",onClick:()=>s(!0),className:pe("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[p.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:p.jsx(Yr,{size:18})}),p.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),p.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),p.jsx(vg,{open:i,onOpenChange:s,onSelect:f})]})},Il=[{name:"layers",Icon:ro},{name:"github",Icon:Dd},{name:"arrow-right",Icon:Nd},{name:"box",Icon:jd},{name:"terminal",Icon:$d},{name:"chevron-right",Icon:Td},{name:"menu",Icon:Rd},{name:"x",Icon:Lt},{name:"sparkles",Icon:Ud},{name:"zap",Icon:Vd}],Ar={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-1.5 mb-4",children:[p.jsx(jt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(yo,{type:"text",className:"h-7 text-[11px] bg-zinc-900/50 border-zinc-800 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(jt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(Hf,{className:"min-h-[80px] text-[11px] bg-zinc-900/50 border-zinc-800 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(jt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(dg,{value:t||"",onValueChange:r,children:[p.jsx(Sl,{className:"w-full h-7 text-[11px] bg-zinc-900/50 border-zinc-800 focus:ring-blue-600",children:p.jsx(ug,{placeholder:"Select..."})}),p.jsx(_l,{className:"dark",children:n.map(o=>p.jsx(Cl,{value:o,className:"text-[11px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2 rounded border border-zinc-800/50 bg-zinc-900/20",children:[p.jsx(Vf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(jt,{htmlFor:e,className:"text-[11px] font-medium cursor-pointer select-none text-zinc-300",children:e})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return p.jsx("div",{className:"mb-4",children:p.jsx(xg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=T.useState(!1),i=Il.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(jt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(Nl,{open:n,onOpenChange:o,children:[p.jsx(fg,{asChild:!0,children:p.jsx(Ue,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?p.jsxs(p.Fragment,{children:[p.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):p.jsxs(p.Fragment,{children:[p.jsx(Yr,{size:16,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),p.jsxs(zl,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(jl,{children:[p.jsx(Tl,{className:"text-sm",children:"Choose icon"}),p.jsx(Ol,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Il.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:pe("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:p.jsx(a,{size:20})},s))})]})]})]})}},ri=e=>{if(e instanceof Re.z.ZodOptional||e instanceof Re.z.ZodDefault)return ri(e._def.innerType);if(e instanceof Re.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=ri(e.shape[r]));return t}return e instanceof Re.z.ZodArray?[]:e instanceof Re.z.ZodString?"":e instanceof Re.z.ZodNumber?0:e instanceof Re.z.ZodBoolean?!1:e instanceof Re.z.ZodEnum?e._def.values[0]:null},ni=e=>e instanceof Re.z.ZodOptional||e instanceof Re.z.ZodDefault?ni(e._def.innerType):e,Rn=(e,t)=>e&&!t?"opacity-10":"opacity-100",tr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),wg=(e,t)=>{if(!e)return;const r=t.toLowerCase(),n=Object.entries(e).find(([o])=>o.toLowerCase()===r);return n==null?void 0:n[1]},Nr=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,expandedItemIdByField:i,focusedFieldKey:s,onSidebarExpandedItemChange:a})=>{const l=e.shape,c=n!=null?Object.keys(l).filter(x=>n.includes(x)):Object.keys(l),d=o==null?void 0:o[0],f=(d==null?void 0:d.itemId)!=null?{[d.fieldKey]:d.itemId}:i,m=(d==null?void 0:d.fieldKey)??s??null,u=m!=null;return p.jsx("div",{className:"space-y-4",children:c.map(x=>{const h=l[x];if(!h)return null;const b=ni(h),v=h.description||"ui:text",w=t[x];if(v==="ui:image-picker"&&b instanceof Re.z.ZodObject){const O=tr(m,x),N=Ar["ui:image-picker"]||Ar["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(u,O)}`,...O?{"data-jp-focused-field":x}:{},children:p.jsx(N,{label:x,value:w,onChange:I=>r({...t,[x]:I})})},x)}if(b instanceof Re.z.ZodObject){const O=w||{},N=tr(m,x);return p.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Rn(u,N)}`,...N?{"data-jp-focused-field":x}:{},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),p.jsx("h4",{className:"text-[10px] font-black uppercase text-zinc-400 tracking-widest",children:x})]}),p.jsx(Nr,{schema:b,data:O,onChange:I=>r({...t,[x]:I}),expandedItemPath:o&&tr(d==null?void 0:d.fieldKey,x)?o.slice(1):void 0,expandedItemIdByField:f,focusedFieldKey:m})]},x)}if(b instanceof Re.z.ZodArray){const O=Array.isArray(w)?w:[],N=ni(b.element),I=(j,F)=>{if(F<0||F>=O.length)return;const y=[...O],[H]=y.splice(j,1);y.splice(F,0,H),r({...t,[x]:y})},D=tr(m,x),L=tr(d==null?void 0:d.fieldKey,x)?d==null?void 0:d.itemId:void 0,Z=wg(f,x)??L;return p.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Rn(u,D)}`,...D?{"data-jp-focused-field":x}:{},children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("label",{className:"text-[10px] font-black uppercase text-zinc-500 tracking-widest",children:[x," (",O.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const j=ri(N);r({...t,[x]:[...O,j]})},className:"flex items-center gap-1 px-2 py-1 bg-blue-600/10 hover:bg-blue-600/20 text-blue-500 rounded text-[10px] font-bold transition-colors",children:[p.jsx(no,{size:12})," Add Item"]})]}),p.jsx("div",{className:"space-y-2",children:O.map((j,F)=>{const y=j,H=y.id||`legacy-${F}`,Q=(typeof y.title=="string"?y.title:null)||(typeof y.label=="string"?y.label:null)||(typeof y.name=="string"?y.name:null)||(typeof y.content=="string"?y.content:null)||(typeof y.text=="string"?y.text:null)||`${x} #${F+1}`,$=Z,V=String(y.id??H),Y=$!=null&&String($)===V,J=Y&&o&&o.length>1?o.slice(1):void 0,z=u&&D&&$!=null&&!Y;return p.jsx(yg,{itemId:V,openItemId:$!=null?String($):void 0,isFaded:z,index:F,isFirst:F===0,isLast:F===O.length-1,label:Q,onExpandedChange:a?P=>a(P?{fieldKey:x,itemId:V}:null):void 0,onRemove:()=>{const P=O.filter((K,G)=>G!==F);r({...t,[x]:P})},onMoveUp:()=>I(F,F-1),onMoveDown:()=>I(F,F+1),children:N instanceof Re.z.ZodObject?p.jsx(Nr,{schema:N,data:y||{},expandedItemPath:J,onChange:P=>{const K=[...O];K[F]=P,r({...t,[x]:K})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},H)})})]},x)}const k=Ar[v]||Ar["ui:text"],S=b instanceof Re.z.ZodEnum?b._def.values:void 0,C=tr(m,x);return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(u,C)}`,...C?{"data-jp-focused-field":x}:{},children:p.jsx(k,{label:x,value:w,options:S,onChange:O=>r({...t,[x]:O})})},x)})})},yg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:c,children:d})=>{const f=t!=null&&String(t)===String(e),[m,u]=T.useState(f);T.useEffect(()=>{f&&!m&&u(!0),!f&&m&&u(!1)},[f,m]);const x=()=>{const b=!m;u(b),o==null||o(b)},h=f&&m;return p.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...h?{"data-jp-expanded-item":e}:{},children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[p.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:p.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-2 text-[10px] font-bold text-zinc-300 uppercase tracking-tight truncate",children:[m?p.jsx(to,{size:12,className:"shrink-0"}):p.jsx(Vr,{size:12,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n})]})}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[p.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(zd,{size:12})}),p.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Ad,{size:12})}),p.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),p.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:p.jsx(Kr,{size:12})})]})]}),m&&p.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function kg(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var ft=e=>{const{present:t,children:r}=e,n=Sg(t),o=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),i=_e(n.ref,_g(o));return typeof r=="function"||n.isPresent?_.cloneElement(o,{ref:i}):null};ft.displayName="Presence";function Sg(e){const[t,r]=_.useState(),n=_.useRef(null),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,l]=kg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Mn(n.current);i.current=a==="mounted"?c:"none"},[a]),Ie(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,u=Mn(c);e?l("MOUNT"):u==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&m!==u?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ie(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=u=>{const h=Mn(n.current).includes(CSS.escape(u.animationName));if(u.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=u=>{u.target===t&&(i.current=Mn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Mn(e){return(e==null?void 0:e.animationName)||"none"}function _g(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Ln]=$t("Tooltip",[Gt]),Fn=Gt(),Dl="TooltipProvider",Cg=700,oi="tooltip.open",[Eg,ii]=Ln(Dl),Rl=e=>{const{__scopeTooltip:t,delayDuration:r=Cg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Eg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Rl.displayName=Dl;var zr="Tooltip",[Ag,jr]=Ln(zr),Ml=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ii(zr,e.__scopeTooltip),c=Fn(t),[d,f]=_.useState(null),m=Sr(),u=_.useRef(0),x=s??l.disableHoverableContent,h=a??l.delayDuration,b=_.useRef(!1),[v,w]=_n({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(oi))):l.onClose(),i==null||i(N)},caller:zr}),k=_.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),S=_.useCallback(()=>{window.clearTimeout(u.current),u.current=0,b.current=!1,w(!0)},[w]),C=_.useCallback(()=>{window.clearTimeout(u.current),u.current=0,w(!1)},[w]),O=_.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>{b.current=!0,w(!0),u.current=0},h)},[h,w]);return _.useEffect(()=>()=>{u.current&&(window.clearTimeout(u.current),u.current=0)},[]),p.jsx(Uo,{...c,children:p.jsx(Ag,{scope:t,contentId:m,open:v,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?O():S()},[l.isOpenDelayedRef,O,S]),onTriggerLeave:_.useCallback(()=>{x?C():(window.clearTimeout(u.current),u.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:r})})};Ml.displayName=zr;var si="TooltipTrigger",Ll=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=jr(si,r),i=ii(si,r),s=Fn(r),a=_.useRef(null),l=_e(t,a,o.onTriggerChange),c=_.useRef(!1),d=_.useRef(!1),f=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(kn,{asChild:!0,...s,children:p.jsx(Se.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:be(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});Ll.displayName=si;var ai="TooltipPortal",[Ng,zg]=Ln(ai,{forceMount:void 0}),Fl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=jr(ai,t);return p.jsx(Ng,{scope:t,forceMount:r,children:p.jsx(ft,{present:r||i.open,children:p.jsx(Sn,{asChild:!0,container:o,children:n})})})};Fl.displayName=ai;var rr="TooltipContent",Bl=_.forwardRef((e,t)=>{const r=zg(rr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=jr(rr,e.__scopeTooltip);return p.jsx(ft,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Ul,{side:o,...i,ref:t}):p.jsx(jg,{side:o,...i,ref:t})})}),jg=_.forwardRef((e,t)=>{const r=jr(rr,e.__scopeTooltip),n=ii(rr,e.__scopeTooltip),o=_.useRef(null),i=_e(t,o),[s,a]=_.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:f}=n,m=_.useCallback(()=>{a(null),f(!1)},[f]),u=_.useCallback((x,h)=>{const b=x.currentTarget,v={x:x.clientX,y:x.clientY},w=Dg(v,b.getBoundingClientRect()),k=Rg(v,w),S=Mg(h.getBoundingClientRect()),C=Fg([...k,...S]);a(C),f(!0)},[f]);return _.useEffect(()=>()=>m(),[m]),_.useEffect(()=>{if(l&&d){const x=b=>u(b,d),h=b=>u(b,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",h)}}},[l,d,u,m]),_.useEffect(()=>{if(s){const x=h=>{const b=h.target,v={x:h.clientX,y:h.clientY},w=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!Lg(v,s);w?m():k&&(m(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,s,c,m]),p.jsx(Ul,{...e,ref:i})}),[Tg,Og]=Ln(zr,{isInside:!1}),Pg=Gf("TooltipContent"),Ul=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=jr(rr,r),c=Fn(r),{onClose:d}=l;return _.useEffect(()=>(document.addEventListener(oi,d),()=>document.removeEventListener(oi,d)),[d]),_.useEffect(()=>{if(l.trigger){const f=m=>{const u=m.target;u!=null&&u.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),p.jsx(un,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:p.jsxs(Wo,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Pg,{children:n}),p.jsx(Tg,{scope:r,isInside:!0,children:p.jsx(Yp,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Bl.displayName=rr;var Wl="TooltipArrow",Ig=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Fn(r);return Og(Wl,r).isInside?null:p.jsx($o,{...o,...n,ref:t})});Ig.displayName=Wl;function Dg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Rg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Mg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Lg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,d=a.y,f=l.x,m=l.y;d>n!=m>n&&r<(f-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function Fg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Bg(t)}function Bg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Ug=Rl,Wg=Ml,$g=Ll,Hg=Fl,$l=Bl;const Vg=Ug,Tr=Wg,Or=$g,nr=_.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(Hg,{children:p.jsx($l,{ref:n,sideOffset:t,className:pe("rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{zIndex:Pe.uiFloating},...r})}));nr.displayName=$l.displayName;var Bn="Popover",[Hl]=$t(Bn,[Gt]),Pr=Gt(),[Yg,_t]=Hl(Bn),Vl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Pr(t),l=_.useRef(null),[c,d]=_.useState(!1),[f,m]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Bn});return p.jsx(Uo,{...a,children:p.jsx(Yg,{scope:t,contentId:Sr(),triggerRef:l,open:f,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(u=>!u),[m]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:s,children:r})})};Vl.displayName=Bn;var Yl="PopoverAnchor",Kg=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Yl,r),i=Pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return _.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(kn,{...i,...n,ref:t})});Kg.displayName=Yl;var Kl="PopoverTrigger",Zl=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Kl,r),i=Pr(r),s=_e(t,o.triggerRef),a=p.jsx(Se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ql(o.open),...n,ref:s,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(kn,{asChild:!0,...i,children:a})});Zl.displayName=Kl;var li="PopoverPortal",[Zg,Gg]=Hl(li,{forceMount:void 0}),Gl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=_t(li,t);return p.jsx(Zg,{scope:t,forceMount:r,children:p.jsx(ft,{present:r||i.open,children:p.jsx(Sn,{asChild:!0,container:o,children:n})})})};Gl.displayName=li;var or="PopoverContent",Xl=_.forwardRef((e,t)=>{const r=Gg(or,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=_t(or,e.__scopePopover);return p.jsx(ft,{present:n||i.open,children:i.modal?p.jsx(qg,{...o,ref:t}):p.jsx(Jg,{...o,ref:t})})});Xl.displayName=or;var Xg=Ht("PopoverContent.RemoveScroll"),qg=_.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=_.useRef(null),o=_e(t,n),i=_.useRef(!1);return _.useEffect(()=>{const s=n.current;if(s)return Ma(s)},[]),p.jsx(Go,{as:Xg,allowPinchZoom:!0,children:p.jsx(ql,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:be(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jg=_.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=_.useRef(!1),o=_.useRef(!1);return p.jsx(ql,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ql=_.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,m=_t(or,r),u=Pr(r);return Gs(),p.jsx(Ao,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(un,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(Wo,{"data-state":Ql(m.open),role:"dialog",id:m.contentId,...u,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Jl="PopoverClose",Qg=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Jl,r);return p.jsx(Se.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});Qg.displayName=Jl;var e0="PopoverArrow",t0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Pr(r);return p.jsx($o,{...o,...n,ref:t})});t0.displayName=e0;function Ql(e){return e?"open":"closed"}var r0=Vl,n0=Zl,o0=Gl,ec=Xl;const i0=r0,s0=n0,tc=_.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(o0,{children:p.jsx(ec,{ref:o,align:t,sideOffset:r,className:pe("w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),style:{zIndex:Pe.uiFloating},...n})}));tc.displayName=ec.displayName;const rc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",a0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=T.useState(!1),c=s??rc(t),d=f=>{r(f),l(!1)};return p.jsx("div",{className:pe("mx-3 mt-2 mb-2",i),children:p.jsxs(i0,{open:a,onOpenChange:l,children:[p.jsx(s0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:pe("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[p.jsx(Id,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),p.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),p.jsx(Vr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),p.jsxs(tc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(f=>{const m=f===t,u=rc(f);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(f),className:pe("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",m?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[p.jsx("span",{children:u}),n!=null&&p.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},f)}),o!=null&&p.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:p.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[p.jsx(no,{size:12,"aria-hidden":!0}),p.jsx("span",{children:"New page"})]})})]})]})})};function l0(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var ci="ScrollArea",[nc]=$t(ci),[c0,Ve]=nc(ci),oc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=_.useState(null),[c,d]=_.useState(null),[f,m]=_.useState(null),[u,x]=_.useState(null),[h,b]=_.useState(null),[v,w]=_.useState(0),[k,S]=_.useState(0),[C,O]=_.useState(!1),[N,I]=_.useState(!1),D=_e(t,Z=>l(Z)),L=Hs(o);return p.jsx(c0,{scope:r,type:n,dir:L,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:m,scrollbarX:u,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:O,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:N,onScrollbarYEnabledChange:I,onCornerWidthChange:w,onCornerHeightChange:S,children:p.jsx(Se.div,{dir:L,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});oc.displayName=ci;var ic="ScrollAreaViewport",sc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ve(ic,r),a=_.useRef(null),l=_e(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(Se.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});sc.displayName=ic;var it="ScrollAreaScrollbar",ac=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(it,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(d0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(u0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(lc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(di,{...n,ref:t}):null});ac.displayName=it;var d0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(it,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(ft,{present:r||i,children:p.jsx(lc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),u0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(it,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Hn(()=>l("SCROLL_END"),100),[a,l]=l0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),_.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let f=c[d];const m=()=>{const u=c[d];f!==u&&(l("SCROLL"),s()),f=u};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[o.viewport,i,l,s]),p.jsx(ft,{present:r||a!=="hidden",children:p.jsx(di,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),lc=_.forwardRef((e,t)=>{const r=Ve(it,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",l=Hn(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?c:d)}},10);return ir(r.viewport,l),ir(r.content,l),p.jsx(ft,{present:n||i,children:p.jsx(di,{"data-state":i?"visible":"hidden",...o,ref:t})})}),di=_.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ve(it,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,l]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=hc(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function f(m,u){return b0(m,s.current,a,u)}return r==="horizontal"?p.jsx(f0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,u=pc(m,a,o.dir);i.current.style.transform=`translate3d(${u}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):r==="vertical"?p.jsx(h0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,u=pc(m,a);i.current.style.transform=`translate3d(0, ${u}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),f0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ve(it,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=_e(t,l,i.onScrollbarXChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(dc,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$n(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const m=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),gc(m,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Wn(s.paddingLeft),paddingEnd:Wn(s.paddingRight)}})}})}),h0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ve(it,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=_e(t,l,i.onScrollbarYChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(dc,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$n(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const m=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),gc(m,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Wn(s.paddingTop),paddingEnd:Wn(s.paddingBottom)}})}})}),[p0,cc]=nc(it),dc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...m}=e,u=Ve(it,r),[x,h]=_.useState(null),b=_e(t,D=>h(D)),v=_.useRef(null),w=_.useRef(""),k=u.viewport,S=n.content-n.viewport,C=Le(d),O=Le(l),N=Hn(f,10);function I(D){if(v.current){const L=D.clientX-v.current.left,Z=D.clientY-v.current.top;c({x:L,y:Z})}}return _.useEffect(()=>{const D=L=>{const Z=L.target;(x==null?void 0:x.contains(Z))&&C(L,S)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[k,x,S,C]),_.useEffect(O,[n,O]),ir(x,N),ir(u.content,N),p.jsx(p0,{scope:r,scrollbar:x,hasThumb:o,onThumbChange:Le(i),onThumbPointerUp:Le(s),onThumbPositionChange:O,onThumbPointerDown:Le(a),children:p.jsx(Se.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:be(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),v.current=x.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",u.viewport&&(u.viewport.style.scrollBehavior="auto"),I(D))}),onPointerMove:be(e.onPointerMove,I),onPointerUp:be(e.onPointerUp,D=>{const L=D.target;L.hasPointerCapture(D.pointerId)&&L.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=w.current,u.viewport&&(u.viewport.style.scrollBehavior=""),v.current=null})})})}),Un="ScrollAreaThumb",uc=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=cc(Un,e.__scopeScrollArea);return p.jsx(ft,{present:r||o.hasThumb,children:p.jsx(m0,{ref:t,...n})})}),m0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ve(Un,r),s=cc(Un,r),{onThumbPositionChange:a}=s,l=_e(t,f=>s.onThumbChange(f)),c=_.useRef(void 0),d=Hn(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const f=i.viewport;if(f){const m=()=>{if(d(),!c.current){const u=v0(f,a);c.current=u,a()}};return a(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(Se.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:be(e.onPointerDownCapture,f=>{const u=f.target.getBoundingClientRect(),x=f.clientX-u.left,h=f.clientY-u.top;s.onThumbPointerDown({x,y:h})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});uc.displayName=Un;var ui="ScrollAreaCorner",fc=_.forwardRef((e,t)=>{const r=Ve(ui,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(g0,{...e,ref:t}):null});fc.displayName=ui;var g0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ve(ui,r),[i,s]=_.useState(0),[a,l]=_.useState(0),c=!!(i&&a);return ir(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),ir(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(Se.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Wn(e){return e?parseInt(e,10):0}function hc(e,t){const r=e/t;return isNaN(r)?0:r}function $n(e){const t=hc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function b0(e,t,r,n="ltr"){const o=$n(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return mc([l,c],f)(e)}function pc(e,t,r="ltr"){const n=$n(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=ko(e,l);return mc([0,s],[0,a])(c)}function mc(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function gc(e,t){return e>0&&e<t}var v0=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,a=r.top!==i.top;(s||a)&&t(),r=i,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function Hn(e,t){const r=Le(e),n=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),_.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ir(e,t){const r=Le(t);Ie(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var bc=oc,x0=sc,w0=ac,y0=uc,k0=fc;const vc=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(bc,{ref:n,className:pe("relative overflow-hidden",e),...r,children:[p.jsx(x0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(w0,{orientation:"vertical",className:"flex touch-none select-none transition-colors h-full w-1.5 border-l border-l-transparent p-px",children:p.jsx(y0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(k0,{})]}));vc.displayName=bc.displayName;const xc=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),S0={activationConstraint:{distance:8}},_0={activationConstraint:{delay:200,tolerance:5}};function fi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:c}=t,d=!!r;return p.jsxs("div",{className:pe("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",d?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[d?p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:p.jsx(Gi,{size:12,className:"text-zinc-600"})}):p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:p.jsx(Gi,{size:12,className:"text-zinc-600/50"})}),p.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:pe("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),p.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),p.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:p.jsx(Bd,{size:12})})}),p.jsx(nr,{children:"Settings"})]}),s&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),c()},children:p.jsx(Kr,{size:12})})}),p.jsx(nr,{children:"Delete section"})]})]})]})}function C0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Ff({id:e.id,disabled:!t.canReorder}),l={transform:bt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:{...l,zIndex:a?Pe.studioDraggingRow:void 0},children:p.jsx(fi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const wc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:d,onDeleteSection:f,onAddSection:m,hasChanges:u=!1,onExportHTML:x,onSaveToFile:h,saveSuccessFeedback:b=!1,onResetToFile:v,showResetToFile:w=!1,pageSlugs:k=[],currentSlug:S="home",onPageChange:C})=>{const{schemas:O}=ur(),[N,I]=T.useState(!0),[D,L]=T.useState(null),[Z,j]=T.useState(null),[F,y]=T.useState(null),[H,Q]=T.useState(null),$=T.useRef(null),V=T.useRef(null),Y=du(lo(go,S0),lo(ys,_0),lo(po,{coordinateGetter:Wf})),J=T.useDeferredValue(e),z=e!=null&&(J==null?void 0:J.id)!==e.id,P=s&&s.length>0?s:F?[F]:null,K=P!=null&&P.length?{fieldKey:P[P.length-1].fieldKey,itemId:P[P.length-1].itemId}:null,G=T.useRef(s);T.useEffect(()=>{G.current!=null&&s==null&&y(null),G.current=s},[s]),T.useEffect(()=>{(e==null?void 0:e.id)!=null&&I(!1)},[e==null?void 0:e.id]);const te=()=>{const U=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const M=$.current;M&&M.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(U)},ue=T.useRef(N);T.useEffect(()=>{if(N&&!ue.current){const U=te();return ue.current=N,U}ue.current=N},[N]),T.useEffect(()=>{if(!K)return;const U=$.current;if(!U)return;const M=requestAnimationFrame(()=>{const q=U.querySelector("[data-jp-expanded-item]")??U.querySelector("[data-jp-focused-field]");q&&q.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(M)},[K]);const ee=U=>{I(!1),d==null||d(U)},ie=()=>{I(U=>{const M=!U;return M&&te(),M})},se=(U,M)=>{M.stopPropagation(),r.length>0&&o?Q(U):(I(!1),d==null||d(U))};T.useEffect(()=>{if(H==null)return;const U=M=>{M.key==="Escape"&&Q(null)};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[H]);const oe=U=>{D===U?(f==null||f(U),L(null)):(L(U),setTimeout(()=>L(null),3e3))},le=T.useMemo(()=>l.filter(U=>U.scope==="local").map(U=>U.id),[l]),fe=!!a&&le.length>0,xe=U=>{j(U.active.id)},g=U=>{j(null);const{active:M,over:q}=U;if(!q||M.id===q.id||!a)return;const ne=l.findIndex(he=>he.id===M.id),re=l.findIndex(he=>he.id===q.id);if(ne===-1||re===-1)return;const ae=ne<re?re:re-1;a(M.id,ae)},B=e?t.sections.find(U=>U.id===e.id):void 0,W=J?t.sections.find(U=>U.id===J.id):void 0,E=J?O[J.type]:void 0,A=l.length>0&&(N||!e),R=S?S.charAt(0).toUpperCase()+S.slice(1):"Select page",X=T.useMemo(()=>{const U=[];let M=null;for(const q of l){const ne=q.type.toUpperCase(),re=M!==null&&(M==="HEADER"&&ne!=="HEADER"||M!=="HEADER"&&M!=="FOOTER"&&ne==="FOOTER");U.push({layer:q,showSeparatorAbove:re}),M=ne}return U},[l]);return p.jsx(Vg,{children:p.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),p.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-primary font-bold",children:e.type}),p.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),p.jsx("span",{className:"uppercase",children:e.scope})]}):p.jsxs("span",{className:"text-zinc-600",children:[R," · ",l.length," sections"]})})]}),p.jsx(Ue,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Lt,{size:14})})]}),k.length>0&&C&&p.jsx(a0,{pageSlugs:k,currentSlug:S,onPageChange:C,sectionCount:l.length,currentPageLabel:R}),l.length>0&&p.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[p.jsxs("button",{type:"button",onClick:ie,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":A,"aria-label":A?"Collapse Page Layers":"Expand Page Layers",children:[p.jsx(ro,{size:14,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),p.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),p.jsx(to,{size:13,className:pe("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!N&&"rotate-180")})]}),m!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(no,{size:14})})}),p.jsx(nr,{children:"Add section"})]})]}),p.jsxs(vc,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:$,className:"flex flex-col min-h-0",children:A&&p.jsxs("div",{className:"py-1",children:[p.jsxs(lf,{sensors:Y,collisionDetection:hu,modifiers:[Ef],onDragStart:xe,onDragEnd:g,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:U})=>U?`Posizione ${le.indexOf(String(U.id))+1} di ${le.length}.`:void 0,onDragEnd:({over:U})=>U?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Of,{items:le,strategy:jf,children:p.jsx("div",{className:"px-2 space-y-0.5",children:X.map(({layer:U,showSeparatorAbove:M})=>p.jsxs(T.Fragment,{children:[M&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),U.scope==="local"&&fe?p.jsx(C0,{layer:U,opts:{isSelected:(e==null?void 0:e.id)===U.id,isActive:c===U.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:D===U.id,onSelect:()=>ee(U.id),onDelete:()=>oe(U.id),onOpenSettings:q=>se(U.id,q)}}):p.jsx("div",{children:p.jsx(fi,{layer:U,opts:{isSelected:(e==null?void 0:e.id)===U.id,isActive:c===U.id,isDragging:!1,canDelete:U.scope==="local"&&!!f,deleteConfirm:D===U.id,onSelect:()=>ee(U.id),onDelete:()=>oe(U.id),onOpenSettings:q=>se(U.id,q)}})})]},U.id))})}),p.jsx(Cf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Z?(()=>{const U=l.find(M=>M.id===Z);return U?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(fi,{layer:U,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),D&&p.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[p.jsx(Od,{size:12,className:"text-amber-500 shrink-0"}),p.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),K&&B&&(()=>{const U=B.data||{};let M;if(P&&P.length>0){let q=U;for(const ae of P){const he=q==null?void 0:q[ae.fieldKey];ae.itemId!=null&&Array.isArray(he)?q=he.find(ve=>String(ve==null?void 0:ve.id)===String(ae.itemId))??null:q=he}const ne=q||{},re=K.fieldKey;M=(typeof ne.name=="string"?ne.name:null)??(typeof ne.title=="string"?ne.title:null)??(typeof ne.label=="string"?ne.label:null)??re.charAt(0).toUpperCase()+re.slice(1).replace(/([A-Z])/g," $1").trim()}else{const q=K.fieldKey;if(K.itemId!=null){const ae=(Array.isArray(U[q])?U[q]:[]).find(he=>String(he==null?void 0:he.id)===String(K.itemId))||{};M=(typeof ae.name=="string"?ae.name:null)??(typeof ae.title=="string"?ae.title:null)??(typeof ae.label=="string"?ae.label:null)??q}else M=q.charAt(0).toUpperCase()+q.slice(1).replace(/([A-Z])/g," $1").trim()}return p.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[p.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),p.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:M})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&I(!1),children:e?z?p.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):E?(()=>{const M=Object.keys(E.shape).filter(he=>!xc.has(he)),q=(W==null?void 0:W.data)||{};if(M.length===0)return p.jsx("p",{className:"text-xs text-zinc-500",children:"No content fields in schema."});const ne=P==null?void 0:P[0],re=(ne==null?void 0:ne.itemId)!=null?{[ne.fieldKey]:ne.itemId}:(K==null?void 0:K.itemId)!=null?{[K.fieldKey]:K.itemId}:void 0,ae=(ne==null?void 0:ne.fieldKey)??(K==null?void 0:K.fieldKey)??null;return p.jsx(Nr,{schema:E,data:q,onChange:he=>n(he),keys:M,expandedItemPath:P,expandedItemIdByField:re,focusedFieldKey:ae,onSidebarExpandedItemChange:y})})():p.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(J==null?void 0:J.type)??e.type]}):p.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]}),p.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center gap-3 opacity-100 flex-wrap shrink-0",children:(x!=null||h!=null||v!=null)&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:pe("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",u?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),p.jsx("span",{className:pe("text-xs font-medium transition-colors duration-300 shrink-0",b?"text-emerald-400":u?"text-amber-500":"text-zinc-500"),children:b?"Salvato":u?"Unsaved Changes":"All Changes Saved"}),x!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsxs(Ue,{variant:"outline",size:"sm",className:"gap-1.5",onClick:x,children:[p.jsx(Zi,{size:12}),p.jsx("span",{children:"Bake HTML"})]})}),p.jsx(nr,{children:"Generate static HTML output"})]}),h!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsxs(Ue,{size:"sm",disabled:!u,className:"gap-1.5",onClick:U=>{U.preventDefault(),U.stopPropagation(),h()},children:[p.jsx(Ld,{size:12}),p.jsx("span",{children:"Save"})]})}),p.jsx(nr,{children:"Save (export JSON)"})]}),v!=null&&w&&p.jsx("button",{type:"button",onClick:v,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:p.jsx("span",{children:"Ripristina da file"})})]})}),H!=null&&r.length>0&&o!=null&&(()=>{const U=r.find(ve=>ve.id===H),M=l.find(ve=>ve.id===H);if(!U)return null;const q=(M==null?void 0:M.scope)==="global"?"global":"local",ne=U.type,re=O[ne],he=(re?Object.keys(re.shape):[]).filter(ve=>xc.has(ve)),me=U.data??{};return he.length===0?p.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/60 p-4",style:{zIndex:Pe.adminModal},role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>Q(null),children:p.jsxs("div",{ref:V,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:ve=>ve.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",ne]}),p.jsx("button",{type:"button",onClick:()=>Q(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"p-4",children:p.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):p.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/60 p-4",style:{zIndex:Pe.adminModal},role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:ve=>ve.target===ve.currentTarget&&Q(null),children:p.jsxs("div",{ref:V,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:ve=>ve.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",ne]}),p.jsx("button",{type:"button",onClick:()=>Q(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(Nr,{schema:re,data:me,onChange:ve=>{const st={...U.data,...ve};o(H,q,ne,st)},keys:he})})]})})})()]})})},yc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=T.useRef(null),l=T.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return T.useEffect(()=>{l()},[l]),T.useEffect(()=>{const c=d=>{d.data.type===Ce.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),T.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.SYNC_SELECTION,selectedId:o},"*")},[o]),T.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:Ce.REQUEST_SCROLL_TO_SECTION,sectionId:i},"*"),s==null||s())},[i,s]),p.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:p.jsx("iframe",{ref:a,src:`/admin/preview/${n}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},Vn={setTheme:e=>{const t=document.documentElement,{tokens:r}=e,n={"--theme-primary":r.colors.primary,"--theme-secondary":r.colors.secondary,"--theme-accent":r.colors.accent,"--theme-background":r.colors.background,"--theme-surface":r.colors.surface,"--theme-surface-alt":r.colors.surfaceAlt,"--theme-text":r.colors.text,"--theme-text-muted":r.colors.textMuted,"--theme-border":r.colors.border,"--theme-font-primary":r.typography.fontFamily.primary,"--theme-font-mono":r.typography.fontFamily.mono,"--theme-radius-sm":r.borderRadius.sm,"--theme-radius-md":r.borderRadius.md,"--theme-radius-lg":r.borderRadius.lg};Object.entries(n).forEach(([o,i])=>{t.style.setProperty(o,i)})}},kc=()=>{var u;const[e,t]=T.useState(null),[r,n]=T.useState(null),[o,i]=T.useState(null),[s,a]=T.useState(null),[l,c]=T.useState(!1);if(T.useEffect(()=>{const x=h=>{h.data.type===Ce.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Vn.setTheme(h.data.themeConfig)),h.data.type===Ce.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===Ce.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===Ce.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:Ce.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))};return window.addEventListener("message",x),window.parent.postMessage({type:Ce.STAGE_READY},"*"),()=>window.removeEventListener("message",x)},[]),T.useEffect(()=>{const x=h=>{var j,F,y,H,Q,$,V,Y;const b=h.target,v=h.clientX,w=h.clientY;let k=null,S=b;for(;S&&S!==document.body;){const J=(j=S.getAttribute)==null?void 0:j.call(S,"data-section-id"),z=(F=S.getAttribute)==null?void 0:F.call(S,"data-section-type"),P=(y=S.getAttribute)==null?void 0:y.call(S,"data-section-scope");if(J&&z&&P){k=S;break}S=S.parentElement}if(!k)return;h.preventDefault(),h.stopPropagation();const C=k.getAttribute("data-section-id"),O=k.getAttribute("data-section-type"),N=k.getAttribute("data-section-scope");if(!C||!O||!N)return;const I={id:C,type:O,scope:N};if(b===k){window.parent.postMessage({type:Ce.SECTION_SELECT,section:I},"*");return}const D=document.elementFromPoint(v,w)??b;if(!D||!k.contains(D)){window.parent.postMessage({type:Ce.SECTION_SELECT,section:I},"*");return}if(D===k){window.parent.postMessage({type:Ce.SECTION_SELECT,section:I},"*");return}const L=[];for(S=D;S&&S!==k;){const J=(H=S.getAttribute)==null?void 0:H.call(S,"data-jp-item-id"),z=(Q=S.getAttribute)==null?void 0:Q.call(S,"data-jp-item-field");J&&z&&L.push({fieldKey:z||"items",itemId:J}),S=S.parentElement}if(L.reverse(),L.length===0)for(S=D;S&&S!==k;){const J=($=S.getAttribute)==null?void 0:$.call(S,"data-jp-field");if(J){L.push({fieldKey:J});break}S=S.parentElement}if(L.length===0&&D){let J=null;const z=P=>{var G,te;const K=P.getBoundingClientRect();if(K.left<=v&&v<=K.right&&K.top<=w&&w<=K.bottom){for(let ue=0;ue<P.children.length;ue++)z(P.children[ue]);((G=P.getAttribute)!=null&&G.call(P,"data-jp-item-id")||(te=P.getAttribute)!=null&&te.call(P,"data-jp-field"))&&(J=P)}};if(z(D),J){const P=J,K=(V=P.getAttribute)==null?void 0:V.call(P,"data-jp-item-id"),G=(Y=P.getAttribute)==null?void 0:Y.call(P,"data-jp-field");K&&G?L.push({fieldKey:G||"items",itemId:K}):G&&L.push({fieldKey:G})}}const Z={type:Ce.SECTION_SELECT,section:I};if(L.length>0){Z.itemPath=L;const J=L[0];J.itemId!=null?(Z.itemField=J.fieldKey,Z.itemId=J.itemId):Z.itemField=J.fieldKey}window.parent.postMessage(Z,"*")};return document.addEventListener("click",x,!0),()=>document.removeEventListener("click",x,!0)},[]),T.useEffect(()=>{if(!s)return;const x=setTimeout(()=>a(null),600);return()=>clearTimeout(x)},[s]),!e||!r)return p.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const d=(u=r.header)==null?void 0:u.data,f={main:(d==null?void 0:d.links)??[]},m=x=>{window.parent.postMessage({type:Ce.ACTIVE_SECTION_CHANGED,activeSectionId:x},"*")};return p.jsx(Hr,{mode:l?"visitor":"studio",children:p.jsx("div",{className:l?"":"jp-ice-active",children:p.jsx(oo,{pageConfig:e,siteConfig:r,menuConfig:f,selectedId:l?null:o,scrollToSectionId:s,onActiveSectionChange:m})})})};function E0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Sc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(T.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??E0(s);return p.jsxs("div",{className:"fixed inset-0 flex items-center justify-center p-4",style:{zIndex:Pe.adminModal},role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[p.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),p.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:p.jsx(ro,{size:18})}),p.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),p.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?p.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):p.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>p.jsx("li",{role:"option",children:p.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:pe("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[p.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),p.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),p.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:p.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},_c=()=>p.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[p.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),p.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),p.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]}),A0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[80px\\]{min-height:80px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-blue-900\\/20{--tw-shadow-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-900\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-900)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--jp-layer-radix-portal:500;--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:var(--jp-layer-radix-portal)!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class N0 extends T.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?p.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[p.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),p.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}const Cc=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const{slug:s="home"}=Ze.useParams(),[a,l]=T.useState(null);T.useEffect(()=>{const m=document.getElementById("jp-baked-state");if(m!=null&&m.textContent)try{const u=JSON.parse(m.textContent);l(u),Vn.setTheme(u.theme)}catch(u){console.error("Failed to parse baked state",u)}},[]);const c=a?a.page:e[s],d=a?a.site:t,f=a?a.menu:r;return c?p.jsx(Zr,{mode:"tenant",tenantCss:n,adminCss:o,children:p.jsx(Hr,{mode:"visitor",children:p.jsx(oo,{pageConfig:c,siteConfig:d,menuConfig:f})})}):p.jsx(i,{})},Ec=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,exportHTML:c})=>{const{slug:d="home"}=Ze.useParams(),f=Ze.useNavigate(),m=Object.keys(e).sort((g,B)=>g==="home"?-1:B==="home"?1:g.localeCompare(B)),[u,x]=T.useState(null),[h,b]=T.useState(!1),[v,w]=T.useState(!1),[k,S]=T.useState(()=>{var g;try{const B=JSON.parse(JSON.stringify(t??{}));B.identity||(B.identity={title:"Site"}),B.pages||(B.pages=[]);const W=(g=B.header)==null?void 0:g.data;return W&&(r!=null&&r.main)&&(W.links=JSON.parse(JSON.stringify(r.main))),B}catch{return{identity:{title:"Site"},pages:[]}}}),[C,O]=T.useState(null),[N,I]=T.useState(null),[D,L]=T.useState(null),[Z,j]=T.useState(null),[F,y]=T.useState(!1),[H,Q]=T.useState(400),$=360,V=920,Y=T.useCallback(g=>{g.preventDefault();const B=g.currentTarget;B.setPointerCapture(g.pointerId);const W=g.clientX,E=H,A=X=>{const U=W-X.clientX,M=Math.min(V,Math.max($,E+U));Q(M)},R=()=>{B.releasePointerCapture(g.pointerId),B.removeEventListener("pointermove",A),B.removeEventListener("pointerup",R),B.removeEventListener("pointercancel",R),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",B.addEventListener("pointermove",A),B.addEventListener("pointerup",R),B.addEventListener("pointercancel",R)},[H]),J=u?[...k.header?[{id:k.header.id,type:k.header.type,scope:"global",title:"Header"}]:[],...u.sections.map(g=>{var B,W;return{id:g.id,type:g.type,scope:"local",title:((B=g.data)==null?void 0:B.title)??((W=g.data)==null?void 0:W.titleHighlight)}}),...k.footer?[{id:k.footer.id,type:k.footer.type,scope:"global",title:"Footer"}]:[]]:[];T.useEffect(()=>{const g=document.documentElement,B=g.style.getPropertyValue("--jp-layer-radix-portal");return g.style.setProperty("--jp-layer-radix-portal",String(Pe.radixPortal)),()=>{B?g.style.setProperty("--jp-layer-radix-portal",B):g.style.removeProperty("--jp-layer-radix-portal")}},[]),T.useEffect(()=>{const g=e[d];g&&x(JSON.parse(JSON.stringify(g))),O(null),I(null),b(!1)},[d,e]);const z=T.useCallback(()=>{const g=e[d];g&&x(JSON.parse(JSON.stringify(g))),O(null),I(null),b(!1)},[d,e]),P=T.useCallback((g,B,W)=>{const E=[...W.sections],A=E.findIndex(U=>U.id===g);if(A===-1||B<0||B>=E.length)return;const[R]=E.splice(A,1),X=B>A?B-1:B;E.splice(Math.min(X,E.length),0,R),x({...W,sections:E}),b(!0)},[]),K=T.useCallback(g=>{var B;if(g.origin===window.location.origin){if(g.data.type===Ce.SECTION_SELECT){O(g.data.section);const W=g.data.itemPath;if(Array.isArray(W)&&W.length>0)I(W.map(E=>({fieldKey:E.fieldKey,...E.itemId!=null?{itemId:String(E.itemId)}:{}})));else{const E=g.data.itemField,A=g.data.itemId;I(typeof E=="string"?[{fieldKey:E,...A!=null?{itemId:String(A)}:{}}]:null)}}if(g.data.type===Ce.ACTIVE_SECTION_CHANGED&&L(g.data.activeSectionId??null),g.data.type==="jsonpages:section-reorder"&&u){const{sectionId:W,newIndex:E}=g.data;typeof W=="string"&&typeof E=="number"&&E>=0&&P(W,E,u)}if(g.data.type===Ce.SEND_CLEAN_HTML){if(!u)return;const W=(B=k.header)==null?void 0:B.data,E={page:u,site:k,menu:{main:(W==null?void 0:W.links)??[]},theme:n};c(E,d,g.data.html),b(!1)}}},[u,k,d,n,P,c]);T.useEffect(()=>(window.addEventListener("message",K),()=>window.removeEventListener("message",K)),[K]);const G=T.useCallback(g=>{const B=J.find(W=>W.id===g);B&&O({id:B.id,type:B.type,scope:B.scope}),I(null),j(g)},[J]),te=T.useCallback(()=>{j(null)},[]),ue=T.useCallback(g=>{x(B=>B&&{...B,sections:B.sections.filter(W=>W.id!==g)}),b(!0),O(B=>(B==null?void 0:B.id)===g?null:B)},[]),ee=g=>{if(!(!C||!u))if(b(!0),C.scope==="global")C.type==="header"&&k.header!=null?S({...k,header:{...k.header,data:g}}):C.type==="footer"&&k.footer!=null&&S({...k,footer:{...k.footer,data:g}});else{const B=u.sections.map(W=>W.id===C.id?{...W,data:g}:W);x({...u,sections:B})}},ie=T.useCallback((g,B,W,E)=>{var A,R;if(b(!0),B==="global")((A=k.header)==null?void 0:A.id)===g?S({...k,header:{...k.header,data:E}}):((R=k.footer)==null?void 0:R.id)===g&&S({...k,footer:{...k.footer,data:E}});else if(u){const X=u.sections.map(U=>U.id===g?{...U,data:E}:U);x({...u,sections:X})}},[u,k]),se=()=>{var B;const g=document.querySelector("iframe");(B=g==null?void 0:g.contentWindow)==null||B.postMessage({type:Ce.REQUEST_CLEAN_HTML},"*")},oe=()=>{var W;if(!u||!l)return;const g=(W=k.header)==null?void 0:W.data,B={page:u,site:k,menu:{main:(g==null?void 0:g.links)??[]},theme:n};l(B,d).then(()=>{b(!1),w(!0)}).catch(E=>{console.error("[JsonPages] saveToFile failed",E);const A=E instanceof Error?E.message:String(E);alert(`Save to file failed: ${A}`)})},le=g=>{var E;if(!u)return;const B=((E=s==null?void 0:s.getDefaultSectionData)==null?void 0:E.call(s,g))??{},W={id:crypto.randomUUID(),type:g,data:B,settings:void 0};x({...u,sections:[...u.sections,W]}),b(!0),O({id:W.id,type:g,scope:"local"})};if(!u)return p.jsx("div",{children:"Loading Studio..."});const fe=(C==null?void 0:C.scope)==="global"?{sections:[k.header,k.footer].filter(g=>g!=null)}:u,xe=[...k.header?[k.header]:[],...u.sections,...k.footer?[k.footer]:[]];return p.jsx(Zr,{mode:"admin",tenantCss:o,adminCss:i,children:p.jsx(Hr,{mode:"studio",children:p.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[p.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[p.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:p.jsx(yc,{draft:u,globalDraft:k,themeConfig:n,slug:d,selectedId:C==null?void 0:C.id,scrollToSectionId:Z,onScrollRequested:te})}),p.jsxs("div",{className:"flex shrink-0 relative h-full",style:{width:H,minWidth:$,maxWidth:V,zIndex:Pe.inspectorPanel},children:[p.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:Pe.inspectorResizeHandle},onPointerDown:Y}),p.jsx(wc,{selectedSection:C,pageData:fe,allSectionsData:xe,onUpdate:ee,onUpdateSection:ie,onClose:()=>{O(null),I(null)},expandedItemPath:N,onReorderSection:u?(g,B)=>P(g,B,u):void 0,allLayers:J,activeSectionId:D,onRequestScrollToSection:G,onDeleteSection:u?ue:void 0,onAddSection:a.length>0?()=>y(!0):void 0,hasChanges:h,onExportHTML:se,onSaveToFile:l!=null?oe:void 0,saveSuccessFeedback:v,onResetToFile:z,pageSlugs:m,currentSlug:d,onPageChange:m.length>1?g=>f(`/admin/${g}`):void 0})]})]}),p.jsx(Sc,{open:F,onClose:()=>y(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:le})]})})})},z0=({tenantCss:e,adminCss:t})=>p.jsx(Zr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(kc,{})});function j0({config:e}){var b,v,w;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=_c}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(k=>k!=="header"&&k!=="footer"),f={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??wi,exportHTML:((v=e.persistence)==null?void 0:v.exportHTML)??yi,saveToFile:(w=e.persistence)==null?void 0:w.saveToFile},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",u=typeof(a==null?void 0:a.admin)=="string"?a.admin:A0,[x,h]=T.useState(!1);return T.useEffect(()=>{try{i!=null&&i.tokens&&Vn.setTheme(i)}catch(k){console.warn("[JsonPages] setTheme failed",k)}h(!0)},[i]),x?p.jsx(N0,{children:p.jsx(Hi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets},children:p.jsx(Ze.BrowserRouter,{children:p.jsxs(Ze.Routes,{children:[p.jsx(Ze.Route,{path:"/",element:p.jsx(Cc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:u,NotFoundComponent:c})}),p.jsx(Ze.Route,{path:"/:slug",element:p.jsx(Cc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:u,NotFoundComponent:c})}),p.jsx(Ze.Route,{path:"/admin",element:p.jsx(Ec,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:u,addSectionConfig:l,addableSectionTypes:d,saveToFile:f.saveToFile,exportHTML:f.exportHTML})}),p.jsx(Ze.Route,{path:"/admin/:slug",element:p.jsx(Ec,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:u,addSectionConfig:l,addableSectionTypes:d,saveToFile:f.saveToFile,exportHTML:f.exportHTML})}),p.jsx(Ze.Route,{path:"/admin/preview/:slug",element:p.jsx(z0,{tenantCss:m,adminCss:u})}),p.jsx(Ze.Route,{path:"*",element:p.jsx(c,{})})]})})})}):p.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}const T0=({hasChanges:e,onExportJSON:t,onExportHTML:r,onAddSection:n})=>p.jsxs("div",{className:"h-14 border-b border-zinc-800 bg-zinc-950 flex items-center justify-between px-6 shrink-0 z-50 relative",children:[p.jsx("div",{className:"flex items-center gap-3",children:n!=null&&p.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors",title:"Add section","aria-label":"Add section",children:[p.jsx(Wd,{size:14}),p.jsx("span",{children:"Add section"})]})}),p.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 opacity-20 pointer-events-none",children:p.jsx("span",{className:"text-xs font-black tracking-[0.2em] text-zinc-100",children:"JSONPAGES STUDIO"})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium transition-all border bg-zinc-900 border-zinc-700 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",children:[p.jsx(Zi,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:pe("flex items-center gap-2 px-4 py-1.5 rounded-md text-xs font-bold transition-all shadow-lg",e?"bg-blue-600 text-white hover:bg-blue-500 shadow-blue-900/20":"bg-zinc-900 text-zinc-600 cursor-not-allowed"),children:[p.jsx(Pd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});ye.AddSectionLibrary=Sc,ye.AdminSidebar=wc,ye.ConfigProvider=Hi,ye.ControlBar=T0,ye.DefaultNotFound=_c,ye.FormFactory=Nr,ye.InputWidgets=Ar,ye.JsonPagesEngine=j0,ye.PageRenderer=oo,ye.PreviewEntry=kc,ye.STUDIO_EVENTS=Ce,ye.SectionRenderer=fr,ye.StudioProvider=Hr,ye.StudioStage=yc,ye.ThemeLoader=Zr,ye.cn=pe,ye.exportBakedHTML=yi,ye.exportProjectJSON=wi,ye.resolveAssetUrl=Pl,ye.themeManager=Vn,ye.useConfig=ur,ye.useStudio=Yi,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})}));
|
|
252
|
+
`)},Im=0,Jt=[];function Dm(e){var t=E.useRef([]),r=E.useRef([0,0]),n=E.useRef(),o=E.useState(Im++)[0],i=E.useState(Ha)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=rm([e.lockRef.current],(e.shards||[]).map(qa),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=E.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var g=jn(h),x=r.current,k="deltaX"in h?h.deltaX:x[0]-g[0],_="deltaY"in h?h.deltaY:x[1]-g[1],C,I=h.target,A=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in h&&A==="h"&&I.type==="range")return!1;var D=window.getSelection(),R=D&&D.anchorNode,F=R?R===I||R.contains(I):!1;if(F)return!1;var Y=Za(A,I);if(!Y)return!0;if(Y?C=A:(C=A==="v"?"h":"v",Y=Za(A,I)),!Y)return!1;if(!n.current&&"changedTouches"in h&&(k||_)&&(n.current=C),!C)return!0;var N=n.current||C;return Tm(N,b,h,N==="h"?k:_)},[]),l=E.useCallback(function(h){var b=h;if(!(!Jt.length||Jt[Jt.length-1]!==i)){var g="deltaY"in b?Xa(b):jn(b),x=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Om(C.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var k=(s.current.shards||[]).map(qa).filter(Boolean).filter(function(C){return C.contains(b.target)}),_=k.length>0?a(b,k[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=E.useCallback(function(h,b,g,x){var k={name:h,delta:b,target:g,should:x,shadowParent:Rm(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),d=E.useCallback(function(h){r.current=jn(h),n.current=void 0},[]),u=E.useCallback(function(h){c(h.type,Xa(h),h.target,a(h,e.lockRef.current))},[]),m=E.useCallback(function(h){c(h.type,jn(h),h.target,a(h,e.lockRef.current))},[]);E.useEffect(function(){return Jt.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,qt),document.addEventListener("touchmove",l,qt),document.addEventListener("touchstart",d,qt),function(){Jt=Jt.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,qt),document.removeEventListener("touchmove",l,qt),document.removeEventListener("touchstart",d,qt)}},[]);var f=e.removeScrollBar,v=e.inert;return E.createElement(E.Fragment,null,v?E.createElement(i,{styles:Pm(o)}):null,f?E.createElement(Sm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lm=um($a,Dm);var Ko=E.forwardRef(function(e,t){return E.createElement(An,ot({},e,{ref:t,sideCar:Lm}))});Ko.classNames=An.classNames;var Mm=[" ","Enter","ArrowUp","ArrowDown"],Fm=[" ","Enter"],Tt="Select",[Tn,On,Bm]=ih(Tt),[Qt]=Wt(Tt,[Bm,Gt]),Pn=Gt(),[Um,yt]=Qt(Tt),[Wm,$m]=Qt(Tt),Ja=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:m,required:f,form:v}=e,h=Pn(t),[b,g]=E.useState(null),[x,k]=E.useState(null),[_,C]=E.useState(!1),I=Ys(c),[A,D]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Tt}),[R,F]=_n({prop:s,defaultProp:a,onChange:l,caller:Tt}),Y=E.useRef(null),N=b?v||!!b.closest("form"):!0,[M,y]=E.useState(new Set),B=Array.from(M).map(te=>te.props.value).join(";");return p.jsx(Uo,{...h,children:p.jsxs(Um,{required:f,scope:t,trigger:b,onTriggerChange:g,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:_r(),value:R,onValueChange:F,open:A,onOpenChange:D,dir:I,triggerPointerDownPosRef:Y,disabled:m,children:[p.jsx(Tn.Provider,{scope:t,children:p.jsx(Wm,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(te=>{y(U=>new Set(U).add(te))},[]),onNativeOptionRemove:E.useCallback(te=>{y(U=>{const $=new Set(U);return $.delete(te),$})},[]),children:r})}),N?p.jsxs(vl,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:R,onChange:te=>F(te.target.value),disabled:m,form:v,children:[R===void 0?p.jsx("option",{value:""}):null,Array.from(M)]},B):null]})})};Ja.displayName=Tt;var Qa="SelectTrigger",el=E.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=yt(Qa,r),a=s.disabled||n,l=_e(t,s.onTriggerChange),c=On(r),d=E.useRef("touch"),[u,m,f]=xl(h=>{const b=c().filter(k=>!k.disabled),g=b.find(k=>k.value===s.value),x=yl(b,h,g);x!==void 0&&s.onValueChange(x.value)}),v=h=>{a||(s.onOpenChange(!0),f()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return p.jsx(yn,{asChild:!0,...i,children:p.jsx(ke.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":wl(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&v(h)}),onPointerDown:be(o.onPointerDown,h=>{d.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(v(h),h.preventDefault())}),onKeyDown:be(o.onKeyDown,h=>{const b=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Mm.includes(h.key)&&(v(),h.preventDefault())})})})});el.displayName=Qa;var tl="SelectValue",rl=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=yt(tl,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=_e(t,l.onValueNodeChange);return De(()=>{c(d)},[c,d]),p.jsx(ke.span,{...a,ref:u,style:{pointerEvents:"none"},children:wl(l.value)?p.jsx(p.Fragment,{children:s}):i})});rl.displayName=tl;var Hm="SelectIcon",nl=E.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(ke.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});nl.displayName=Hm;var Vm="SelectPortal",ol=e=>p.jsx(kn,{asChild:!0,...e});ol.displayName=Vm;var Ot="SelectContent",il=E.forwardRef((e,t)=>{const r=yt(Ot,e.__scopeSelect),[n,o]=E.useState();if(De(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Rr.createPortal(p.jsx(sl,{scope:e.__scopeSelect,children:p.jsx(Tn.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(al,{...e,ref:t})});il.displayName=Ot;var Qe=10,[sl,kt]=Qt(Ot),Ym="SelectContentImpl",Zm=$t("SelectContent.RemoveScroll"),al=E.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:h,avoidCollisions:b,...g}=e,x=yt(Ot,r),[k,_]=E.useState(null),[C,I]=E.useState(null),A=_e(t,re=>_(re)),[D,R]=E.useState(null),[F,Y]=E.useState(null),N=On(r),[M,y]=E.useState(!1),B=E.useRef(!1);E.useEffect(()=>{if(k)return Fa(k)},[k]),qs();const te=E.useCallback(re=>{const[ie,...ae]=N().map(fe=>fe.ref.current),[oe]=ae.slice(-1),le=document.activeElement;for(const fe of re)if(fe===le||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ie&&C&&(C.scrollTop=0),fe===oe&&C&&(C.scrollTop=C.scrollHeight),fe==null||fe.focus(),document.activeElement!==le))return},[N,C]),U=E.useCallback(()=>te([D,k]),[te,D,k]);E.useEffect(()=>{M&&U()},[M,U]);const{onOpenChange:$,triggerPointerDownPosRef:Z}=x;E.useEffect(()=>{if(k){let re={x:0,y:0};const ie=oe=>{var le,fe;re={x:Math.abs(Math.round(oe.pageX)-(((le=Z.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((fe=Z.current)==null?void 0:fe.y)??0))}},ae=oe=>{re.x<=10&&re.y<=10?oe.preventDefault():k.contains(oe.target)||$(!1),document.removeEventListener("pointermove",ie),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ae,{capture:!0})}}},[k,$,Z]),E.useEffect(()=>{const re=()=>$(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[$]);const[ne,z]=xl(re=>{const ie=N().filter(le=>!le.disabled),ae=ie.find(le=>le.ref.current===document.activeElement),oe=yl(ie,re,ae);oe&&setTimeout(()=>oe.ref.current.focus())}),L=E.useCallback((re,ie,ae)=>{const oe=!B.current&&!ae;(x.value!==void 0&&x.value===ie||oe)&&(R(re),oe&&(B.current=!0))},[x.value]),K=E.useCallback(()=>k==null?void 0:k.focus(),[k]),q=E.useCallback((re,ie,ae)=>{const oe=!B.current&&!ae;(x.value!==void 0&&x.value===ie||oe)&&Y(re)},[x.value]),ee=n==="popper"?Xo:ll,ue=ee===Xo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(sl,{scope:r,content:k,viewport:C,onViewportChange:I,itemRefCallback:L,selectedItem:D,onItemLeave:K,itemTextRefCallback:q,focusSelectedItem:U,selectedItemText:F,position:n,isPositioned:M,searchRef:ne,children:p.jsx(Ko,{as:Zm,allowPinchZoom:!0,children:p.jsx(No,{asChild:!0,trapped:x.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:be(o,re=>{var ie;(ie=x.trigger)==null||ie.focus({preventScroll:!0}),re.preventDefault()}),children:p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:p.jsx(ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:re=>re.preventDefault(),...g,...ue,onPlaced:()=>y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,re=>{const ie=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ie&&re.key.length===1&&z(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let oe=N().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(re.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const le=re.target,fe=oe.indexOf(le);oe=oe.slice(fe+1)}setTimeout(()=>te(oe)),re.preventDefault()}})})})})})})});al.displayName=Ym;var Gm="SelectItemAlignedPosition",ll=E.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=yt(Ot,r),s=kt(Ot,r),[a,l]=E.useState(null),[c,d]=E.useState(null),u=_e(t,A=>d(A)),m=On(r),f=E.useRef(!1),v=E.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:g,focusSelectedItem:x}=s,k=E.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&g){const A=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),F=g.getBoundingClientRect();if(i.dir!=="rtl"){const le=F.left-D.left,fe=R.left-le,ve=A.left-fe,w=A.width+ve,X=Math.max(w,D.width),H=window.innerWidth-Qe,T=ko(fe,[Qe,Math.max(Qe,H-X)]);a.style.minWidth=w+"px",a.style.left=T+"px"}else{const le=D.right-F.right,fe=window.innerWidth-R.right-le,ve=window.innerWidth-A.right-fe,w=A.width+ve,X=Math.max(w,D.width),H=window.innerWidth-Qe,T=ko(fe,[Qe,Math.max(Qe,H-X)]);a.style.minWidth=w+"px",a.style.right=T+"px"}const Y=m(),N=window.innerHeight-Qe*2,M=h.scrollHeight,y=window.getComputedStyle(c),B=parseInt(y.borderTopWidth,10),te=parseInt(y.paddingTop,10),U=parseInt(y.borderBottomWidth,10),$=parseInt(y.paddingBottom,10),Z=B+te+M+$+U,ne=Math.min(b.offsetHeight*5,Z),z=window.getComputedStyle(h),L=parseInt(z.paddingTop,10),K=parseInt(z.paddingBottom,10),q=A.top+A.height/2-Qe,ee=N-q,ue=b.offsetHeight/2,re=b.offsetTop+ue,ie=B+te+re,ae=Z-ie;if(ie<=q){const le=Y.length>0&&b===Y[Y.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-h.offsetTop-h.offsetHeight,ve=Math.max(ee,ue+(le?K:0)+fe+U),w=ie+ve;a.style.height=w+"px"}else{const le=Y.length>0&&b===Y[0].ref.current;a.style.top="0px";const ve=Math.max(q,B+h.offsetTop+(le?L:0)+ue)+ae;a.style.height=ve+"px",h.scrollTop=ie-q+h.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=ne+"px",a.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,g,i.dir,n]);De(()=>k(),[k]);const[_,C]=E.useState();De(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const I=E.useCallback(A=>{A&&v.current===!0&&(k(),x==null||x(),v.current=!1)},[k,x]);return p.jsx(Xm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:I,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:p.jsx(ke.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ll.displayName=Gm;var Km="SelectPopperPosition",Xo=E.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Qe,...i}=e,s=Pn(r);return p.jsx(Wo,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xo.displayName=Km;var[Xm,qo]=Qt(Ot,{}),Jo="SelectViewport",cl=E.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=kt(Jo,r),s=qo(Jo,r),a=_e(t,i.onViewportChange),l=E.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),p.jsx(Tn.Slot,{scope:r,children:p.jsx(ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&u){const f=Math.abs(l.current-d.scrollTop);if(f>0){const v=window.innerHeight-Qe*2,h=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),g=Math.max(h,b);if(g<v){const x=g+f,k=Math.min(v,x),_=x-k;u.style.height=k+"px",u.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});cl.displayName=Jo;var dl="SelectGroup",[qm,Jm]=Qt(dl),Qm=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=_r();return p.jsx(qm,{scope:r,id:o,children:p.jsx(ke.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Qm.displayName=dl;var ul="SelectLabel",eg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Jm(ul,r);return p.jsx(ke.div,{id:o.id,...n,ref:t})});eg.displayName=ul;var In="SelectItem",[tg,fl]=Qt(In),hl=E.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=yt(In,r),l=kt(In,r),c=a.value===n,[d,u]=E.useState(i??""),[m,f]=E.useState(!1),v=_e(t,x=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,x,n,o)}),h=_r(),b=E.useRef("touch"),g=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(tg,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:E.useCallback(x=>{u(k=>k||((x==null?void 0:x.textContent)??"").trim())},[]),children:p.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(ke.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:v,onFocus:be(s.onFocus,()=>f(!0)),onBlur:be(s.onBlur,()=>f(!1)),onClick:be(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:be(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:be(s.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:be(s.onPointerMove,x=>{var k;b.current=x.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,x=>{var k;x.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:be(s.onKeyDown,x=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&x.key===" "||(Fm.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})})})})});hl.displayName=In;var Er="SelectItemText",pl=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=yt(Er,r),a=kt(Er,r),l=fl(Er,r),c=$m(Er,r),[d,u]=E.useState(null),m=_e(t,g=>u(g),l.onItemTextChange,g=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,v=E.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=c;return De(()=>(h(v),()=>b(v)),[h,b,v]),p.jsxs(p.Fragment,{children:[p.jsx(ke.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Rr.createPortal(i.children,s.valueNode):null]})});pl.displayName=Er;var ml="SelectItemIndicator",gl=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return fl(ml,r).isSelected?p.jsx(ke.span,{"aria-hidden":!0,...n,ref:t}):null});gl.displayName=ml;var Qo="SelectScrollUpButton",rg=E.forwardRef((e,t)=>{const r=kt(Qo,e.__scopeSelect),n=qo(Qo,e.__scopeSelect),[o,i]=E.useState(!1),s=_e(t,n.onScrollButtonChange);return De(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(bl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});rg.displayName=Qo;var ei="SelectScrollDownButton",ng=E.forwardRef((e,t)=>{const r=kt(ei,e.__scopeSelect),n=qo(ei,e.__scopeSelect),[o,i]=E.useState(!1),s=_e(t,n.onScrollButtonChange);return De(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(bl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ng.displayName=ei;var bl=E.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=kt("SelectScrollButton",r),s=E.useRef(null),a=On(r),l=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),De(()=>{var d;const c=a().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(ke.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:be(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),og="SelectSeparator",ig=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(ke.div,{"aria-hidden":!0,...n,ref:t})});ig.displayName=og;var ti="SelectArrow",sg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=yt(ti,r),s=kt(ti,r);return i.open&&s.position==="popper"?p.jsx($o,{...o,...n,ref:t}):null});sg.displayName=ti;var ag="SelectBubbleInput",vl=E.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=E.useRef(null),i=_e(n,o),s=Xp(t);return E.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const u=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(u)}},[s,t]),p.jsx(ke.select,{...r,style:{...Ra,...r.style},ref:i,defaultValue:t})});vl.displayName=ag;function wl(e){return e===""||e===void 0}function xl(e){const t=Me(e),r=E.useRef(""),n=E.useRef(0),o=E.useCallback(s=>{const a=r.current+s;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function yl(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=lg(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function lg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cg=Ja,kl=el,dg=rl,ug=nl,fg=ol,_l=il,hg=cl,Sl=hl,pg=pl,mg=gl;const gg=cg,bg=dg,Cl=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(kl,{ref:n,className:me("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,p.jsx(ug,{asChild:!0,children:p.jsx(Hr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Cl.displayName=kl.displayName;const El=E.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(fg,{children:p.jsx(_l,{ref:o,className:me("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:p.jsx(hg,{className:me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));El.displayName=_l.displayName;const Nl=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Sl,{ref:n,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(mg,{children:p.jsx(eo,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(pg,{children:t})]}));Nl.displayName=Sl.displayName;const Al=E.createContext(null);function zl(){const e=E.useContext(Al);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function jl({open:e,onOpenChange:t,children:r}){const[n,o]=E.useState(!1),i=e!==void 0,s=i?e:n,a=E.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=E.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(Al.Provider,{value:l,children:r})}function vg({asChild:e,children:t}){const{onOpenChange:r}=zl(),n=E.Children.only(t);return e&&E.isValidElement(n)?E.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):p.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Tl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=zl();if(E.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return ht.createPortal(p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),p.jsx("div",{role:"dialog","aria-modal":!0,className:me("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function Ol({className:e,...t}){return p.jsx("div",{className:me("flex flex-col gap-1.5 pb-4",e),...t})}function wg({className:e,...t}){return p.jsx("div",{className:me("flex justify-end gap-2 pt-4",e),...t})}function Pl({className:e,...t}){return p.jsx("h2",{className:me("text-sm font-semibold text-white",e),...t})}function Il({className:e,...t}){return p.jsx("p",{className:me("text-xs text-zinc-400",e),...t})}const Ue=E.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?Qf:"button";return p.jsx(c,{ref:i,type:"button",className:me(s,a[t],l[r],e),...o})});Ue.displayName="Button";const xg=["library","upload","url"];function yg({library:e,selectedId:t,onSelect:r}){const[n,o]=j.useState(""),[i,s]=j.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const d=i==="all"||(c.tags??[]).includes(i),u=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return d&&u});return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Vd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),p.jsx(yo,{value:n,onChange:c=>o(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>p.jsx("button",{type:"button",onClick:()=>s(c),className:me("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?p.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const d=t===c.id;return p.jsxs("button",{type:"button",onClick:()=>r(d?null:c.id),className:me("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",d?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[p.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:me("w-full h-full object-cover transition-[filter] duration-150",d?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),p.jsx("div",{className:me("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",d&&"opacity-100"),children:p.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),d&&p.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:p.jsx(eo,{size:14,className:"text-white"})})]},c.id)})}):p.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function kg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=j.useState(!1),i=j.useRef(null),s=j.useCallback(async d=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:d.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!d.type.startsWith("image/"))return;if(r){try{const m=await r(d);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:m==null?void 0:m.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:d.name,size:d.size,dataUrl:m})}catch{const m=new FileReader;m.onload=f=>{var v;t({name:d.name,size:d.size,dataUrl:(v=f.target)==null?void 0:v.result})},m.readAsDataURL(d)}return}const u=new FileReader;u.onload=m=>{var f;t({name:d.name,size:d.size,dataUrl:(f=m.target)==null?void 0:f.result})},u.readAsDataURL(d)},[t,r]),a=j.useCallback(d=>{var m,f;d.preventDefault(),d.stopPropagation(),o(!1);const u=(f=(m=d.dataTransfer)==null?void 0:m.files)==null?void 0:f[0];u&&s(u)},[s]),l=j.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=j.useCallback(d=>{var m;const u=(m=d.target.files)==null?void 0:m[0];u&&s(u)},[s]);return p.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:d=>{d.preventDefault(),d.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var d;return!e&&((d=i.current)==null?void 0:d.click())},className:me("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),p.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),p.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),p.jsx(Ue,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:d=>{d.stopPropagation(),t(null)},children:p.jsx(Yr,{size:14})})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:p.jsx(Qi,{size:22})}),p.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),p.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),p.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),p.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function _g({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=j.useState(""),[o,i]=j.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx(zt,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(yo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:me("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),p.jsx(Ue,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&p.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?p.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[p.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),p.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[p.jsx(eo,{size:14,className:"text-emerald-400"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:p.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[p.jsx(Ji,{size:32,className:"mb-3 opacity-40"}),p.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Sg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=ur(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=j.useState("library"),[a,l]=j.useState(null),[c,d]=j.useState(null),[u,m]=j.useState(null);j.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),j.useEffect(()=>{if(!e||i!=="upload")return;const g=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",g),()=>window.removeEventListener("beforeunload",g)},[e,i]),j.useEffect(()=>{if(!e||i!=="upload")return;const g=k=>{k.preventDefault()},x={capture:!0};return document.addEventListener("dragover",g,x),document.addEventListener("drop",g,x),window.addEventListener("dragover",g,x),window.addEventListener("drop",g,x),()=>{document.removeEventListener("dragover",g,x),document.removeEventListener("drop",g,x),window.removeEventListener("dragover",g,x),window.removeEventListener("drop",g,x)}},[e,i]);const f=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&u!=null,v=()=>{if(i==="library"&&a){const g=o.find(x=>x.id===a);g&&r({url:g.url,alt:g.alt})}else i==="upload"&&c?r({url:c.dataUrl,alt:c.name}):i==="url"&&u&&r({url:u,alt:""});setTimeout(()=>t(!1),0)},h=i==="library"&&a?"1 immagine selezionata":i==="upload"&&c?c.name:i==="url"&&u?"URL pronto":"Nessuna selezione",b=g=>{g.preventDefault(),g.stopPropagation()};return p.jsx(jl,{open:e,onOpenChange:t,children:p.jsxs(Tl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(Ol,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:p.jsx(Vr,{size:18})}),p.jsxs("div",{children:[p.jsx(Pl,{children:"Image Picker"}),p.jsx(Il,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),p.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex border-b border-zinc-800",children:xg.map(g=>p.jsxs("button",{type:"button",onClick:()=>s(g),className:me("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===g?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[g==="library"&&p.jsx(Vr,{size:14}),g==="upload"&&p.jsx(Qi,{size:14}),g==="url"&&p.jsx(Ji,{size:14}),g==="library"?"Libreria":g==="upload"?"Upload":"URL"]},g))}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&p.jsx(yg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(kg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(_g,{urlPreview:u,onUrlPreviewChange:m})]}),p.jsxs(wg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:h}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ue,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),p.jsx(Ue,{type:"button",size:"sm",disabled:!f,onClick:v,className:me(!f&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Dl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Cg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=ur(),[i,s]=j.useState(!1),[a,l]=j.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Dl(e.url,o):"",u=f=>{t(f),s(!1)},m=f=>{f.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:me("space-y-1.5",n),children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?p.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:f=>f.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:me("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[p.jsx("img",{src:d,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:f=>{f.target.style.display="none"}}),p.jsx("div",{className:me("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[p.jsx($d,{size:13}),p.jsx("span",{children:"Cambia"})]}),p.jsx(Ue,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:m,children:p.jsx(Yr,{size:13})})]})}),p.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):p.jsxs("button",{type:"button",onClick:()=>s(!0),className:me("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[p.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:p.jsx(Vr,{size:18})}),p.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),p.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),p.jsx(Sg,{open:i,onOpenChange:s,onSelect:u})]})},Rl=[{name:"layers",Icon:ro},{name:"github",Icon:Ud},{name:"arrow-right",Icon:Id},{name:"box",Icon:Rd},{name:"terminal",Icon:Kd},{name:"chevron-right",Icon:Ld},{name:"menu",Icon:Wd},{name:"x",Icon:Lt},{name:"sparkles",Icon:Zd},{name:"zap",Icon:qd}],er={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(yo,{type:"text",className:"h-7 text-[11px] bg-zinc-900/50 border-zinc-800 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(Xf,{className:"min-h-[80px] text-[11px] bg-zinc-900/50 border-zinc-800 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(gg,{value:t||"",onValueChange:r,children:[p.jsx(Cl,{className:"w-full h-7 text-[11px] bg-zinc-900/50 border-zinc-800 focus:ring-blue-600",children:p.jsx(bg,{placeholder:"Select..."})}),p.jsx(El,{className:"dark",children:n.map(o=>p.jsx(Nl,{value:o,className:"text-[11px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2 rounded border border-zinc-800/50 bg-zinc-900/20",children:[p.jsx(qf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(zt,{htmlFor:e,className:"text-[11px] font-medium cursor-pointer select-none text-zinc-300",children:e})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return p.jsx("div",{className:"mb-4",children:p.jsx(Cg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=j.useState(!1),i=Rl.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(jl,{open:n,onOpenChange:o,children:[p.jsx(vg,{asChild:!0,children:p.jsx(Ue,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?p.jsxs(p.Fragment,{children:[p.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):p.jsxs(p.Fragment,{children:[p.jsx(Vr,{size:16,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),p.jsxs(Tl,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(Ol,{children:[p.jsx(Pl,{className:"text-sm",children:"Choose icon"}),p.jsx(Il,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Rl.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:me("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:p.jsx(a,{size:20})},s))})]})]})]})}},ri=e=>{if(e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault)return ri(e._def.innerType);if(e instanceof je.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=ri(e.shape[r]));return t}return e instanceof je.z.ZodArray?[]:e instanceof je.z.ZodString?"":e instanceof je.z.ZodNumber?0:e instanceof je.z.ZodBoolean?!1:e instanceof je.z.ZodEnum?e._def.values[0]:null},Dn=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?Dn(e._def.innerType):e,Ll=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Dn(e);return r!==e?Ll(r):null},Rn=(e,t)=>e&&!t?"opacity-10":"opacity-100",tr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),Nr=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(u=>n.includes(u)):Object.keys(s),l=o==null?void 0:o[0],c=(l==null?void 0:l.fieldKey)??null,d=c!=null;return p.jsx("div",{className:"space-y-4",children:a.map(u=>{const m=s[u];if(!m)return null;const f=Dn(m),v=Ll(m)||"ui:text",h=t[u];if(v==="ui:editorial-markdown")return null;if(v==="ui:image-picker"&&f instanceof je.z.ZodObject){const _=tr(c,u),C=er["ui:image-picker"]||er["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(d,_)}`,..._?{"data-jp-focused-field":u}:{},children:p.jsx(C,{label:u,value:h,onChange:I=>r({...t,[u]:I})})},u)}if(f instanceof je.z.ZodObject){const _=h||{},C=tr(c,u);return p.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Rn(d,C)}`,...C?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),p.jsx("h4",{className:"text-[10px] font-black uppercase text-zinc-400 tracking-widest",children:u})]}),p.jsx(Nr,{schema:f,data:_,onChange:I=>r({...t,[u]:I}),expandedItemPath:o&&tr(l==null?void 0:l.fieldKey,u)?o.slice(1):void 0})]},u)}if(f instanceof je.z.ZodArray){const _=Array.isArray(h)?h:[],C=Dn(f.element),I=(F,Y)=>{if(Y<0||Y>=_.length)return;const N=[..._],[M]=N.splice(F,1);N.splice(Y,0,M),r({...t,[u]:N})},A=tr(c,u),R=tr(l==null?void 0:l.fieldKey,u)?l==null?void 0:l.itemId:void 0;return p.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Rn(d,A)}`,...A?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("label",{className:"text-[10px] font-black uppercase text-zinc-500 tracking-widest",children:[u," (",_.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const F=ri(C);r({...t,[u]:[..._,F]})},className:"flex items-center gap-1 px-2 py-1 bg-blue-600/10 hover:bg-blue-600/20 text-blue-500 rounded text-[10px] font-bold transition-colors",children:[p.jsx(no,{size:12})," Add Item"]})]}),p.jsx("div",{className:"space-y-2",children:_.map((F,Y)=>{const N=F,M=N.id||`legacy-${Y}`,y=(typeof N.title=="string"?N.title:null)||(typeof N.label=="string"?N.label:null)||(typeof N.name=="string"?N.name:null)||(typeof N.content=="string"?N.content:null)||(typeof N.text=="string"?N.text:null)||`${u} #${Y+1}`,B=R,te=String(N.id??M),U=B!=null&&String(B)===te,$=U&&o&&o.length>1?o.slice(1):void 0,Z=d&&A&&B!=null&&!U;return p.jsx(Eg,{itemId:te,openItemId:B!=null?String(B):void 0,isFaded:Z,index:Y,isFirst:Y===0,isLast:Y===_.length-1,label:y,onExpandedChange:i?ne=>i(ne?{fieldKey:u,itemId:te}:null):void 0,onRemove:()=>{const ne=_.filter((z,L)=>L!==Y);r({...t,[u]:ne})},onMoveUp:()=>I(Y,Y-1),onMoveDown:()=>I(Y,Y+1),children:C instanceof je.z.ZodObject?p.jsx(Nr,{schema:C,data:N||{},expandedItemPath:$,onChange:ne=>{const z=[..._];z[Y]=ne,r({...t,[u]:z})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},u)}const b=v in er?v:"ui:text",g=er[b]||er["ui:text"],x=f instanceof je.z.ZodEnum?f._def.values:void 0,k=tr(c,u);return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(d,k)}`,...k?{"data-jp-focused-field":u}:{},children:p.jsx(g,{label:u,value:h,options:x,onChange:_=>r({...t,[u]:_})})},u)})})},Eg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:c,children:d})=>{const u=t!=null&&String(t)===String(e),[m,f]=j.useState(u);j.useEffect(()=>{u&&!m&&f(!0),!u&&m&&f(!1)},[u,m]);const v=()=>{const b=!m;f(b),o==null||o(b)},h=u&&m;return p.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...h?{"data-jp-expanded-item":e}:{},children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[p.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:p.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-2 text-[10px] font-bold text-zinc-300 uppercase tracking-tight truncate",children:[m?p.jsx(to,{size:12,className:"shrink-0"}):p.jsx(Hr,{size:12,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n})]})}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[p.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Dd,{size:12})}),p.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Pd,{size:12})}),p.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),p.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:p.jsx(Yr,{size:12})})]})]}),m&&p.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function Ng(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var ut=e=>{const{present:t,children:r}=e,n=Ag(t),o=typeof r=="function"?r({present:n.isPresent}):E.Children.only(r),i=_e(n.ref,zg(o));return typeof r=="function"||n.isPresent?E.cloneElement(o,{ref:i}):null};ut.displayName="Presence";function Ag(e){const[t,r]=E.useState(),n=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ng(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Ln(n.current);i.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,f=Ln(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),De(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=f=>{const h=Ln(n.current).includes(CSS.escape(f.animationName));if(f.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=f=>{f.target===t&&(i.current=Ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Ln(e){return(e==null?void 0:e.animationName)||"none"}function zg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Mn]=Wt("Tooltip",[Gt]),Fn=Gt(),Ml="TooltipProvider",jg=700,ni="tooltip.open",[Tg,oi]=Mn(Ml),Fl=e=>{const{__scopeTooltip:t,delayDuration:r=jg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Tg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Fl.displayName=Ml;var Ar="Tooltip",[Og,zr]=Mn(Ar),Bl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=oi(Ar,e.__scopeTooltip),c=Fn(t),[d,u]=E.useState(null),m=_r(),f=E.useRef(0),v=s??l.disableHoverableContent,h=a??l.delayDuration,b=E.useRef(!1),[g,x]=_n({prop:n,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ni))):l.onClose(),i==null||i(A)},caller:Ar}),k=E.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),_=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,x(!0)},[x]),C=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x(!1)},[x]),I=E.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,x(!0),f.current=0},h)},[h,x]);return E.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx(Uo,{...c,children:p.jsx(Og,{scope:t,contentId:m,open:g,stateAttribute:k,trigger:d,onTriggerChange:u,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?I():_()},[l.isOpenDelayedRef,I,_]),onTriggerLeave:E.useCallback(()=>{v?C():(window.clearTimeout(f.current),f.current=0)},[C,v]),onOpen:_,onClose:C,disableHoverableContent:v,children:r})})};Bl.displayName=Ar;var ii="TooltipTrigger",Ul=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=zr(ii,r),i=oi(ii,r),s=Fn(r),a=E.useRef(null),l=_e(t,a,o.onTriggerChange),c=E.useRef(!1),d=E.useRef(!1),u=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(yn,{asChild:!0,...s,children:p.jsx(ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:be(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});Ul.displayName=ii;var si="TooltipPortal",[Pg,Ig]=Mn(si,{forceMount:void 0}),Wl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=zr(si,t);return p.jsx(Pg,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};Wl.displayName=si;var rr="TooltipContent",$l=E.forwardRef((e,t)=>{const r=Ig(rr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=zr(rr,e.__scopeTooltip);return p.jsx(ut,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Hl,{side:o,...i,ref:t}):p.jsx(Dg,{side:o,...i,ref:t})})}),Dg=E.forwardRef((e,t)=>{const r=zr(rr,e.__scopeTooltip),n=oi(rr,e.__scopeTooltip),o=E.useRef(null),i=_e(t,o),[s,a]=E.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:u}=n,m=E.useCallback(()=>{a(null),u(!1)},[u]),f=E.useCallback((v,h)=>{const b=v.currentTarget,g={x:v.clientX,y:v.clientY},x=Bg(g,b.getBoundingClientRect()),k=Ug(g,x),_=Wg(h.getBoundingClientRect()),C=Hg([...k,..._]);a(C),u(!0)},[u]);return E.useEffect(()=>()=>m(),[m]),E.useEffect(()=>{if(l&&d){const v=b=>f(b,d),h=b=>f(b,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",h)}}},[l,d,f,m]),E.useEffect(()=>{if(s){const v=h=>{const b=h.target,g={x:h.clientX,y:h.clientY},x=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!$g(g,s);x?m():k&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,m]),p.jsx(Hl,{...e,ref:i})}),[Rg,Lg]=Mn(Ar,{isInside:!1}),Mg=th("TooltipContent"),Hl=E.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=zr(rr,r),c=Fn(r),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(ni,d),()=>document.removeEventListener(ni,d)),[d]),E.useEffect(()=>{if(l.trigger){const u=m=>{const f=m.target;f!=null&&f.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:p.jsxs(Wo,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Mg,{children:n}),p.jsx(Rg,{scope:r,isInside:!0,children:p.jsx(Jp,{id:l.contentId,role:"tooltip",children:o||n})})]})})});$l.displayName=rr;var Vl="TooltipArrow",Fg=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Fn(r);return Lg(Vl,r).isInside?null:p.jsx($o,{...o,...n,ref:t})});Fg.displayName=Vl;function Bg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Ug(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Wg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function $g(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,d=a.y,u=l.x,m=l.y;d>n!=m>n&&r<(u-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function Hg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Vg(t)}function Vg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Yg=Fl,Zg=Bl,Gg=Ul,Kg=Wl,Yl=$l;const Xg=Yg,jr=Zg,Tr=Gg,nr=E.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(Kg,{children:p.jsx(Yl,{ref:n,sideOffset:t,className:me("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));nr.displayName=Yl.displayName;var Bn="Popover",[Zl]=Wt(Bn,[Gt]),Or=Gt(),[qg,_t]=Zl(Bn),Gl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Or(t),l=E.useRef(null),[c,d]=E.useState(!1),[u,m]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Bn});return p.jsx(Uo,{...a,children:p.jsx(qg,{scope:t,contentId:_r(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:E.useCallback(()=>m(f=>!f),[m]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:s,children:r})})};Gl.displayName=Bn;var Kl="PopoverAnchor",Jg=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Kl,r),i=Or(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return E.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(yn,{...i,...n,ref:t})});Jg.displayName=Kl;var Xl="PopoverTrigger",ql=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Xl,r),i=Or(r),s=_e(t,o.triggerRef),a=p.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rc(o.open),...n,ref:s,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(yn,{asChild:!0,...i,children:a})});ql.displayName=Xl;var ai="PopoverPortal",[Qg,e0]=Zl(ai,{forceMount:void 0}),Jl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=_t(ai,t);return p.jsx(Qg,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};Jl.displayName=ai;var or="PopoverContent",Ql=E.forwardRef((e,t)=>{const r=e0(or,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=_t(or,e.__scopePopover);return p.jsx(ut,{present:n||i.open,children:i.modal?p.jsx(r0,{...o,ref:t}):p.jsx(n0,{...o,ref:t})})});Ql.displayName=or;var t0=$t("PopoverContent.RemoveScroll"),r0=E.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=E.useRef(null),o=_e(t,n),i=E.useRef(!1);return E.useEffect(()=>{const s=n.current;if(s)return Fa(s)},[]),p.jsx(Ko,{as:t0,allowPinchZoom:!0,children:p.jsx(ec,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:be(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),n0=E.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=E.useRef(!1),o=E.useRef(!1);return p.jsx(ec,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ec=E.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,m=_t(or,r),f=Or(r);return qs(),p.jsx(No,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(Wo,{"data-state":rc(m.open),role:"dialog",id:m.contentId,...f,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tc="PopoverClose",o0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(tc,r);return p.jsx(ke.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});o0.displayName=tc;var i0="PopoverArrow",s0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Or(r);return p.jsx($o,{...o,...n,ref:t})});s0.displayName=i0;function rc(e){return e?"open":"closed"}var a0=Gl,l0=ql,c0=Jl,nc=Ql;const d0=a0,u0=l0,oc=E.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(c0,{children:p.jsx(nc,{ref:o,align:t,sideOffset:r,className:me("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));oc.displayName=nc.displayName;const ic=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",f0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=j.useState(!1),c=s??ic(t),d=u=>{r(u),l(!1)};return p.jsx("div",{className:me("mx-3 mt-2 mb-2",i),children:p.jsxs(d0,{open:a,onOpenChange:l,children:[p.jsx(u0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:me("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[p.jsx(Bd,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),p.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),p.jsx(Hr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),p.jsxs(oc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(u=>{const m=u===t,f=ic(u);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(u),className:me("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",m?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[p.jsx("span",{children:f}),n!=null&&p.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},u)}),o!=null&&p.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:p.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[p.jsx(no,{size:12,"aria-hidden":!0}),p.jsx("span",{children:"New page"})]})})]})]})})};function h0(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var li="ScrollArea",[sc]=Wt(li),[p0,Ye]=sc(li),ac=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=E.useState(null),[c,d]=E.useState(null),[u,m]=E.useState(null),[f,v]=E.useState(null),[h,b]=E.useState(null),[g,x]=E.useState(0),[k,_]=E.useState(0),[C,I]=E.useState(!1),[A,D]=E.useState(!1),R=_e(t,Y=>l(Y)),F=Ys(o);return p.jsx(p0,{scope:r,type:n,dir:F,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:m,scrollbarX:f,onScrollbarXChange:v,scrollbarXEnabled:C,onScrollbarXEnabledChange:I,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:x,onCornerHeightChange:_,children:p.jsx(ke.div,{dir:F,...s,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});ac.displayName=li;var lc="ScrollAreaViewport",cc=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ye(lc,r),a=E.useRef(null),l=_e(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(ke.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});cc.displayName=lc;var it="ScrollAreaScrollbar",dc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return E.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(m0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(g0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(uc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(ci,{...n,ref:t}):null});dc.displayName=it;var m0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),[i,s]=E.useState(!1);return E.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(ut,{present:r||i,children:p.jsx(uc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),g0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Hn(()=>l("SCROLL_END"),100),[a,l]=h0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),E.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let u=c[d];const m=()=>{const f=c[d];u!==f&&(l("SCROLL"),s()),u=f};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[o.viewport,i,l,s]),p.jsx(ut,{present:r||a!=="hidden",children:p.jsx(ci,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),uc=E.forwardRef((e,t)=>{const r=Ye(it,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=E.useState(!1),a=e.orientation==="horizontal",l=Hn(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?c:d)}},10);return ir(r.viewport,l),ir(r.content,l),p.jsx(ut,{present:n||i,children:p.jsx(ci,{"data-state":i?"visible":"hidden",...o,ref:t})})}),ci=E.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ye(it,e.__scopeScrollArea),i=E.useRef(null),s=E.useRef(0),[a,l]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=gc(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function u(m,f){return k0(m,s.current,a,f)}return r==="horizontal"?p.jsx(b0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,f=bc(m,a,o.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=u(m,o.dir))}}):r==="vertical"?p.jsx(v0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,f=bc(m,a);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=u(m))}}):null}),b0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ye(it,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=_e(t,l,i.onScrollbarXChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(hc,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$n(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),wc(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Wn(s.paddingLeft),paddingEnd:Wn(s.paddingRight)}})}})}),v0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ye(it,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=_e(t,l,i.onScrollbarYChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(hc,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$n(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),wc(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Wn(s.paddingTop),paddingEnd:Wn(s.paddingBottom)}})}})}),[w0,fc]=sc(it),hc=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...m}=e,f=Ye(it,r),[v,h]=E.useState(null),b=_e(t,R=>h(R)),g=E.useRef(null),x=E.useRef(""),k=f.viewport,_=n.content-n.viewport,C=Me(d),I=Me(l),A=Hn(u,10);function D(R){if(g.current){const F=R.clientX-g.current.left,Y=R.clientY-g.current.top;c({x:F,y:Y})}}return E.useEffect(()=>{const R=F=>{const Y=F.target;(v==null?void 0:v.contains(Y))&&C(F,_)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[k,v,_,C]),E.useEffect(I,[n,I]),ir(v,A),ir(f.content,A),p.jsx(w0,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Me(i),onThumbPointerUp:Me(s),onThumbPositionChange:I,onThumbPointerDown:Me(a),children:p.jsx(ke.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:be(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),g.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),D(R))}),onPointerMove:be(e.onPointerMove,D),onPointerUp:be(e.onPointerUp,R=>{const F=R.target;F.hasPointerCapture(R.pointerId)&&F.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Un="ScrollAreaThumb",pc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=fc(Un,e.__scopeScrollArea);return p.jsx(ut,{present:r||o.hasThumb,children:p.jsx(x0,{ref:t,...n})})}),x0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ye(Un,r),s=fc(Un,r),{onThumbPositionChange:a}=s,l=_e(t,u=>s.onThumbChange(u)),c=E.useRef(void 0),d=Hn(()=>{c.current&&(c.current(),c.current=void 0)},100);return E.useEffect(()=>{const u=i.viewport;if(u){const m=()=>{if(d(),!c.current){const f=_0(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(ke.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:be(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),v=u.clientX-f.left,h=u.clientY-f.top;s.onThumbPointerDown({x:v,y:h})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});pc.displayName=Un;var di="ScrollAreaCorner",mc=E.forwardRef((e,t)=>{const r=Ye(di,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(y0,{...e,ref:t}):null});mc.displayName=di;var y0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ye(di,r),[i,s]=E.useState(0),[a,l]=E.useState(0),c=!!(i&&a);return ir(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),ir(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(ke.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Wn(e){return e?parseInt(e,10):0}function gc(e,t){const r=e/t;return isNaN(r)?0:r}function $n(e){const t=gc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function k0(e,t,r,n="ltr"){const o=$n(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,u=n==="ltr"?[0,d]:[d*-1,0];return vc([l,c],u)(e)}function bc(e,t,r="ltr"){const n=$n(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=ko(e,l);return vc([0,s],[0,a])(c)}function vc(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function wc(e,t){return e>0&&e<t}var _0=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,a=r.top!==i.top;(s||a)&&t(),r=i,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function Hn(e,t){const r=Me(e),n=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),E.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ir(e,t){const r=Me(t);De(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var xc=ac,S0=cc,C0=dc,E0=pc,N0=mc;const yc=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(xc,{ref:n,className:me("relative overflow-hidden",e),...r,children:[p.jsx(S0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(C0,{orientation:"vertical",className:"flex touch-none select-none transition-colors h-full w-1.5 border-l border-l-transparent p-px",children:p.jsx(E0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(N0,{})]}));yc.displayName=xc.displayName;const ui=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),kc=new Set(["ui:editorial-markdown"]),_c=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?_c(e._def.innerType):e,fi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=_c(e);return o!==e?fi(o):""},A0={activationConstraint:{distance:8}},z0={activationConstraint:{delay:200,tolerance:5}};function hi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:c}=t,d=!!r;return p.jsxs("div",{className:me("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",d?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[d?p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:p.jsx(qi,{size:12,className:"text-zinc-600"})}):p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:p.jsx(qi,{size:12,className:"text-zinc-600/50"})}),p.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:me("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),p.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),p.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:u=>{u.stopPropagation(),l(u)},children:p.jsx(Yd,{size:12})})}),p.jsx(nr,{children:"Settings"})]}),s&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:u=>{u.stopPropagation(),c()},children:p.jsx(Yr,{size:12})})}),p.jsx(nr,{children:"Delete section"})]})]})]})}function j0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Vf({id:e.id,disabled:!t.canReorder}),l={transform:gt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:l,className:me(a&&"z-10"),children:p.jsx(hi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const Sc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:d,onDeleteSection:u,onAddSection:m,hasChanges:f=!1,onExportHTML:v,onSaveToFile:h,saveSuccessFeedback:b=!1,onResetToFile:g,showResetToFile:x=!1,pageSlugs:k=[],currentSlug:_="home",onPageChange:C})=>{const{schemas:I}=ur(),[A,D]=j.useState(!0),[R,F]=j.useState(null),[Y,N]=j.useState(null),[M,y]=j.useState(null),[B,te]=j.useState(null),U=j.useRef(null),$=j.useRef(null),Z=gu(lo(go,A0),lo(_s,z0),lo(po,{coordinateGetter:Gf})),ne=j.useDeferredValue(e),z=e!=null&&(ne==null?void 0:ne.id)!==e.id,L=s&&s.length>0?s:M?[M]:null,K=L!=null&&L.length?{fieldKey:L[L.length-1].fieldKey,itemId:L[L.length-1].itemId}:null,q=j.useRef(s);j.useEffect(()=>{q.current!=null&&s==null&&y(null),q.current=s},[s]),j.useEffect(()=>{(e==null?void 0:e.id)!=null&&D(!1)},[e==null?void 0:e.id]);const ee=()=>{const O=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const V=U.current;V&&V.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(O)},ue=j.useRef(A);j.useEffect(()=>{if(A&&!ue.current){const O=ee();return ue.current=A,O}ue.current=A},[A]),j.useEffect(()=>{if(!K)return;const O=U.current;if(!O)return;const V=requestAnimationFrame(()=>{const J=O.querySelector("[data-jp-expanded-item]")??O.querySelector("[data-jp-focused-field]");J&&J.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(V)},[K]);const re=O=>{D(!1),d==null||d(O)},ie=()=>{D(O=>{const V=!O;return V&&ee(),V})},ae=(O,V)=>{V.stopPropagation(),r.length>0&&o?te(O):(D(!1),d==null||d(O))};j.useEffect(()=>{if(B==null)return;const O=V=>{V.key==="Escape"&&te(null)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[B]);const oe=O=>{R===O?(u==null||u(O),F(null)):(F(O),setTimeout(()=>F(null),3e3))},le=j.useMemo(()=>l.filter(O=>O.scope==="local").map(O=>O.id),[l]),fe=!!a&&le.length>0,ve=O=>{N(O.active.id)},w=O=>{N(null);const{active:V,over:J}=O;if(!J||V.id===J.id||!a)return;const Q=l.findIndex(he=>he.id===V.id),se=l.findIndex(he=>he.id===J.id);if(Q===-1||se===-1)return;const pe=Q<se?se:se-1;a(V.id,pe)},X=e?t.sections.find(O=>O.id===e.id):void 0,H=ne?t.sections.find(O=>O.id===ne.id):void 0,T=ne?I[ne.type]:void 0,S=j.useMemo(()=>{if(!T)return!1;const O=T.shape,V=Object.keys(O).filter(J=>!ui.has(J));return V.length===0?!1:V.every(J=>kc.has(fi(O[J])))},[T]);j.useEffect(()=>{(e==null?void 0:e.id)!=null&&S&&D(!0)},[e==null?void 0:e.id,S]);const P=l.length>0&&(A||!e),W=_?_.charAt(0).toUpperCase()+_.slice(1):"Select page",G=j.useMemo(()=>{const O=[];let V=null;for(const J of l){const Q=J.type.toUpperCase(),se=V!==null&&(V==="HEADER"&&Q!=="HEADER"||V!=="HEADER"&&V!=="FOOTER"&&Q==="FOOTER");O.push({layer:J,showSeparatorAbove:se}),V=Q}return O},[l]);return p.jsx(Xg,{children:p.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),p.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-primary font-bold",children:e.type}),p.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),p.jsx("span",{className:"uppercase",children:e.scope})]}):p.jsxs("span",{className:"text-zinc-600",children:[W," · ",l.length," sections"]})})]}),p.jsx(Ue,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Lt,{size:14})})]}),k.length>0&&C&&p.jsx(f0,{pageSlugs:k,currentSlug:_,onPageChange:C,sectionCount:l.length,currentPageLabel:W}),l.length>0&&p.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[p.jsxs("button",{type:"button",onClick:ie,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":P,"aria-label":P?"Collapse Page Layers":"Expand Page Layers",children:[p.jsx(ro,{size:14,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),p.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),p.jsx(to,{size:13,className:me("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!A&&"rotate-180")})]}),m!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(no,{size:14})})}),p.jsx(nr,{children:"Add section"})]})]}),p.jsxs(yc,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:U,className:"flex flex-col min-h-0",children:P&&p.jsxs("div",{className:"py-1",children:[p.jsxs(pf,{sensors:Z,collisionDetection:wu,modifiers:[Of],onDragStart:ve,onDragEnd:w,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:O})=>O?`Posizione ${le.indexOf(String(O.id))+1} di ${le.length}.`:void 0,onDragEnd:({over:O})=>O?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Mf,{items:le,strategy:Rf,children:p.jsx("div",{className:"px-2 space-y-0.5",children:G.map(({layer:O,showSeparatorAbove:V})=>p.jsxs(j.Fragment,{children:[V&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),O.scope==="local"&&fe?p.jsx(j0,{layer:O,opts:{isSelected:(e==null?void 0:e.id)===O.id,isActive:c===O.id,isDragging:!1,canReorder:!0,canDelete:!!u,deleteConfirm:R===O.id,onSelect:()=>re(O.id),onDelete:()=>oe(O.id),onOpenSettings:J=>ae(O.id,J)}}):p.jsx("div",{children:p.jsx(hi,{layer:O,opts:{isSelected:(e==null?void 0:e.id)===O.id,isActive:c===O.id,isDragging:!1,canDelete:O.scope==="local"&&!!u,deleteConfirm:R===O.id,onSelect:()=>re(O.id),onDelete:()=>oe(O.id),onOpenSettings:J=>ae(O.id,J)}})})]},O.id))})}),p.jsx(Tf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Y?(()=>{const O=l.find(V=>V.id===Y);return O?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(hi,{layer:O,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),R&&p.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[p.jsx(Md,{size:12,className:"text-amber-500 shrink-0"}),p.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),K&&X&&(()=>{const O=X.data||{};let V;if(L&&L.length>0){let J=O;for(const pe of L){const he=J==null?void 0:J[pe.fieldKey];pe.itemId!=null&&Array.isArray(he)?J=he.find(Se=>String(Se==null?void 0:Se.id)===String(pe.itemId))??null:J=he}const Q=J||{},se=K.fieldKey;V=(typeof Q.name=="string"?Q.name:null)??(typeof Q.title=="string"?Q.title:null)??(typeof Q.label=="string"?Q.label:null)??se.charAt(0).toUpperCase()+se.slice(1).replace(/([A-Z])/g," $1").trim()}else{const J=K.fieldKey;if(K.itemId!=null){const pe=(Array.isArray(O[J])?O[J]:[]).find(he=>String(he==null?void 0:he.id)===String(K.itemId))||{};V=(typeof pe.name=="string"?pe.name:null)??(typeof pe.title=="string"?pe.title:null)??(typeof pe.label=="string"?pe.label:null)??J}else V=J.charAt(0).toUpperCase()+J.slice(1).replace(/([A-Z])/g," $1").trim()}return p.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[p.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),p.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:V})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&D(!1),children:e?z?p.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):T?(()=>{const V=Object.keys(T.shape).filter(Q=>!ui.has(Q)&&!kc.has(fi(T.shape[Q]))),J=(H==null?void 0:H.data)||{};return V.length===0?p.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):p.jsx(Nr,{schema:T,data:J,onChange:Q=>n(Q),keys:V,expandedItemPath:L,onSidebarExpandedItemChange:y})})():p.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(ne==null?void 0:ne.type)??e.type]}):p.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]}),p.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center gap-3 opacity-100 flex-wrap shrink-0",children:(v!=null||h!=null||g!=null)&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:me("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",f?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),p.jsx("span",{className:me("text-xs font-medium transition-colors duration-300 shrink-0",b?"text-emerald-400":f?"text-amber-500":"text-zinc-500"),children:b?"Salvato":f?"Unsaved Changes":"All Changes Saved"}),v!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs(Ue,{variant:"outline",size:"sm",className:"gap-1.5",onClick:v,children:[p.jsx(Xi,{size:12}),p.jsx("span",{children:"Bake HTML"})]})}),p.jsx(nr,{children:"Generate static HTML output"})]}),h!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs(Ue,{size:"sm",disabled:!f,className:"gap-1.5",onClick:O=>{O.preventDefault(),O.stopPropagation(),h()},children:[p.jsx(Hd,{size:12}),p.jsx("span",{children:"Save"})]})}),p.jsx(nr,{children:"Save (export JSON)"})]}),g!=null&&x&&p.jsx("button",{type:"button",onClick:g,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:p.jsx("span",{children:"Ripristina da file"})})]})}),B!=null&&r.length>0&&o!=null&&(()=>{const O=r.find(Se=>Se.id===B),V=l.find(Se=>Se.id===B);if(!O)return null;const J=(V==null?void 0:V.scope)==="global"?"global":"local",Q=O.type,se=I[Q],he=(se?Object.keys(se.shape):[]).filter(Se=>ui.has(Se)),Ae=O.data??{};return he.length===0?p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>te(null),children:p.jsxs("div",{ref:$,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:Se=>Se.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",Q]}),p.jsx("button",{type:"button",onClick:()=>te(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"p-4",children:p.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:Se=>Se.target===Se.currentTarget&&te(null),children:p.jsxs("div",{ref:$,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:Se=>Se.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",Q]}),p.jsx("button",{type:"button",onClick:()=>te(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(Nr,{schema:se,data:Ae,onChange:Se=>{const ze={...O.data,...Se};o(B,J,Q,ze)},keys:he})})]})})})()]})})},Cc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=j.useRef(null),l=j.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return j.useEffect(()=>{l()},[l]),j.useEffect(()=>{const c=d=>{d.data.type===Ce.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),j.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.SYNC_SELECTION,selectedId:o},"*")},[o]),j.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:Ce.REQUEST_SCROLL_TO_SECTION,sectionId:i},"*"),s==null||s())},[i,s]),p.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:p.jsx("iframe",{ref:a,src:`/admin/preview/${n}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},Vn={setTheme:e=>{const t=document.documentElement,{tokens:r}=e,n={"--theme-primary":r.colors.primary,"--theme-secondary":r.colors.secondary,"--theme-accent":r.colors.accent,"--theme-background":r.colors.background,"--theme-surface":r.colors.surface,"--theme-surface-alt":r.colors.surfaceAlt,"--theme-text":r.colors.text,"--theme-text-muted":r.colors.textMuted,"--theme-border":r.colors.border,"--theme-font-primary":r.typography.fontFamily.primary,"--theme-font-mono":r.typography.fontFamily.mono,"--theme-radius-sm":r.borderRadius.sm,"--theme-radius-md":r.borderRadius.md,"--theme-radius-lg":r.borderRadius.lg};Object.entries(n).forEach(([o,i])=>{t.style.setProperty(o,i)})}},T0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',Ec=()=>{var f;const[e,t]=j.useState(null),[r,n]=j.useState(null),[o,i]=j.useState(null),[s,a]=j.useState(null),[l,c]=j.useState(!1);if(j.useEffect(()=>{const v=h=>{if(!(h.origin!==window.location.origin||h.source!==window.parent)){if(h.data.type===Ce.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Vn.setTheme(h.data.themeConfig)),h.data.type===Ce.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===Ce.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===Ce.REQUEST_INLINE_FLUSH){const b=typeof h.data.requestId=="string"?h.data.requestId:null;window.dispatchEvent(new CustomEvent(Ce.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:Ce.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}h.data.type===Ce.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:Ce.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))}};return window.addEventListener("message",v),window.parent.postMessage({type:Ce.STAGE_READY},"*"),()=>window.removeEventListener("message",v)},[]),j.useEffect(()=>{const v=b=>!!(b.closest(T0)||b.closest("a[href]")),h=b=>{var M,y,B,te,U,$,Z,ne;const g=b.target;if(v(g)){g.closest("a[href]")&&b.preventDefault();return}const x=b.clientX,k=b.clientY;let _=null,C=g;for(;C&&C!==document.body;){const z=(M=C.getAttribute)==null?void 0:M.call(C,"data-section-id"),L=(y=C.getAttribute)==null?void 0:y.call(C,"data-section-type"),K=(B=C.getAttribute)==null?void 0:B.call(C,"data-section-scope");if(z&&L&&K){_=C;break}C=C.parentElement}if(!_)return;b.preventDefault(),b.stopPropagation();const I=_.getAttribute("data-section-id"),A=_.getAttribute("data-section-type"),D=_.getAttribute("data-section-scope");if(!I||!A||!D)return;const R={id:I,type:A,scope:D};if(g===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}const F=document.elementFromPoint(x,k)??g;if(!F||!_.contains(F)){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}if(F===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}const Y=[];for(C=F;C&&C!==_;){const z=(te=C.getAttribute)==null?void 0:te.call(C,"data-jp-item-id"),L=(U=C.getAttribute)==null?void 0:U.call(C,"data-jp-item-field");z&&L&&Y.push({fieldKey:L||"items",itemId:z}),C=C.parentElement}if(Y.reverse(),Y.length===0)for(C=F;C&&C!==_;){const z=($=C.getAttribute)==null?void 0:$.call(C,"data-jp-field");if(z){Y.push({fieldKey:z});break}C=C.parentElement}if(Y.length===0&&F){let z=null;const L=K=>{var ee,ue;const q=K.getBoundingClientRect();if(q.left<=x&&x<=q.right&&q.top<=k&&k<=q.bottom){for(let re=0;re<K.children.length;re++)L(K.children[re]);((ee=K.getAttribute)!=null&&ee.call(K,"data-jp-item-id")||(ue=K.getAttribute)!=null&&ue.call(K,"data-jp-field"))&&(z=K)}};if(L(F),z){const K=z,q=(Z=K.getAttribute)==null?void 0:Z.call(K,"data-jp-item-id"),ee=(ne=K.getAttribute)==null?void 0:ne.call(K,"data-jp-field");q&&ee?Y.push({fieldKey:ee||"items",itemId:q}):ee&&Y.push({fieldKey:ee})}}const N={type:Ce.SECTION_SELECT,section:R};Y.length>0&&(N.itemPath=Y),window.parent.postMessage(N,"*")};return document.addEventListener("click",h,!0),()=>document.removeEventListener("click",h,!0)},[]),j.useEffect(()=>{if(!s)return;const v=setTimeout(()=>a(null),600);return()=>clearTimeout(v)},[s]),!e||!r)return p.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const d=(f=r.header)==null?void 0:f.data,u={main:(d==null?void 0:d.links)??[]},m=v=>{window.parent.postMessage({type:Ce.ACTIVE_SECTION_CHANGED,activeSectionId:v},"*")};return p.jsx($r,{mode:l?"visitor":"studio",children:p.jsx("div",{className:l?"":"jp-ice-active",children:p.jsx(oo,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:l?null:o,scrollToSectionId:s,onActiveSectionChange:m})})})};function O0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Nc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(j.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??O0(s);return p.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[p.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),p.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:p.jsx(ro,{size:18})}),p.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),p.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:p.jsx(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?p.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):p.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>p.jsx("li",{role:"option",children:p.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:me("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[p.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),p.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),p.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:p.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},Ac=()=>p.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[p.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),p.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),p.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]}),P0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[80px\\]{min-height:80px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-blue-900\\/20{--tw-shadow-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-900\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-900)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class I0 extends j.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?p.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[p.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),p.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function pi(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function zc(e,t=""){const r=pi(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return pi(o)||"home"}const jc=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const s=He.useLocation(),a=zc(s.pathname),[l,c]=j.useState(null);j.useEffect(()=>{const f=document.getElementById("jp-baked-state");if(f!=null&&f.textContent)try{const v=JSON.parse(f.textContent);c(v),Vn.setTheme(v.theme)}catch(v){console.error("Failed to parse baked state",v)}},[]);const d=l?l.page:e[a],u=l?l.site:t,m=l?l.menu:r;return d?p.jsx(Zr,{mode:"tenant",tenantCss:n,adminCss:o,children:p.jsx($r,{mode:"visitor",children:p.jsx(oo,{pageConfig:d,siteConfig:u,menuConfig:m})})}):p.jsx(i,{})},Tc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,exportHTML:c})=>{const d=He.useLocation(),u=zc(d.pathname,"admin"),m=He.useNavigate(),f=Object.keys(e).sort((S,P)=>S==="home"?-1:P==="home"?1:S.localeCompare(P)),[v,h]=j.useState(null),[b,g]=j.useState(!1),[x,k]=j.useState(!1),[_,C]=j.useState(()=>{var S;try{const P=JSON.parse(JSON.stringify(t??{}));P.identity||(P.identity={title:"Site"}),P.pages||(P.pages=[]);const W=(S=P.header)==null?void 0:S.data;return W&&(r!=null&&r.main)&&(W.links=JSON.parse(JSON.stringify(r.main))),P}catch{return{identity:{title:"Site"},pages:[]}}}),[I,A]=j.useState(null),[D,R]=j.useState(null),[F,Y]=j.useState(null),[N,M]=j.useState(null),[y,B]=j.useState(!1),[te,U]=j.useState(400),$=j.useRef(v),Z=j.useRef(_),ne=360,z=920;j.useEffect(()=>{$.current=v},[v]),j.useEffect(()=>{Z.current=_},[_]);const L=j.useCallback(S=>{S.preventDefault();const P=S.currentTarget;P.setPointerCapture(S.pointerId);const W=S.clientX,G=te,O=J=>{const Q=W-J.clientX,se=Math.min(z,Math.max(ne,G+Q));U(se)},V=()=>{P.releasePointerCapture(S.pointerId),P.removeEventListener("pointermove",O),P.removeEventListener("pointerup",V),P.removeEventListener("pointercancel",V),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",P.addEventListener("pointermove",O),P.addEventListener("pointerup",V),P.addEventListener("pointercancel",V)},[te]),K=v?[..._.header?[{id:_.header.id,type:_.header.type,scope:"global",title:"Header"}]:[],...v.sections.map(S=>{var P,W;return{id:S.id,type:S.type,scope:"local",title:((P=S.data)==null?void 0:P.title)??((W=S.data)==null?void 0:W.titleHighlight)}}),..._.footer?[{id:_.footer.id,type:_.footer.type,scope:"global",title:"Footer"}]:[]]:[];j.useEffect(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),R(null),g(!1)},[u,e]);const q=j.useCallback(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),R(null),g(!1)},[u,e]),ee=j.useCallback((S,P,W)=>{const G=[...W.sections],O=G.findIndex(Q=>Q.id===S);if(O===-1||P<0||P>=G.length)return;const[V]=G.splice(O,1),J=P>O?P-1:P;G.splice(Math.min(J,G.length),0,V),h({...W,sections:G}),g(!0)},[]),ue=j.useCallback(S=>{var P;if(S.origin===window.location.origin){if(S.data.type===Ce.SECTION_SELECT){A(S.data.section);const W=S.data.itemPath;Array.isArray(W)&&W.length>0?R(W.map(G=>({fieldKey:G.fieldKey,...G.itemId!=null?{itemId:String(G.itemId)}:{}}))):R(null)}if(S.data.type===Ce.INLINE_FIELD_UPDATE){const W=typeof S.data.sectionId=="string"?S.data.sectionId:null,G=typeof S.data.fieldKey=="string"?S.data.fieldKey:null;W&&G&&(h(O=>{if(!O)return O;const V={...O,sections:O.sections.map(J=>J.id===W?{...J,data:{...J.data,[G]:S.data.value}}:J)};return $.current=V,V}),g(!0))}if(S.data.type===Ce.ACTIVE_SECTION_CHANGED&&Y(S.data.activeSectionId??null),S.data.type==="jsonpages:section-reorder"&&$.current){const{sectionId:W,newIndex:G}=S.data;typeof W=="string"&&typeof G=="number"&&G>=0&&ee(W,G,$.current)}if(S.data.type===Ce.SEND_CLEAN_HTML){if(!$.current)return;const W=(P=Z.current.header)==null?void 0:P.data,G={page:$.current,site:Z.current,menu:{main:(W==null?void 0:W.links)??[]},theme:n};c(G,u,S.data.html),g(!1)}}},[u,n,ee,c]);j.useEffect(()=>(window.addEventListener("message",ue),()=>window.removeEventListener("message",ue)),[ue]);const re=j.useCallback(S=>{const P=K.find(W=>W.id===S);P&&A({id:P.id,type:P.type,scope:P.scope}),R(null),M(S)},[K]),ie=j.useCallback(()=>{M(null)},[]),ae=j.useCallback(S=>{h(P=>P&&{...P,sections:P.sections.filter(W=>W.id!==S)}),g(!0),A(P=>(P==null?void 0:P.id)===S?null:P)},[]),oe=S=>{if(!(!I||!v))if(g(!0),I.scope==="global")I.type==="header"&&_.header!=null?C({..._,header:{..._.header,data:S}}):I.type==="footer"&&_.footer!=null&&C({..._,footer:{..._.footer,data:S}});else{const P=v.sections.map(W=>W.id===I.id?{...W,data:S}:W);h({...v,sections:P})}},le=j.useCallback((S,P,W,G)=>{var O,V;if(g(!0),P==="global")((O=_.header)==null?void 0:O.id)===S?C({..._,header:{..._.header,data:G}}):((V=_.footer)==null?void 0:V.id)===S&&C({..._,footer:{..._.footer,data:G}});else if(v){const J=v.sections.map(Q=>Q.id===S?{...Q,data:G}:Q);h({...v,sections:J})}},[v,_]),fe=()=>{var P;const S=document.querySelector("iframe");(P=S==null?void 0:S.contentWindow)==null||P.postMessage({type:Ce.REQUEST_CLEAN_HTML},"*")},ve=j.useCallback(async()=>{const S=document.querySelector("iframe");if(!(S!=null&&S.contentWindow))return;const P=crypto.randomUUID();await new Promise(W=>{var V;let G=!1;const O=J=>{var Q,se;J.origin===window.location.origin&&((Q=J.data)==null?void 0:Q.type)===Ce.INLINE_FLUSHED&&((se=J.data)==null?void 0:se.requestId)===P&&(G=!0,window.removeEventListener("message",O),W())};window.addEventListener("message",O),(V=S.contentWindow)==null||V.postMessage({type:Ce.REQUEST_INLINE_FLUSH,requestId:P},"*"),window.setTimeout(()=>{G||(window.removeEventListener("message",O),W())},400)})},[]),w=async()=>{var O;if(!l)return;await ve();const S=$.current,P=Z.current;if(!S)return;const W=(O=P.header)==null?void 0:O.data,G={page:S,site:P,menu:{main:(W==null?void 0:W.links)??[]},theme:n};l(G,u).then(()=>{g(!1),k(!0)}).catch(V=>{console.error("[JsonPages] saveToFile failed",V);const J=V instanceof Error?V.message:String(V);alert(`Save to file failed: ${J}`)})},X=S=>{var G;if(!v)return;const P=((G=s==null?void 0:s.getDefaultSectionData)==null?void 0:G.call(s,S))??{},W={id:crypto.randomUUID(),type:S,data:P,settings:void 0};h({...v,sections:[...v.sections,W]}),g(!0),A({id:W.id,type:S,scope:"local"})};if(!v)return p.jsx("div",{children:"Loading Studio..."});const H=(I==null?void 0:I.scope)==="global"?{sections:[_.header,_.footer].filter(S=>S!=null)}:v,T=[..._.header?[_.header]:[],...v.sections,..._.footer?[_.footer]:[]];return p.jsx(Zr,{mode:"admin",tenantCss:o,adminCss:i,children:p.jsx($r,{mode:"studio",children:p.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[p.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[p.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:p.jsx(Cc,{draft:v,globalDraft:_,themeConfig:n,slug:u,selectedId:I==null?void 0:I.id,scrollToSectionId:N,onScrollRequested:ie})}),p.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:te,minWidth:ne,maxWidth:z},children:[p.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:L}),p.jsx(Sc,{selectedSection:I,pageData:H,allSectionsData:T,onUpdate:oe,onUpdateSection:le,onClose:()=>{A(null),R(null)},expandedItemPath:D,onReorderSection:v?(S,P)=>ee(S,P,v):void 0,allLayers:K,activeSectionId:F,onRequestScrollToSection:re,onDeleteSection:v?ae:void 0,onAddSection:a.length>0?()=>B(!0):void 0,hasChanges:b,onExportHTML:fe,onSaveToFile:l!=null?w:void 0,saveSuccessFeedback:x,onResetToFile:q,pageSlugs:f,currentSlug:u,onPageChange:f.length>1?S=>{const P=pi(S);m(P==="home"?"/admin":`/admin/${P}`)}:void 0})]})]}),p.jsx(Nc,{open:y,onClose:()=>B(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:X})]})})})},Oc=({tenantCss:e,adminCss:t})=>p.jsx(Zr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(Ec,{})});function D0({config:e}){var b,g,x;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=Ac}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(k=>k!=="header"&&k!=="footer"),u={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??ki,exportHTML:((g=e.persistence)==null?void 0:g.exportHTML)??_i,saveToFile:(x=e.persistence)==null?void 0:x.saveToFile},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",f=typeof(a==null?void 0:a.admin)=="string"?a.admin:P0,[v,h]=j.useState(!1);return j.useEffect(()=>{try{i!=null&&i.tokens&&Vn.setTheme(i)}catch(k){console.warn("[JsonPages] setTheme failed",k)}h(!0)},[i]),v?p.jsx(I0,{children:p.jsx(Yi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets},children:p.jsx(He.BrowserRouter,{children:p.jsxs(He.Routes,{children:[p.jsx(He.Route,{path:"/",element:p.jsx(jc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(He.Route,{path:"/*",element:p.jsx(jc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(He.Route,{path:"/admin",element:p.jsx(Tc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(He.Route,{path:"/admin/*",element:p.jsx(Tc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(He.Route,{path:"/admin/preview",element:p.jsx(Oc,{tenantCss:m,adminCss:f})}),p.jsx(He.Route,{path:"/admin/preview/*",element:p.jsx(Oc,{tenantCss:m,adminCss:f})}),p.jsx(He.Route,{path:"*",element:p.jsx(c,{})})]})})})}):p.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}const R0=({hasChanges:e,onExportJSON:t,onExportHTML:r,onAddSection:n})=>p.jsxs("div",{className:"h-14 border-b border-zinc-800 bg-zinc-950 flex items-center justify-between px-6 shrink-0 z-50 relative",children:[p.jsx("div",{className:"flex items-center gap-3",children:n!=null&&p.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors",title:"Add section","aria-label":"Add section",children:[p.jsx(Gd,{size:14}),p.jsx("span",{children:"Add section"})]})}),p.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 opacity-20 pointer-events-none",children:p.jsx("span",{className:"text-xs font-black tracking-[0.2em] text-zinc-100",children:"JSONPAGES STUDIO"})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium transition-all border bg-zinc-900 border-zinc-700 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",children:[p.jsx(Xi,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:me("flex items-center gap-2 px-4 py-1.5 rounded-md text-xs font-bold transition-all shadow-lg",e?"bg-blue-600 text-white hover:bg-blue-500 shadow-blue-900/20":"bg-zinc-900 text-zinc-600 cursor-not-allowed"),children:[p.jsx(Fd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});xe.AddSectionLibrary=Nc,xe.AdminSidebar=Sc,xe.ConfigProvider=Yi,xe.ControlBar=R0,xe.DefaultNotFound=Ac,xe.FormFactory=Nr,xe.InputWidgets=er,xe.JsonPagesEngine=D0,xe.PageRenderer=oo,xe.PreviewEntry=Ec,xe.STUDIO_EVENTS=Ce,xe.SectionRenderer=fr,xe.StudioProvider=$r,xe.StudioStage=Cc,xe.ThemeLoader=Zr,xe.cn=me,xe.exportBakedHTML=_i,xe.exportProjectJSON=ki,xe.resolveAssetUrl=Dl,xe.themeManager=Vn,xe.useConfig=ur,xe.useStudio=Gi,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})}));
|